Oracle數據庫文件損壞修復(斷電情況下)


現場情況:
    1
、數據庫沒有作歸檔,
    2
、數據都存放在system表空間
    3、沒有備份
狀況:
   
操作系統由於磁盤原因出現宕機,用戶強行按電源關閉系統,數據庫無法啟動。
處理:
   

Sql代碼

  1. SQL> recover database;   
  2. ORA-00283: recovery session canceled due to errors   
  3. ORA-12801: error signaled in parallel query server P002   
  4. ORA-10562: Error occurred while applying redo to data block (file# 1, block#4568)   
  5. ORA-10564: tablespace SYSTEM   
  6. ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'  
  7. ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 576   
  8. ORA-00600: internal error code, arguments: [6101]   
  9.      

SQL> recover database;

ORA-00283: recovery session canceled due to errors

ORA-12801: error signaled in parallel query server P002

ORA-10562: Error occurred while applying redo to data block (file# 1, block#4568)

ORA-10564: tablespace SYSTEM

ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'

ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 576

ORA-00600: internal error code, arguments: [6101]

 


檢查日志信息如下:

Oracle代碼

  1. Mon Nov 19 15:38:50 2007  
  2. ALTER DATABASE RECOVER  database     
  3. Mon Nov 19 15:38:50 2007  
  4. Media Recovery Start   
  5.  parallel recovery started with 3 processes   
  6. Mon Nov 19 15:38:50 2007  
  7. Recovery of Online Redo Log: Thread 1 Group 3 Seq 16 Reading mem 0  
  8.   Mem# 0 errs 0: /opt/oracle/oradata/orcl/redo03.log   
  9. Mon Nov 19 15:38:50 2007  
  10. Errors in file /opt/oracle/admin/orcl/bdump/orcl_p002_7917.trc:   
  11. ORA-00600: internal error code, arguments: [6101], [0], [17], [0], [], [], [], []   
  12. Mon Nov 19 15:38:50 2007  
  13. Errors in file /opt/oracle/admin/orcl/bdump/orcl_p000_7913.trc:   
  14. ORA-00600: internal error code, arguments: [3020], [2], [882], [8389490], [], [], [], []   
  15. ORA-10567: Redo is inconsistent with data block (file# 2, block# 882)   
  16. ORA-10564: tablespace UNDOTBS1   
  17. ORA-01110: data file 2: '/opt/oracle/oradata/orcl/undotbs01.dbf'  
  18. ORA-10560: block type 'KTU UNDO BLOCK'  
  19. Mon Nov 19 15:38:51 2007  
  20. Errors in file /opt/oracle/admin/orcl/bdump/orcl_p000_7913.trc:   
  21. ORA-00600: internal error code, arguments: [3020], [2], [882], [8389490], [], [], [], []   
  22. ORA-10567: Redo is inconsistent with data block (file# 2, block# 882)   
  23. ORA-10564: tablespace UNDOTBS1   
  24. ORA-01110: data file 2: '/opt/oracle/oradata/orcl/undotbs01.dbf'  
  25. ORA-10560: block type 'KTU UNDO BLOCK'  
  26. Mon Nov 19 15:38:51 2007  
  27. Errors in file /opt/oracle/admin/orcl/bdump/orcl_p002_7917.trc:   
  28. ORA-10562: Error occurred while applying redo to data block (file# 1, block# 4568)   
  29. ORA-10564: tablespace SYSTEM   
  30. ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'  
  31. ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 576  
  32. ORA-00600: internal error code, arguments: [6101], [0], [17], [0], [], [], [], []   
  33. Mon Nov 19 15:38:54 2007  
  34. Errors in file /opt/oracle/admin/orcl/bdump/orcl_p001_7915.trc:   
  35. ORA-00600: internal error code, arguments: [kddummy_blkchk], [1], [1658], [6101], [], [], [], []   
  36. Mon Nov 19 15:38:54 2007  
  37. Errors in file /opt/oracle/admin/orcl/bdump/orcl_p001_7915.trc:   
  38. ORA-10562: Error occurred while applying redo to data block (file# 1, block# 1658)   
  39. ORA-10564: tablespace SYSTEM   
  40. ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'  
  41. ORA-10561: block type 'TRANSACTION MANAGED DATA BLOCK', data object# 237  
  42. ORA-00607: Internal error occurred while making a change to a data block   
  43. ORA-00600: internal error code, arguments: [kddummy_blkchk], [1], [1658], [6101], [], [], [], []   
  44. Mon Nov 19 15:38:54 2007  
  45. Media Recovery failed with error 12801  
  46. ORA-283 signalled during: ALTER DATABASE RECOVER  database  ...  

Mon Nov 19 15:38:50 2007

ALTER DATABASE RECOVER  database 

Mon Nov 19 15:38:50 2007

Media Recovery Start

 parallel recovery started with 3 processes

Mon Nov 19 15:38:50 2007

Recovery of Online Redo Log: Thread 1 Group 3 Seq 16 Reading mem 0

  Mem# 0 errs 0: /opt/oracle/oradata/orcl/redo03.log

Mon Nov 19 15:38:50 2007

Errors in file /opt/oracle/admin/orcl/bdump/orcl_p002_7917.trc:

ORA-00600: internal error code, arguments: [6101], [0], [17], [0], [], [], [], []

Mon Nov 19 15:38:50 2007

Errors in file /opt/oracle/admin/orcl/bdump/orcl_p000_7913.trc:

ORA-00600: internal error code, arguments: [3020], [2], [882], [8389490], [], [], [], []

ORA-10567: Redo is inconsistent with data block (file# 2, block# 882)

ORA-10564: tablespace UNDOTBS1

ORA-01110: data file 2: '/opt/oracle/oradata/orcl/undotbs01.dbf'

ORA-10560: block type 'KTU UNDO BLOCK'

Mon Nov 19 15:38:51 2007

Errors in file /opt/oracle/admin/orcl/bdump/orcl_p000_7913.trc:

ORA-00600: internal error code, arguments: [3020], [2], [882], [8389490], [], [], [], []

ORA-10567: Redo is inconsistent with data block (file# 2, block# 882)

ORA-10564: tablespace UNDOTBS1

ORA-01110: data file 2: '/opt/oracle/oradata/orcl/undotbs01.dbf'

ORA-10560: block type 'KTU UNDO BLOCK'

Mon Nov 19 15:38:51 2007

Errors in file /opt/oracle/admin/orcl/bdump/orcl_p002_7917.trc:

ORA-10562: Error occurred while applying redo to data block (file# 1, block# 4568)

ORA-10564: tablespace SYSTEM

ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'

ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 576

ORA-00600: internal error code, arguments: [6101], [0], [17], [0], [], [], [], []

Mon Nov 19 15:38:54 2007

Errors in file /opt/oracle/admin/orcl/bdump/orcl_p001_7915.trc:

ORA-00600: internal error code, arguments: [kddummy_blkchk], [1], [1658], [6101], [], [], [], []

Mon Nov 19 15:38:54 2007

Errors in file /opt/oracle/admin/orcl/bdump/orcl_p001_7915.trc:

ORA-10562: Error occurred while applying redo to data block (file# 1, block# 1658)

ORA-10564: tablespace SYSTEM

ORA-01110: data file 1: '/opt/oracle/oradata/orcl/system01.dbf'

ORA-10561: block type 'TRANSACTION MANAGED DATA BLOCK', data object# 237

ORA-00607: Internal error occurred while making a change to a data block

ORA-00600: internal error code, arguments: [kddummy_blkchk], [1], [1658], [6101], [], [], [], []

Mon Nov 19 15:38:54 2007

Media Recovery failed with error 12801

ORA-283 signalled during: ALTER DATABASE RECOVER  database  ...


從上面信息中抓取了一個信息:

Oracle代碼

  1. ORA-10562: Error occurred while applying redo to data block (file# 1, block# 1658)  

ORA-10562: Error occurred while applying redo to data block (file# 1, block# 1658)


針對這個錯誤解決如下:

Oracle代碼

  1. ORA-10562: Error occurred while applying redo to data block (file# string, block# string)   
  2. Cause: See other errors on error stack.   
  3. Action: Investigate why the error occurred and how important is the data block. Media and standby database recovery usually can continue if user allows recovery to corrupt this data block。  

ORA-10562: Error occurred while applying redo to data block (file# string, block# string)

Cause: See other errors on error stack.

Action: Investigate why the error occurred and how important is the data block. Media and standby database recovery usually can continue if user allows recovery to corrupt this data block。


從日志信息可以基本判斷問題如下:
當前在線日志損壞,導致undo回滾段出現問題,又由於系統突然掉電,系統表空間在重啟實例后要進行實例恢復,當前在線日志損壞,系統表空間無法進行recover,因而出現了上面的錯誤。
找到了問題,解決訪問就有了。
由於沒有備份,數據庫也運行在非歸檔模式下,所以恢復如下步驟:

Sql代碼

  1. SQL>startup mount   
  2. SQL>recover database using backup controlfile until cancel;   
  3. SQL>alter database open resetlogs;   
  4. SQL> startup mount   
  5. SQL> alter system set “_allow_resetlogs_corruption=true scope=spfile;   
  6. SQL>shutdown immediate   
  7. SQL> startup mount   
  8. SQL> alter database open resetlogs;   
  9. SQL> startup  

SQL>startup mount

SQL>recover database using backup controlfile until cancel;

SQL>alter database open resetlogs;

SQL> startup mount

SQL> alter system set “_allow_resetlogs_corruption=true scope=spfile;

SQL>shutdown immediate

SQL> startup mount

SQL> alter database open resetlogs;

SQL> startup


基本恢復步驟:

Sql代碼

  1. SQL>startup mount   
  2. SQL>recover database using backup controlfile until cancel;   
  3. Cancel   
  4. SQL>alter database open resetlogs;   
  5. #此時會提示system表空間需要恢復,但是由於當前日志損壞,無法進行恢復,所以需要加入#隱含參數,oracle才不會監測scn的一致性,才能打開數據庫。   
  6. #重啟數據庫加入隱含參數   
  7. SQL> startup mount   
  8. SQL> alter system set “_allow_resetlogs_corruption=true scope=spfile;   
  9. SQL> shutdown immediate   
  10. SQL> startup mount   
  11. SQL> alter database open resetlogs;   
  12. alter database open resetlogs   
  13. *   
  14. ERROR at line 1:   
  15. ORA-01092: ORACLE instance terminated. Disconnection forced   
  16. #不管這些,再次登錄sqlplus起動數據庫   
  17. SQL*Plus: Release 10.2.0.1.0 - Production on Fri Nov 16 08:03:43 2007   
  18. Copyright (c) 1982, 2005, Oracle.  All rights reserved.   
  19. Connected to:   
  20. Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production   
  21. With the Partitioning, OLAP and Data Mining options   
  22. SQL>startup  

SQL>startup mount

SQL>recover database using backup controlfile until cancel;

Cancel

SQL>alter database open resetlogs;

#此時會提示system表空間需要恢復,但是由於當前日志損壞,無法進行恢復,所以需要加入#隱含參數,oracle才不會監測scn的一致性,才能打開數據庫。

#重啟數據庫加入隱含參數

SQL> startup mount

SQL> alter system set “_allow_resetlogs_corruption=true scope=spfile;

SQL> shutdown immediate

SQL> startup mount

SQL> alter database open resetlogs;

alter database open resetlogs

*

ERROR at line 1:

ORA-01092: ORACLE instance terminated. Disconnection forced

#不管這些,再次登錄sqlplus起動數據庫

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Nov 16 08:03:43 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL>startup


數據庫正常打開,exp備份需要的數據,然后重新建庫,導入數據。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM