oracle 11g 通過主機(jī)的RMAN備份,測(cè)試庫異機(jī)恢復(fù)數(shù)據(jù)庫,rman報(bào)錯(cuò)
忘記保存截圖了,口述事情大概主機(jī)SID:orcl
測(cè)試庫SID:test
主庫RMAN備份在本地
通過scp把參數(shù)文件,控制文件,數(shù)據(jù)文件,歸檔文件傳到測(cè)試庫相同目錄
測(cè)試庫啟動(dòng)到nomunt狀態(tài)
rman target /

先恢復(fù)控制文件:rman>restore controlfile from 'scp傳過來的控制文件路徑';
測(cè)試庫啟動(dòng)到mount狀態(tài):rman>alter database mount;
結(jié)果報(bào)錯(cuò)識(shí)別不到控制文件中orcl實(shí)例
反應(yīng)過來測(cè)試庫的SID時(shí)test,主庫的SID是orcl,不同步,沒法恢復(fù)
進(jìn)入sql,create pfile=‘/home/oracle/initorcl.ora' from spfile; 創(chuàng)建一個(gè)pfile
修改initorcl.ora這個(gè)pfile文件,創(chuàng)建需要的目錄
再次使用這個(gè)pfile文件打開數(shù)據(jù)庫,
startup nomount from pfile=’/home/oracle/initorcl.ora';
再次恢復(fù)控制文件:rman>restore controlfile from 'scp傳過來的控制文件路徑';
啟動(dòng)到mount狀態(tài):rman>alter database mount;成功
最后通過rman恢復(fù)數(shù)據(jù)庫,指定到/u01/oradata/emr/:rman> run{ allocate channel c1 device type disk; allocate channel c2 device type disk; allocate channel c3 device type disk; allocate channel c4 device type disk; set newname for database to '/u01/oradata/emr/%b'; restore database; switch datafile all; switch tempfile all; recover database; }
下一篇:Oracle 12c PDB的數(shù)據(jù)備份恢復(fù)