zoukankan      html  css  js  c++  java
  • BBED标记坏块以及修复坏块

    创建測试表:

    ZBDBA@orcl11g>select * from zbdba;
    NAME
    ------------------------------------------------------------
    zbdba
    huihui
    
    ZBDBA@orcl11g>
    ZBDBA@orcl11g>
    ZBDBA@orcl11g>
    ZBDBA@orcl11g>
    ZBDBA@orcl11g>select rowid,dbms_rowid.rowid_object(rowid) robject,
      2  dbms_rowid.rowid_relative_fno(rowid) fno,
      3  dbms_rowid.rowid_block_number(rowid) bno,
      4  dbms_rowid.rowid_row_number(rowid) rno from zbdba where rownum=1;
    
    ROWID                 ROBJECT        FNO        BNO        RNO
    ------------------ ---------- ---------- ---------- ----------
    AAASMNAAGAAAAC/AAA      74509          6        191          0
    
    
    

    使用bbed改动块状态:

    BBED> set file 6 block 191
            FILE#           6
            BLOCK#          191
    
    BBED> map
    File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
    Block: 191                                   Dba:0x018000bf
    ------------------------------------------------------------
    KTB Data Block (Table/Cluster)
    
    struct kcbh, 20 bytes                      @0      
    
    struct ktbbh, 72 bytes                     @20     
    
    struct kdbh, 14 bytes                      @100    
    
    struct kdbt[1], 4 bytes                    @114    
    
    sb2 kdbr[2]                                @118    
    
    ub1 freespace[8047]                        @122    
    
    ub1 rowdata[19]                            @8169   
    
    ub4 tailchk                                @8188   
    
    
    BBED> p kcbh
    struct kcbh, 20 bytes                       @0      
       ub1 type_kcbh                            @0        0x06
       ub1 frmt_kcbh                            @1        0xa2
       ub1 spare1_kcbh                          @2        0x00
       ub1 spare2_kcbh                          @3        0x00
       ub4 rdba_kcbh                            @4        0x018000bf
       ub4 bas_kcbh                             @8        0x005036cd
       ub2 wrp_kcbh                             @12       0x0000
       ub1 seq_kcbh                             @14       0x01
       ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)
       ub2 chkval_kcbh                          @16       0x426d
       ub2 spare3_kcbh                          @18       0x0000
    
    BBED> modify /x ff offset 14
    Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
    File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
    Block: 191              Offsets:   14 to  525           Dba:0x018000bf
    ------------------------------------------------------------------------
    ff066d42 00000100 00000d23 01009636 50000000 00000200 3200b800 80011300
    02001800 0000e90b 80021100 38000220 0000cd36 50000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000001 0200ffff 1600851f
    6f1f6f1f 00000200 8f1f851f 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    
    <32 bytes per line>
    
    BBED> p kcbh
    struct kcbh, 20 bytes                       @0      
       ub1 type_kcbh                            @0        0x06
       ub1 frmt_kcbh                            @1        0xa2
       ub1 spare1_kcbh                          @2        0x00
       ub1 spare2_kcbh                          @3        0x00
       ub4 rdba_kcbh                            @4        0x018000bf
       ub4 bas_kcbh                             @8        0x005036cd
       ub2 wrp_kcbh                             @12       0x0000
       ub1 seq_kcbh                             @14       0xff
       ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)
       ub2 chkval_kcbh                          @16       0x426d
       ub2 spare3_kcbh                          @18       0x0000
    
    BBED> sum apply
    Check value for File 6, Block 191:
    current = 0x4293, required = 0x4293
    
    再回数据库查看该表:

    ZBDBA@orcl11g>select * from zbdba;
    select * from zbdba
                  *
    ERROR at line 1:
    ORA-01578: ORACLE data block corrupted (file # 6, block # 191)
    ORA-01110: data file 6: '/opt/oracle/oradata/orcl11g/zbdba01.dbf'
    
    

    常规坏块的处理方式:
    1、event 10231
    2、rowid抽取
    3、DBMS_REPAIR

    这里我用bbed修复该块:

    BBED> p kcbh
    struct kcbh, 20 bytes                       @0      
       ub1 type_kcbh                            @0        0x06
       ub1 frmt_kcbh                            @1        0xa2
       ub1 spare1_kcbh                          @2        0x00
       ub1 spare2_kcbh                          @3        0x00
       ub4 rdba_kcbh                            @4        0x018000bf
       ub4 bas_kcbh                             @8        0x005036cd
       ub2 wrp_kcbh                             @12       0x0000
       ub1 seq_kcbh                             @14       0xff
       ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)
       ub2 chkval_kcbh                          @16       0x4293
       ub2 spare3_kcbh                          @18       0x0000
    
    BBED> p tailchk
    ub4 tailchk                                 @8188     0x36cd0601
    
    这里tailchk信息正确,无需改动

    BBED> modify /x 01 offset 14
    Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
    File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)
    Block: 191              Offsets:   14 to  525           Dba:0x018000bf
    ------------------------------------------------------------------------
    01069342 00000100 00000d23 01009636 50000000 00000200 3200b800 80011300
    02001800 0000e90b 80021100 38000220 0000cd36 50000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000001 0200ffff 1600851f
    6f1f6f1f 00000200 8f1f851f 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    
    <32 bytes per line>
    
    BBED> p kcbh
    struct kcbh, 20 bytes                       @0      
       ub1 type_kcbh                            @0        0x06
       ub1 frmt_kcbh                            @1        0xa2
       ub1 spare1_kcbh                          @2        0x00
       ub1 spare2_kcbh                          @3        0x00
       ub4 rdba_kcbh                            @4        0x018000bf
       ub4 bas_kcbh                             @8        0x005036cd
       ub2 wrp_kcbh                             @12       0x0000
       ub1 seq_kcbh                             @14       0x01
       ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)
       ub2 chkval_kcbh                          @16       0x4293
       ub2 spare3_kcbh                          @18       0x0000
    
    BBED> sum apply
    Check value for File 6, Block 191:
    current = 0x426d, required = 0x426d
    
    BBED> verify
    DBVERIFY - Verification starting
    FILE = /opt/oracle/oradata/orcl11g/zbdba01.dbf
    BLOCK = 191
    
    
    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
    
    再次去数据库查询:

    ZBDBA@orcl11g>select * from zbdba;
    NAME
    ------------------------------------------------------------
    zbdba
    huihui





  • 相关阅读:
    电话线路使用的带通虑波器的宽带为3KHz (300~3300Hz),根据奈奎斯特采样定理,最小采样频率应为(16)。
    总线宽度为32bit,时钟频率为200MHz,若总线上每5个时钟周期传送一个32bit的字,则该总线的带宽为 (4) MB/S。
    安全需求可划分为物理安全、网络安全、系统安全和应用安全,下面的安全需求中属于系统安全的是(67),属于应用安全的是(68)。
    IP地址202.117.17.254/22是什么地址?
    公司的到一个B类地址块,需要划分成若干个包含1000台主机的子网,则可以划分成几个?
    PGP(Pretty Good Privacy)是一种电子邮件加密软件包,它提供数据加密和数字签名两种服务,采用(42)进行身份认证,使用(43) (128位密钥)进行数据加密,使用(44)进行数据完整性验证。 A.RSA公钥证书 B.RSA私钥证书 C.Kerboros证书 D.DES私钥证书
    comet反向Ajax模型原理与模型(笔记一)
    EasyARM-iMX257_U-Boot源代码移植分析
    linux移植u-boot(一)——U-Boot详解+自定义命令实战
    Ajax实现大文件切割上传
  • 原文地址:https://www.cnblogs.com/jhcelue/p/6738056.html
Copyright © 2011-2022 走看看