RMAN中如何使用set命令

发布时间:2021-11-11 14:50:08 作者:小新
来源:亿速云 阅读:216

小编给大家分享一下RMAN中如何使用set命令,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

一、set newname命令:
If you are restoring some data files to new locations, then execute RESTORE DATABASE and RECOVER DATABASE sequentially in a RUN command. Use the SET NEWNAME to rename data files, as described in "Restoring Datafiles to a Nondefault Location".
如果要将某些数据文件还原到新位置,请在RUN命令中按顺序执行RESTORE DATABASE和RECOVER DATABASE。 使用SET NEWNAME重命名数据文件,如"将数据文件还原到非默认位置"中所述。

The following example restores the database, specifying new names for three of the data files, and then recovers the database:
RUN
{  
  SET NEWNAME FOR DATAFILE 2 TO '/disk2/df2.dbf';
  SET NEWNAME FOR DATAFILE 3 TO '/disk2/df3.dbf';
  SET NEWNAME FOR DATAFILE 4 TO '/disk2/df4.dbf';
  RESTORE DATABASE;
  SWITCH DATAFILE ALL;
  RECOVER DATABASE;
}

二、Restoring Datafiles to a Nondefault Location(将数据文件还原到非默认位置)
If you cannot restore data files to their default locations, then you must update the control file to reflect the new locations of the data files. Use the RMAN SET NEWNAME command within a RUN command to specify the new file name. Afterward, use a SWITCH command, which is equivalent to using the SQL statement ALTER DATABASE RENAME FILE, to update the names of the data files in the control file. SWITCH DATAFILE ALL updates the control file to reflect the new names for all data files for which a SET NEWNAME has been issued in a RUN command.
如果无法将数据文件恢复到其默认位置,则必须更新控制文件以反映数据文件的新位置。 在RUN命令中使用RMAN SET NEWNAME命令来指定新的文件名。 之后,使用一个SWITCH命令(相当于使用SQL语句ALTER DATABASE RENAME FILE)来更新控制文件中数据文件的名称。  SWITCH DATAFILE ALL将更新控制文件,以反映在RUN命令中为SET NEWNAME发出的所有数据文件的新名称。

以上是“RMAN中如何使用set命令”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

推荐阅读:
  1. RMAN命令简解
  2. Rman--备份命令

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

rman set命令

上一篇:RAC中OCR备份与恢复的方法有哪些

下一篇:Django中的unittest应用是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》