consistency value in tail 不一致的恢复

用BBED修复tailchk错误导致的坏块:


<<<检查alert日志,发现96033损坏

SYS@ora11g> select * from songyb;
select * from songyb
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 1, block # 96033)
ORA-01110: data file 1: '/u01/app/oracle/oradata/ora11g/system01.dbf'


SYS@ora11g> 

BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle/oradata/ora11g/system01.dbf
BLOCK = 96033

Block 96033 is corrupt
Corrupt block relative dba: 0x00417721 (file 0, block 96033)
Fractured block found during verification
Data in bad block:
 type: 6 format: 2 rdba: 0x00417721
 last change scn: 0x0000.40032d33 seq: 0x5 flg: 0x06
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x2d330662         <<< tailchk bas_kcbh(后4位)+type_kcbh+seq_kcbh 因此应该为:0x2d330605,修改即可。
 check value in block header: 0x5906
 computed block checksum: 0x0


DBVERIFY - Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing   (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 1
Total Blocks Influx           : 2
Message 531 not found;  product=RDBMS; facility=BBED


BBED> find /c songyb
 File: /u01/app/oracle/oradata/ora11g/system01.dbf (1)
 Block: 96033            Offsets: 8183 to 8191           Dba:0x00417721
------------------------------------------------------------------------
 736f6e67 79620633 2d 

 <32 bytes per line>

BBED>  map /v
 File: /u01/app/oracle/oradata/ora11g/system01.dbf (1)
 Block: 96033                                 Dba:0x00417721
------------------------------------------------------------
 KTB Data Block (Table/Cluster)

 struct kcbh, 20 bytes                      @0       
    ub1 type_kcbh                           @0       
    ub1 frmt_kcbh                           @1       
    ub1 spare1_kcbh                         @2       
    ub1 spare2_kcbh                         @3       
    ub4 rdba_kcbh                           @4       
    ub4 bas_kcbh                            @8       
    ub2 wrp_kcbh                            @12      
    ub1 seq_kcbh                            @14      
    ub1 flg_kcbh                            @15      
    ub2 chkval_kcbh                         @16      
    ub2 spare3_kcbh                         @18      

 struct ktbbh, 72 bytes                     @20      
    ub1 ktbbhtyp                            @20      
    union ktbbhsid, 4 bytes                 @24      
    struct ktbbhcsc, 8 bytes                @28      
    sb2 ktbbhict                            @36      
    ub1 ktbbhflg                            @38      
    ub1 ktbbhfsl                            @39      
    ub4 ktbbhfnx                            @40      
    struct ktbbhitl[2], 48 bytes            @44      

 struct kdbh, 14 bytes                      @92      
    ub1 kdbhflag                            @92      
    sb1 kdbhntab                            @93      
    sb2 kdbhnrow                            @94      
    sb2 kdbhfrre                            @96      
    sb2 kdbhfsbo                            @98      
    sb2 kdbhfseo                            @100     
    sb2 kdbhavsp                            @102     
    sb2 kdbhtosp                            @104     

 struct kdbt[1], 4 bytes                    @106     
    sb2 kdbtoffs                            @106     
    sb2 kdbtnrow                            @108     

 sb2 kdbr[1]                                @110     

 ub1 freespace[8067]                        @112     

 ub1 rowdata[9]                             @8179    

 ub4 tailchk                                @8188    


BBED> d /v offset 8188
 File: /u01/app/oracle/oradata/ora11g/system01.dbf (1)
 Block: 96033   Offsets: 8188 to 8191  Dba:0x00417721
-------------------------------------------------------
 6206332d                            l b.3-

 <16 bytes per line>

BBED> modify /x 05 offset 8188
 File: /u01/app/oracle/oradata/ora11g/system01.dbf (1)
 Block: 96033            Offsets: 8188 to 8191           Dba:0x00417721
------------------------------------------------------------------------
 0506332d 

 <32 bytes per line>

BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle/oradata/ora11g/system01.dbf
BLOCK = 96033

Block 96033 is corrupt
Corrupt block relative dba: 0x00417721 (file 0, block 96033)
Bad check value found during verification
Data in bad block:
 type: 6 format: 2 rdba: 0x00417721
 last change scn: 0x0000.40032d33 seq: 0x5 flg: 0x06
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x2d330605
 check value in block header: 0x5906
 computed block checksum: 0x67


DBVERIFY - Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing   (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 1
Total Blocks Influx           : 0
Message 531 not found;  product=RDBMS; facility=BBED


BBED> sum apply
Check value for File 1, Block 96033:
current = 0x5961, required = 0x5961

BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle/oradata/ora11g/system01.dbf
BLOCK = 96033


DBVERIFY - Verification complete

Total Blocks Examined         : 1
Total Blocks Processed (Data) : 1
Total Blocks Failing   (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 0
Total Blocks Influx           : 0
Message 531 not found;  product=RDBMS; facility=BBED


BBED> 

至此,修复结束。

你可能感兴趣的:(db,recover,Troubleshoot,数据库,运维,linux)