- 論壇徽章:
- 8
|
本帖最后由 我忒忙 于 2016-06-02 15:49 編輯
某銀行需要恢復2004年磁帶備份數據庫 8.0.5,當時因為開發(fā)商使用begin backup命令進行熱備,然后壓縮到磁帶上.在硬盤緊張,rman不成熟的時代,使用這樣的方法備份本身沒有大問題,可是因為沒有備份歸檔日志,給現在的恢復帶來了很多的問題.
嘗試不完全恢復啟動庫
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> recover database using backup controlfile until cancel;
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內容 請關注我:
QQ截圖20160417100740.png (12.72 KB, 下載次數: 66)
下載附件
2016-06-02 15:48 上傳
|
|