記錄8.0.5數據庫恢復過程

某銀行須要恢復2004年磁帶備份數據庫 8.0.5,當時由於開發商使用begin backup命令進行熱備,而後壓縮到磁帶上.在硬盤緊張,rman不成熟的時代,使用這樣的方法備份自己沒有大問題,但是由於沒有備份歸檔日誌,給如今的恢復帶來了不少的問題.
嘗試不徹底恢復啓動庫數據庫

SVRMGR> startup pfile='init.ora' mountoracle

ORACLE instance started.spa

Total System Global Area                        141826208 bytes日誌

Fixed Size                                          47264 bytescode

Variable Size                                   124829696 bytes事務

Database Buffers                                 16777216 bytesci

Redo Buffers                                       172032 bytes開發

Database mounted.it

SVRMGR> recover database using backup controlfile until cancel;io

ORA-00279: change 613561556 generated at 08/21/04 22:42:48 needed for thread 1

ORA-00289: suggestion : /oracle/product/8.0.5/dbs/arch1_55329.dbf

ORA-00280: change 613561556 for thread 1 is in sequence #55329

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

cancel

Media recovery cancelled.

SVRMGR> alter database open resetlogs;

alter database open resetlogs

*

ORA-00600: internal error code, arguments: [4146], [31400], [31370], [], [], [], [], []

這個錯誤是由於回滾段corruption致使,客戶已經沒有了一致性要求,因此解決辦法是經過一些手段找出回滾段並屏蔽

屏蔽回滾段重啓庫

SVRMGR> shutdown abort

ORACLE instance shut down.

SVRMGR> startup  pfile='init.ora' mount

ORACLE instance started.

Total System Global Area                        141826208 bytes

Fixed Size                                          47264 bytes

Variable Size                                   124829696 bytes

Database Buffers                                 16777216 bytes

Redo Buffers                                       172032 bytes

Database mounted.

SVRMGR> alter database open;

alter database open

*

ORA-00600: internal error code, arguments: [3668], [1], [2], [55992], [55992], [4], [], []

根據ORA-00600[3668]錯誤的提示,由於重建控制文件,有一個數據文件由於在磁帶恢復丟失,因此控制文件在上次重建的時候沒有包含進去,根據經驗在8.0中能夠經過resetlogs解決

resetlogs從新打開數據庫

SVRMGR> alter database open resetlogs;

alter database open resetlogs

*

ORA-01139: RESETLOGS option only valid after an incomplete database recovery

SVRMGR> recover datatabase using backup controlfile until cancel;

ORA-00274: illegal recovery option DATATABASE

SVRMGR> recover database using backup controlfile until cancel;

ORA-00279: change 613561558 generated at 07/30/12 09:14:49 needed for thread 1

ORA-00289: suggestion : /oracle/product/8.0.5/dbs/arch1_1.dbf

ORA-00280: change 613561558 for thread 1 is in sequence #1

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

cancel

Media recovery cancelled.

SVRMGR> alter database open resetlogs;

alter database open resetlogs

*

ORA-00604: error occurred at recursive SQL level 1

ORA-01555: snapshot too old: rollback segment number  with name "" too small

根據經驗多是屏蔽了undo或者undo損壞,而後有事務可能須要讀undo,沒法讀到對應記錄,可能出現此錯誤,由於無trace文件,嘗試推動scn解決.固然這個問題能夠經過open時作10046而後深刻分析也許能夠找到緣由.

open數據庫成功
根據上面的分析,重啓庫,推動scn,resetlogs庫解決問題

SVRMGR> shutdown immediate

ORA-01109: database not open

Database dismounted.

ORACLE instance shut down.

SVRMGR> startup pfile='init.ora' mount;

ORACLE instance started.

Total System Global Area                        141826208 bytes

Fixed Size                                          47264 bytes

Variable Size                                   124829696 bytes

Database Buffers                                 16777216 bytes

Redo Buffers                                       172032 bytes

Database mounted.

SVRMGR> alter database open ;

alter database open

*

ORA-00600: internal error code, arguments: [3668], [1], [2], [55994], [55994], [4], [], []

SVRMGR> recover database using backup controlfile until cancel;

ORA-00279: change 613561560 generated at 07/30/12 09:17:11 needed for thread 1

ORA-00289: suggestion : /oracle/product/8.0.5/dbs/arch1_1.dbf

ORA-00280: change 613561560 for thread 1 is in sequence #1

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

cancel

Media recovery cancelled.

SVRMGR> alter database open resetlogs;

Statement processed.

此次恢復比較幸運,在備份到磁帶過程當中被覆蓋的一個同名的數據文件,由於是index,經過查詢dba_extents,而後刪除並重建相關index,s數據庫算恢復徹底.有些時候,對數據庫多一份備份,可能成爲最後的救命稻草,哪怕是一份不是十分完整的備份.再次重複:對dba而言,數據庫備份重於一切

 

更多Oracle精彩內容請關注我:

相關文章
相關標籤/搜索