oracle rman 恢复更改数据文件位置
【摘要】 在Oracle 11g之前,RMAN只支持SET NEWNAME FOR DATAFILE,在Oracle 11g中增加了SET NEWNAME FOR TEMPFILE/SET NEWNAME FOR TABLESPACE/SET NEWNAME FOR DATABASE的命令。优先顺序如下:1.SET NEWNAME FOR DATAFILE and SET NEWNAME FOR TE...
在Oracle 11g之前,RMAN只支持SET NEWNAME FOR DATAFILE,在Oracle 11g中增加了SET NEWNAME FOR TEMPFILE/SET NEWNAME FOR TABLESPACE/SET NEWNAME FOR DATABASE的命令。
优先顺序如下:
1.SET NEWNAME FOR DATAFILE and SET NEWNAME FOR TEMPFILE
2.SET NEWNAME FOR TABLESPACE
3.SET NEWNAME FOR DATABASE
run {
allocate channel c1 type 'sbt_tape';
allocate channel c2 type 'sbt_tape';
allocate channel c3 type 'sbt_tape';
allocate channel c4 type 'sbt_tape';
allocate channel c5 type 'sbt_tape';
allocate channel c6 type 'sbt_tape';
send 'NB_ORA_CLIENT=feichedb1';
set newname for database to '+bidata/test/datafile_%U';
restore database;
switch datafile all;
}
#测试输出信息:
RMAN> run {
2> set newname for database to '/arch/bentest/oradata/newloc/%b';
3> switch datafile all;
4> }
2> set newname for database to '/arch/bentest/oradata/newloc/%b';
3> switch datafile all;
4> }
executing command: SET NEWNAME
datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=827504182 file name=/arch/bentest/oradata/newloc/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=827504185 file name=/arch/bentest/oradata/newloc/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=827504179 file name=/arch/bentest/oradata/newloc/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=827504177 file name=/arch/bentest/oradata/newloc/bigtbs01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=827504178 file name=/arch/bentest/oradata/newloc/wwli.dbf
input datafile copy RECID=7 STAMP=827504182 file name=/arch/bentest/oradata/newloc/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=827504185 file name=/arch/bentest/oradata/newloc/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=827504179 file name=/arch/bentest/oradata/newloc/undotbs01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=827504177 file name=/arch/bentest/oradata/newloc/bigtbs01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=827504178 file name=/arch/bentest/oradata/newloc/wwli.dbf
【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)