一次特殊的資料庫恢復

lixiang114發表於2010-04-13

記錄一次特殊的資料庫恢復起因:2alpha主機與raid5組成配置,因為os所在的硬碟故障,需要將oracle恢復到alpha1上。任務:

一、在alpha上重灌oracle資料庫二、試圖恢復因為磁碟故障造成的資料庫down

OS: Tru64 5.1

DB: Oracle 9201 for Tru64

alpha1
掛好硬碟後裝上Tru64 5.1打好補丁、裝上了oracle、建立好例項後,想要copy原資料檔案的時候被使用者告知不知道資料檔案放哪裡,自從2002年後沒有碰過這個資料庫,頓時無語。。。所幸控制檔案和pfile被我找到了,還好可以startup nomount alter database mount,然後確認了下redologdatafile後將這些東西都copy了回來,直接alter database open,接著一連串的ora-600出現了。。。
ORA-600 [kcratr1_lostwrt], [], [], [], [], [], [], []
SQL>alter database open
ORA-00600: internal error code, arguments: [kcratr1_lostwrt], [], [], [], [], [], [], []
看了下alert日誌google了一下,可以使用recover database 嘗試恢復一下,
SQL>recover database
ora-00283 recovery session canceled due to errors
………………..
ORA-00600: internal error code, arguments: [3020], [8388713], [1], [157], [4], [16], [], []接著看alert日誌
ORA-00600: internal error code, arguments: [3020], [8388713], [1], [157], [4], [16], [], []
ORA-10567: Redo is inconsistent with data block (file# 2, block# 105)
ORA-10564: tablespace UNDOTBS1
ORA-01110: data file 2: '/oracle/ora9/undotbs01.dbf'
ORA-10560: block type 'KTU SMU HEADER BLOCK'
Errors with log .
Media Recovery failed with error 600
ORA-283 signalled during: ALTER DATABASE RECOVER database ...
應該是恢復的時候需要用到UNDOTBS1,但是這個表空間不可用了,導致recover錯誤。想起了使用_ALLOW_RESETLOGS_CORRUPTION隱含引數,可是該引數在當前redolog損壞、沒有備份、沒有歸檔的時候使用,只是後2條滿足我的環境,。current redo是可用的,沒辦法,實在沒有別的辦法了,只有硬著頭皮試試了。
SQL> ALTER SYSTEM SET "_allow_resetlogs_corruption"=TRUE SCOPE=SPFILE;
SQL>shutdown immediate
SQL>startup mount
SQL>recover database using backup controlfile until cancel;
SQL>alter database open resetlogs
………….
等了很久
………..
ORA-03313:end-of-file on communication channel

ORA-00600: internal error code, arguments: [2662], [0], [32281372], [0], [32366091], [8388617], [], []再次檢視alert日誌:
Mon Sep 21 15:20:49 2009
Errors in file /usr/users/oracle/app/oracle/admin/ora9/udump/ora9_ora_21790.trc:
ORA-00600: internal error code, arguments: [2662], [0], [32281372], [0], [32366091], [8388617], [], []
Mon Sep 21 15:20:53 2009
Errors in file /usr/users/oracle/app/oracle/admin/ora9/udump/ora9_ora_21790.trc:
ORA-00600: internal error code, arguments: [2662], [0], [32281372], [0], [32366091], [8388617], [], []
Mon Sep 21 15:20:53 2009
Error 600 happened during db open, shutting down database
USER: terminating instance due to error 600
Instance terminated by USER, pid = 21790
ORA-1092 signalled during: alter database open resetlogs...
Mon Sep 21 15:25:53 2009
USER: terminating instance due to error 1092
Instance terminated by USER, pid = 21790
又報了個600新錯誤,,google下,原來是伴隨著ora600[3020]之後,出現的scn相關問題,對症下藥
SQL> alter session set events '10015 trace name adjust_scn level 1';
觀察ora600 第三、第五個引數分別是3228137232366091相差不大,所以level 1足夠頑強的繼續open
SQL>alter database open
ORA-01092:ORACLE instance terminated.Disconnection
重新開了個終端:
SQL>startup
依然是mounted
SQL>alter database open
ORA-1092 signalled during: alter database open...
還是頑強的看alert日誌
Mon Sep 21 16:27:54 2009
Errors in file /usr/users/oracle/app/oracle/admin/ora9/bdump/ora9_smon_22354.trc:
ORA-00600: internal error code, arguments: [4193], [509], [512], [], [], [], [], []

出現的第四個ORA600 [4193]不過這個600比較經典了,是回滾段損壞的問題,似乎看到了一點曙光!!觀察完日誌,接著修改pfile
SQL>create pfile=’/usr/user/oracle/pfile2009.ora’ from spfile
新增了
._corrupted_rollback_segments='_SYSSMU1$','_SYSSMU2$','_SYSSMU3$','_SYSSMU4$','_SYSSMU5$','_SYSSMU6$','_SYSSMU7$','_SYSSMU8$','_SYSSMU9$','_SYSSMU10$'
SQL>shutdown immediate
SQL>startup pfile=’/usr/user/oracle/pfile2009.ora’

SQL>recover database until cancel
Cancel
SQL>alter database open resetlogs
………
………
看到了
Instance opend
確認了下
SQL>select status from v$instance
open

然後按使用者exp了庫、imp到新庫,至此恢復任務完成

[@more@]

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

相關文章