ORA-00600: 內部錯誤程式碼,引數: [6122]

Xuan_Baby發表於2012-07-11

分析過程:
1、tjcw資料庫後臺alert告警大量出現如下的ora-00600錯誤告警
        Fri Jul 06 15:59:13 2012
        Errors in file f:\oracle\admin\tjcw\udump\tjcw_ora_3200.trc:
        ORA-00600: 內部錯誤程式碼,引數: [6122], [0], [1], [0], [], [], [], []
       Recovery of Online Redo Log: Thread 1 Group 2 Seq 3588 Reading mem 0
       Mem# 0 errs 0: F:\ORACLE\ORADATA\TJCW\REDO02.LOG
2、從 f:\oracle\admin\tjcw\udump\tjcw_ora_3200.trc日誌可以看到如下的資訊。
     Block header dump:  0x0248f58c
       Object id on Block? Y
      seg/obj: 0x19d7e  csc: 0xbae.b4053409  itc: 120  flg: E  typ: 2 - INDEX
       brn: 0  bdba: 0x248f589 ver: 0x01
       inc: 0  exflg: 0
3、從oracle metalink的doc[ID 99300.1],可以看出ora-00600 [6122]和索引損壞有關。
4、從上面2,3兩步基本上可以確認是索引損壞導致600錯誤。
5、現在需要證實是否真的是索引損壞導致的錯誤。
      A. 從seg/obj: 0x19d7e可以計算出這個Oracle的物件的object_id,因為是16機制,
           需要換算成10機制。
          0x19d7e=14+7*16+13*16*16+9*16*16*16+1*16*16*16*16=105854
      B. 找出是什麼資料庫物件。
          SQL> select owenr,object_name,object_type from dba_objects where     
                    object_id=105854;                                                                                  
          OWNER       OBJECT_NAME       OBJECT_TYPE                                         
            -----------          ---------------             ----------------------------------
          BDCWYB      SYS_EVENT_IDX_1   INDEX
     C. 這個索引存放在哪些Datafile上面。
          SQL>select distinct FILE_ID from dba_extents where wner='BDCWYB' and
            segment_name='SYS_EVENT_IDX_1';
         FILE_ID
           ----------
            9        
       SQL> select file_name from dba_data_files where file_id=9;     
           FILE_NAME                                                      
          ---------------------------------------------------------------
          F:\ORACLE\ORADATA\TJCW\USERS01.DBF  
    D. 是用Oracle dbv工具測試user01.dbf是否真的存在壞塊. 從失敗的頁總數
        (索引):1再次確認存在索引壞塊.                                                       
      C:\ >dbv file=F:\ORACLE\ORADATA\TJCW\USERS01.DBF
             blocksize=8192                                                                                           
       DBVERIFY: Release 9.2.0.1.0 - Production on 星期五 7月 6 15:46:23   
        2012                                          
       Copyright (c) 1982, 2002, Oracle Corporation.  All rights   
     reserved.                                                                                                                               
      DBVERIFY - 驗證正在開始 : FILE =   
      
F:\ORACLE\ORADATA\TJCW\USERS01.DBF                              
      Block Checking: DBA = 38335884, Block Type = KTB-managed data 
     
block                              
    **** actual rows locked by itl 1  = 1 != # in trans. header = 2                                  
     ---- end index block validation                                                                  
      頁 587148 失敗,校驗程式碼為 6401                                                                                                                                                                  
      DBVERIFY - 驗證完成                                                                              
      檢查的頁總數         :589600                                                                    
      處理的頁總數(資料):455602                                                                     
      失敗的頁總數(資料):0                                                                          
      處理的頁總數(索引):113755                                                                     
      失敗的頁總數(索引):1                                                                          
      處理的頁總數(其它):12760                                                                      
      處理的總頁數 (段)  : 0                                                                           
      失敗的總頁數 (段)  : 0                                                                           
      空的頁總數            :7483                                                                     
     標記為損壞的總頁數:0                                                                            
    匯入的頁總數           :0  
6、從上面的分析得知,確實是索引壞塊導致的600錯誤,故需要重建索引,消除600告警.

處理步驟:

1. 從上面的分析得知確實是索引壞塊導致的600錯誤,現在重建索引,不能使用rebuild index,因為索引損壞的部分是索引段頭,rebuild index會報如下的錯誤。
      SQL> alter index BDCWYB.SYS_EVENT_IDX_1 
              rebuild;                                                                                         
    alter index BDCWYB.SYS_EVENT_IDX_1 rebuild         c                
*                                                                  
    ERROR 位於第 1 行:                                                 
   ORA-00600: 內部錯誤程式碼,引數: [6122], [0], [1], [0], [], [], [], []
    drop index BDCWYB.SYS_EVENT_IDX_1;
    create index BDCWYB.SYS_EVENT_IDX_1 on BDCWYB.SYS_EVENT(EVT_GUID) 
    tablespace users;
2. 索引重建好了之後之後,再次檢查是否還存在壞塊,現在無壞塊。
       C:\>dbv file=F:\ORACLE\ORADATA\TJCW\USERS01.DBF blocksize=8192
     DBVERIFY: Release 9.2.0.1.0 - Production on 星期五 7月 6 16:35:38 2012
     Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
     DBVERIFY - 驗證正在開始 : FILE = F:\ORACLE\ORADATA\TJCW\USERS01.DBF
    DBVERIFY - 驗證完成
      檢查的頁總數         :590720
      處理的頁總數(資料):455602
      失敗的頁總數(資料):0
      處理的頁總數(索引):114951
      失敗的頁總數(索引):0
      處理的頁總數(其它):12760
      處理的總頁數 (段)  : 0
      失敗的總頁數 (段)  : 0
      空的頁總數            :7407
      標記為損壞的總頁數:0
      匯入的頁總數           :0

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

相關文章