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备份介绍
Oracle? Database Backup and Recovery Reference
11g Release 2 (11.2)

Part Number E10643-06

语法:


根据语法有三个用法,1.在rman中使用,2.在run块中。 3.混合使用

3.1在rman中使用


3.2 在run块中使用:


3.3 混合使用:


setRunOption

This subclause specifies SET options that are usable within a RUN block.
















来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31397003/viewspace-2149204/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31397003/viewspace-2149204/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值