eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 日志信息:kewastUnPackStats(): bad magic 1 - Bug | Blog首页 | Oracle O001 / O00n 进程 100% CPU资源耗用 »

DBV 坏块检测:Corrupt block relative dba之源

在使用dbv进行坏块检测时,会抛出文件号、块号等信息,这个信息来自于文件头的信息记录。

以下是验证说明,正常情况下的检测输出:
[orat0@hpserver2 lib]$ dbv file=/app/oracle/product/10.2.0/dbf.ggx blocksize=8192 start=1 end=3

DBVERIFY: Release 10.2.0.5.0 - Production on Tue Jun 5 16:04:10 2012

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

DBVERIFY - Verification starting : FILE = dbf.ggx


DBVERIFY - Verification complete

Total Pages Examined         : 3
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 3
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 0
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Highest block SCN            : 796355 (0.796355)

通过BBED进行修改,
[orat0@hpserver2 lib]$ bbed parfile=par.txt

BBED: Release 2.0.0.0.0 - Limited Production on Tue Jun 5 16:04:16 2012

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

************* !!! For Oracle Internal Use only !!! ***************

BBED> set file 3
BBED-00205: illegal or out of range DBA (File 3, Block 1)


BBED> p u^U
BBED> set file 2
    FILE#              2

BBED> p kcvfh
struct kcvfh, 676 bytes                     @0       
   struct kcvfhbfh, 20 bytes                @0       
      ub1 type_kcbh                         @0        0x0b
      ub1 frmt_kcbh                         @1        0xa2
      ub1 spare1_kcbh                       @2        0x00
      ub1 spare2_kcbh                       @3        0x00
      ub4 rdba_kcbh                         @4        0x01400001
      ub4 bas_kcbh                          @8        0x00000000
      ub2 wrp_kcbh                          @12       0x0000
      ub1 seq_kcbh                          @14       0x01
      ub1 flg_kcbh                          @15       0x04 (KCBHFCKV)
      ub2 chkval_kcbh                       @16       0xe0b1
      ub2 spare3_kcbh                       @18       0x0000
   struct kcvfhhdr, 76 bytes                @20      
      ub4 kccfhswv                          @20       0x00000000
      ub4 kccfhcvn                          @24       0x0a200000
      ub4 kccfhdbi                          @28       0x392986ff
      text kccfhdbn[0]                      @32      O
      text kccfhdbn[1]                      @33      R
      text kccfhdbn[2]                      @34      C
      text kccfhdbn[3]                      @35      L
      text kccfhdbn[4]                      @36      1
      text kccfhdbn[5]                      @37      0
      text kccfhdbn[6]                      @38      G
      text kccfhdbn[7]                      @39       
      ub4 kccfhcsq                          @40       0x0000156a
      ub4 kccfhfsz                          @44       0x00000280
      s_blkz kccfhbsz                       @48       0x00
      ub2 kccfhfno                          @52       0x0005
      ub2 kccfhtyp                          @54       0x0003
      ub4 kccfhacid                         @56       0x00000000
      ub4 kccfhcks                          @60       0x00000000
      text kccfhtag[0]                      @64       
      text kccfhtag[1]                      @65       
      text kccfhtag[2]                      @66       
      text kccfhtag[3]                      @67       
      text kccfhtag[4]                      @68       
      text kccfhtag[5]                      @69       
      text kccfhtag[6]                      @70       
      text kccfhtag[7]                      @71       
      text kccfhtag[8]                      @72       
      text kccfhtag[9]                      @73       
      text kccfhtag[10]                     @74       
      text kccfhtag[11]                     @75       
      text kccfhtag[12]                     @76       
      text kccfhtag[13]                     @77       
      text kccfhtag[14]                     @78       
      text kccfhtag[15]                     @79       
      text kccfhtag[16]                     @80       
      text kccfhtag[17]                     @81       
      text kccfhtag[18]                     @82       
      text kccfhtag[19]                     @83       
      text kccfhtag[20]                     @84       
      text kccfhtag[21]                     @85       
      text kccfhtag[22]                     @86       
      text kccfhtag[23]                     @87       
      text kccfhtag[24]                     @88       
      text kccfhtag[25]                     @89       
      text kccfhtag[26]                     @90       
      text kccfhtag[27]                     @91       
      text kccfhtag[28]                     @92       
      text kccfhtag[29]                     @93       
      text kccfhtag[30]                     @94       
      text kccfhtag[31]                     @95       
   ub4 kcvfhrdb                             @96       0x00000000
   struct kcvfhcrs, 8 bytes                 @100     
      ub4 kscnbas                           @100      0x0009582c
      ub2 kscnwrp                           @104      0x0000
   ub4 kcvfhcrt                             @108      0x2e2e3876
   ub4 kcvfhrlc                             @112      0x2e2c08bf
   struct kcvfhrls, 8 bytes                 @116     
      ub4 kscnbas                           @116      0x00000001
      ub2 kscnwrp                           @120      0x0000
   ub4 kcvfhbti                             @124      0x00000000
   struct kcvfhbsc, 8 bytes                 @128     
      ub4 kscnbas                           @128      0x00000000
      ub2 kscnwrp                           @132      0x0000
   ub2 kcvfhbth                             @136      0x0000
   ub2 kcvfhsta                             @138      0x0004 (KCVFHOFZ)
   struct kcvfhckp, 36 bytes                @484     
      struct kcvcpscn, 8 bytes              @484     
         ub4 kscnbas                        @484      0xf00ed6dd
         ub2 kscnwrp                        @488      0x0bab
      ub4 kcvcptim                          @492      0x2ec9f476
      ub2 kcvcpthr                          @496      0x0001
      union u, 12 bytes                     @500     
         struct kcvcprba, 12 bytes          @500     
            ub4 kcrbaseq                    @500      0x00000080
            ub4 kcrbabno                    @504      0x00000002
            ub2 kcrbabof                    @508      0x0010
      ub1 kcvcpetb[0]                       @512      0x02
      ub1 kcvcpetb[1]                       @513      0x00
      ub1 kcvcpetb[2]                       @514      0x00
      ub1 kcvcpetb[3]                       @515      0x00
      ub1 kcvcpetb[4]                       @516      0x00
      ub1 kcvcpetb[5]                       @517      0x00
      ub1 kcvcpetb[6]                       @518      0x00
      ub1 kcvcpetb[7]                       @519      0x00
   ub4 kcvfhcpc                             @140      0x000000d5
   ub4 kcvfhrts                             @144      0x2ec00569
   ub4 kcvfhccc                             @148      0x000000d4
   struct kcvfhbcp, 36 bytes                @152     
      struct kcvcpscn, 8 bytes              @152     
         ub4 kscnbas                        @152      0x00000000
         ub2 kscnwrp                        @156      0x0000
      ub4 kcvcptim                          @160      0x00000000
      ub2 kcvcpthr                          @164      0x0000
      union u, 12 bytes                     @168     
         struct kcvcprba, 12 bytes          @168     
            ub4 kcrbaseq                    @168      0x00000000
            ub4 kcrbabno                    @172      0x00000000
            ub2 kcrbabof                    @176      0x0000
      ub1 kcvcpetb[0]                       @180      0x00
      ub1 kcvcpetb[1]                       @181      0x00
      ub1 kcvcpetb[2]                       @182      0x00
      ub1 kcvcpetb[3]                       @183      0x00
      ub1 kcvcpetb[4]                       @184      0x00
      ub1 kcvcpetb[5]                       @185      0x00
      ub1 kcvcpetb[6]                       @186      0x00
      ub1 kcvcpetb[7]                       @187      0x00
   ub4 kcvfhbhz                             @312      0x00000000
   struct kcvfhxcd, 16 bytes                @316     
      ub4 space_kcvmxcd[0]                  @316      0x00000000
      ub4 space_kcvmxcd[1]                  @320      0x00000000
      ub4 space_kcvmxcd[2]                  @324      0x00000000
      ub4 space_kcvmxcd[3]                  @328      0x00000000
   word kcvfhtsn                            @332      5
   ub2 kcvfhtln                             @336      0x0003
   text kcvfhtnm[0]                         @338     G
   text kcvfhtnm[1]                         @339     G
   text kcvfhtnm[2]                         @340     X
   text kcvfhtnm[3]                         @341      
   text kcvfhtnm[4]                         @342      
   text kcvfhtnm[5]                         @343      
   text kcvfhtnm[6]                         @344      
   text kcvfhtnm[7]                         @345      
   text kcvfhtnm[8]                         @346      
   text kcvfhtnm[9]                         @347      
   text kcvfhtnm[10]                        @348      
   text kcvfhtnm[11]                        @349      
   text kcvfhtnm[12]                        @350      
   text kcvfhtnm[13]                        @351      
   text kcvfhtnm[14]                        @352      
   text kcvfhtnm[15]                        @353      
   text kcvfhtnm[16]                        @354      
   text kcvfhtnm[17]                        @355      
   text kcvfhtnm[18]                        @356      
   text kcvfhtnm[19]                        @357      
   text kcvfhtnm[20]                        @358      
   text kcvfhtnm[21]                        @359      
   text kcvfhtnm[22]                        @360      
   text kcvfhtnm[23]                        @361      
   text kcvfhtnm[24]                        @362      
   text kcvfhtnm[25]                        @363      
   text kcvfhtnm[26]                        @364      
   text kcvfhtnm[27]                        @365      
   text kcvfhtnm[28]                        @366      
   text kcvfhtnm[29]                        @367      
   ub4 kcvfhrfn                             @368      0x00000005
   struct kcvfhrfs, 8 bytes                 @372     
      ub4 kscnbas                           @372      0x00000000
      ub2 kscnwrp                           @376      0x0000
   ub4 kcvfhrft                             @380      0x2e2e4052
   struct kcvfhafs, 8 bytes                 @384     
      ub4 kscnbas                           @384      0x00000000
      ub2 kscnwrp                           @388      0x0000
   ub4 kcvfhbbc                             @392      0x00000000
   ub4 kcvfhncb                             @396      0x00000000
   ub4 kcvfhmcb                             @400      0x00000000
   ub4 kcvfhlcb                             @404      0x00000000
   ub4 kcvfhbcs                             @408      0x00000000
   ub2 kcvfhofb                             @412      0x0000
   ub2 kcvfhnfb                             @414      0x0000
   ub4 kcvfhprc                             @416      0x00000000
   struct kcvfhprs, 8 bytes                 @420     
      ub4 kscnbas                           @420      0x00000000
      ub2 kscnwrp                           @424      0x0000
   struct kcvfhprfs, 8 bytes                @428     
      ub4 kscnbas                           @428      0x00000000
      ub2 kscnwrp                           @432      0x0000
   ub4 kcvfhtrt                             @444      0x00000000

偏移量 368 处为: kcvfhrfn ,这就是文件号的来源,具有决定性影响。

BBED> set offset 368
    OFFSET             368

BBED> dump
 File: /t0/orat0/app/oracle/product/10.2.0/db_1/rdbms/lib/dbf.ggx (2)
 Block: 1                Offsets:  368 to  879           Dba:0x00800001
------------------------------------------------------------------------
 05000000 00000000 00000000 52402e2e 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 ddd60ef0 ab0b2e7c 76f4c92e
 01008e00 80000000 02000000 10000000 02000000 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 0d000d00 0d000100 00000000
 00000000 00000000 02004001 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>

将文件号修改为 07 :
BBED> modify /x 07
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) Y
 File: /t0/orat0/app/oracle/product/10.2.0/db_1/rdbms/lib/dbf.ggx (2)
 Block: 1                Offsets:  368 to  879           Dba:0x00800001
------------------------------------------------------------------------
 07000000 00000000 00000000 52402e2e 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 ddd60ef0 ab0b2e7c 76f4c92e
 01008e00 80000000 02000000 10000000 02000000 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 0d000d00 0d000100 00000000
 00000000 00000000 02004001 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> sum apply
Check value for File 2, Block 1:
current = 0xe0b3, required = 0xe0b3

BBED> exit

再检测时可以发现文件号变更为 7 ,所有块都被标记为坏块:

[orat0@hpserver2 lib]$ dbv file=dbf.ggx blocksize=8192 start=1 end=3

DBVERIFY: Release 10.2.0.5.0 - Production on Tue Jun 5 16:06:35 2012

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

DBVERIFY - Verification starting : FILE = dbf.ggx
Page 1 is marked corrupt
Corrupt block relative dba: 0x01c00001 (file 7, block 1)
Bad header found during dbv:
Data in bad block:
 type: 11 format: 2 rdba: 0x01400001
 last change scn: 0x0000.00000000 seq: 0x1 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x00000b01
 check value in block header: 0xe0b3
 computed block checksum: 0x0

Page 2 is marked corrupt
Corrupt block relative dba: 0x01c00002 (file 7, block 2)
Bad header found during dbv:
Data in bad block:
 type: 29 format: 2 rdba: 0x01400002
 last change scn: 0x0000.000c26c3 seq: 0x2 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x26c31d02
 check value in block header: 0xbb3c
 computed block checksum: 0x0

Page 3 is marked corrupt
Corrupt block relative dba: 0x01c00003 (file 7, block 3)
Bad header found during dbv:
Data in bad block:
 type: 30 format: 2 rdba: 0x01400003
 last change scn: 0x0000.000c26c3 seq: 0x1 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x26c31e01
 check value in block header: 0x4ebc
 computed block checksum: 0x0



DBVERIFY - Verification complete

Total Pages Examined         : 3
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 0
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 0
Total Pages Marked Corrupt   : 3
Total Pages Influx           : 0
Highest block SCN            : 0 (0.0)
文件头有3处信息与文件号有关,但是仅此处与DBV检测相关。

测试环境为10g,10.2.0.5版本。


历史上的今天...
    >> 2010-06-05文章:
    >> 2009-06-05文章:
    >> 2008-06-05文章:
           这是一个Oracle普及的时代
    >> 2007-06-05文章:
           Canon 400D的梦魇
    >> 2006-06-05文章:
    >> 2005-06-05文章:
           西塘游记之三

无觅

By eygle on 2012-06-05 17:15 | Comments (0) | Backup&Recovery | 3016 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com