溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

oracle rman恢復(fù)數(shù)據(jù)文件路徑不一致

發(fā)布時(shí)間:2020-07-28 02:33:52 來源:網(wǎng)絡(luò) 閱讀:769 作者:春秋小記 欄目:關(guān)系型數(shù)據(jù)庫

a.如果備份的數(shù)據(jù)庫可以訪問,那么執(zhí)行執(zhí)行生產(chǎn)轉(zhuǎn)化腳本:
select 'set newname for datafile ' || file# || ' to ''' ||replace( name,'/old/data/path','/new/data/path' ) || ''';' from v$datafile;

b.如果備份的數(shù)據(jù)庫不可以訪問,可以trace控制文件內(nèi)容:
alter database backup controlfile to trace;
在alert查看生成的trace文件路徑和名稱;

編輯恢復(fù)腳本:
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;
}

放在后臺(tái)恢復(fù):
nohup rman target / @recover.txt log backup.log &

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI