standby庫,在sqlplus下用recover standby database進行手工恢復

westzq1984發表於2014-02-25
一個standby庫出問題,丟了1個歸檔
檢查主庫的日誌,發現丟失的歸檔的SEQ的redo還未被覆蓋,馬上將其拷貝出來傳遞到備庫上

嘗試catalog,雖然沒有報錯,但是實際沒有註冊成功
RMAN> catalog archivelog '/u01/app/oracle/oradata/ORCL/redo03_281.arc';                    

cataloged archived log
archived log file name=/u01/app/oracle/oradata/ORCL/redo03_281.arc RECID=297 STAMP=840464160

嘗試使用sqlplus的recover命令來恢復,提示是standby controlfile,無法進行
SQL> recover database ;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

SQL> recover database using backup controlfile;
ORA-00283: recovery session canceled due to errors
ORA-01666: control file is for a standby database

沒找到sqlplus下recover命令的reference,最後瞎嘗試,總算試了出來
SQL> recover standby database;                                                     <==
ORA-00279: change 1728518 generated at 06/08/2013 20:13:37 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/fast_recovery_area/DGORCL/archivelog/2014_02_25/o1_mf_1_281_%u_.
arc
ORA-00280: change 1728518 for thread 1 is in sequence #281


Specify log: {=suggested | filename | AUTO | CANCEL}
/u01/app/oracle/oradata/ORCL/redo03_281.arc
ORA-00279: change 1729863 generated at 06/08/2013 20:14:03 needed for thread 1
ORA-00289: suggestion :
/u01/app/oracle/fast_recovery_area/DGORCL/archivelog/2014_02_25/o1_mf_1_282_9jrd
kdb4_.arc
ORA-00280: change 1729863 for thread 1 is in sequence #282
ORA-00278: log file '/u01/app/oracle/oradata/ORCL/redo03_281.arc' no longer
needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.

恢復該歸檔後,DG恢復正常。

其實,還有個解決辦法,從主庫生成一個控制檔案備份過來,用該控制檔案mount庫,就可以用recover database using backup controlfile進行恢復
這個案例中可以看到,redo log拷貝出來後,是無法作為archivelog給catalog進控制檔案的

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8242091/viewspace-1088825/,如需轉載,請註明出處,否則將追究法律責任。

相關文章