温馨提示×

温馨提示×

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

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

oracle rman恢复数据文件路径不一致

发布时间:2020-07-28 02:33:52 来源:网络 阅读:761 作者:春秋小记 栏目:关系型数据库

a.如果备份的数据库可以访问,那么执行执行生产转化脚本:
select 'set newname for datafile ' || file# || ' to ''' ||replace( name,'/old/data/path','/new/data/path' ) || ''';' from v$datafile;

b.如果备份的数据库不可以访问,可以trace控制文件内容:
alter database backup controlfile to trace;
在alert查看生成的trace文件路径和名称;

编辑恢复脚本:
vi recover.txt

run{
allocate channel c1 type sbt;
allocate channel c2 type sbt;
allocate channel c3 type sbt;
allocate channel c4 type sbt;
allocate channel c5 type sbt;
allocate channel c6 type sbt;
allocate channel c7 type sbt;
allocate channel c8 type sbt;
set newname for datafile 1 to '/s01/oracle/oradata/prod/system.156.952859152';
set newname for datafile 2 to '/s01/oracle/oradata/prod/sysaux.157.952859154';
set newname for datafile 3 to '/s01/oracle/oradata/prod/undotbs1.258.952859453';
set newname for datafile 4 to '/s01/oracle/oradata/prod/users.159.952855153';
set newname for datafile 5 to '/s01/oracle/oradata/prod/undotbs2.168.956859305';
set newname for datafile 6 to '/s01/oracle/oradata/prod/data.176.952859731';
set newname for datafile 7 to '/s01/oracle/oradata/prod/data.177.952857539';
set newname for datafile 8 to '/s01/oracle/oradata/prod/data.178.952850557';
restore database;
switch datafile all;
recover database;
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}

放在后台恢复:
nohup rman target / @recover.txt log backup.log &

向AI问一下细节

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

AI