学习bbed的过程中,修改了file# 4,block 396之后遇到
kdbchk: the amount of space used is not equal to block size错误 oracle@localhost.localdomain:/home/oracle/backup>dbv file=/opt/oracle/oradata/orcl/users01.dbf blocksize=8192
DBVERIFY: Release 10.2.0.1.0 - Production on Mon Aug 8 08:55:21 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
DBVERIFY - Verification starting : FILE = /opt/oracle/oradata/orcl/users01.dbf
Block Checking: DBA = 16777612, Block Type = KTB-managed data block
data header at 0x2b297003027c
kdbchk: the amount of space used is not equal to block size used=613 fsc=0 avsp=7494 dtl=8064
Page 396 failed with check code 6110
DBVERIFY - Verification complete
Total Pages Examined : 640
Total Pages Processed (Data) : 46
Total Pages Failing (Data) : 1
Total Pages Processed (Index): 63
Total Pages Failing (Index): 0
Total Pages Processed (Other): 142
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Marked Corrupt : 0
Highest block SCN : 747176 (0.747176)
咨询了dbsnake,按照,将所有itl的fsc全部改为0,然后将kdbh.kdbhavsp和kdbh.kdbhtosp的值改成相等,它们的值都等于dbv校验中显示的dtl-used。 DBA 0x0100018c (16777612 4,396)
DBVERIFY - Verification starting
FILE = /opt/oracle/oradata/orcl/users01.dbf
Block Checking: DBA = 16777612, Block Type = KTB-managed data block
kdbchk: the amount of space used is not equal to block size used=613 fsc=41 avsp=7451 dtl=8064
Block 396 failed with check code 6110
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 1
Total Blocks Failing (Data) : 1 Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Marked Corrupt : 0
struct kdbh, 14 bytes @124
ub1 kdbhflag @124 0x00 (NONE)
从上面的结果可以看出平均可利用空间kdbhavsp 和总的可利用空间kdbhtosp大小不一致。 struct ktbbhitl[0], 24 bytes @44
struct ktbitxid, 8 bytes @44
ub4 kxidsqn @48 0x00000000
struct ktbituba, 8 bytes @52
ub4 kubadba @52 0x00000000
ub2 ktbitflg @60 0x8000 (KTBFCOM)
union _ktbitun, 2 bytes @62
ub4 ktbitbas @64 0x000b0c24
struct ktbbhitl[1], 24 bytes @68
struct ktbitxid, 8 bytes @68
ub4 kxidsqn @72 0x0000015b
struct ktbituba, 8 bytes @76
ub4 kubadba @76 0x008000a6
ub2 ktbitflg @84 0x2001 (KTBFUPB)
union _ktbitun, 2 bytes @86
b2 _ktbitfsc @86 41 --不为0 ub4 ktbitbas @88 0x000b2e92
struct ktbbhitl[2], 24 bytes @92
struct ktbitxid, 8 bytes @92
ub4 kxidsqn @96 0x00000000
struct ktbituba, 8 bytes @100
ub4 kubadba @100 0x00000000
ub2 ktbitflg @108 0x0000 (NONE)
union _ktbitun, 2 bytes @110
ub2 _ktbitwrp @110 0x0000
ub4 ktbitbas @112 0x00000000
File: /opt/oracle/oradata/orcl/users01.dbf (4)
Block: 396 Offsets: 86 to 149 Dba:0x0100018c
------------------------------------------------------------------------
2900922e 0b000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000001 0e00ffff 2e00491d 1b1d461d 00000e00 5a1f2f1f 041fdb1e
File: /opt/oracle/oradata/orcl/users01.dbf (4)
Block: 396 Offsets: 86 to 149 Dba:0x0100018c
------------------------------------------------------------------------
0000922e 0b000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000001 0e00ffff 2e00491d 1b1d461d 00000e00 5a1f2f1f 041fdb1e
struct ktbbhitl[0], 24 bytes @44
struct ktbitxid, 8 bytes @44
ub4 kxidsqn @48 0x00000000
struct ktbituba, 8 bytes @52
ub4 kubadba @52 0x00000000
ub2 ktbitflg @60 0x8000 (KTBFCOM)
union _ktbitun, 2 bytes @62
ub4 ktbitbas @64 0x000b0c24
struct ktbbhitl[1], 24 bytes @68
struct ktbitxid, 8 bytes @68
ub4 kxidsqn @72 0x0000015b
struct ktbituba, 8 bytes @76
ub4 kubadba @76 0x008000a6
ub2 ktbitflg @84 0x2001 (KTBFUPB)
union _ktbitun, 2 bytes @86
ub4 ktbitbas @88 0x000b2e92
struct ktbbhitl[2], 24 bytes @92
struct ktbitxid, 8 bytes @92
ub4 kxidsqn @96 0x00000000
struct ktbituba, 8 bytes @100
ub4 kubadba @100 0x00000000
ub2 ktbitflg @108 0x0000 (NONE)
union _ktbitun, 2 bytes @110
ub2 _ktbitwrp @110 0x0000
ub4 ktbitbas @112 0x00000000
struct kdbh, 14 bytes @124
ub1 kdbhflag @124 0x00 (NONE)
修改kdbhavsp的值于kdbhtosp保持一致 File: /opt/oracle/oradata/orcl/users01.dbf (4)
Block: 396 Offsets: 134 to 149 Dba:0x0100018c
------------------------------------------------------------------------
1b1d461d 00000e00 5a1f2f1f 041fdb1e
7494的十六进制对应的值为1D46,考虑到oracle数据块中的存储方式,做如下修改
File: /opt/oracle/oradata/orcl/users01.dbf (4)
Block: 396 Offsets: 134 to 149 Dba:0x0100018c
------------------------------------------------------------------------
461d461d 00000e00 5a1f2f1f 041fdb1e
Check value for File 4, Block 396:
current = 0x2b93, required = 0x2bce
BBED>
sum dba 4,396 apply Check value for File 4, Block 396:
current = 0x2bce, required = 0x2bce
DBVERIFY - Verification starting
FILE = /opt/oracle/oradata/orcl/users01.dbf
Block Checking: DBA = 16777612, Block Type = KTB-managed data block
kdbchk: the amount of space used is not equal to block size used=613 fsc=0 avsp=7494 dtl=8064
Block 396 failed with check code 6110
DBVERIFY - Verification complete
Total Blocks Examined : 1
Total Blocks Processed (Data) : 1
Total Blocks Failing(Data):1 --依然有错误 Total Blocks Processed (Index): 0
Total Blocks Failing (Index): 0
Total Blocks Marked Corrupt : 0
Block header dump: 0x0100018c
seg/obj: 0xcd2e csc: 0x00.b0c24 itc: 3 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1000189 ver: 0x01 opc: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0xffff.000.00000000 0x00000000.0000.00 C--- 0 scn 0x0000.000b0c24
0x02 0x0001.02e.0000015b 0x008000a6.00fa.21 --U- 1
fsc 0x0000.000b2e92 0x03 0x0000.000.00000000 0x00000000.0000.00 ---- 0 fsc 0x0000.00000000
dump 文件中的itl事务槽中的fsc信息和bbed中修改的信息不一致,即仍然有fsc 不为0。是不是这个原因呢?数据块上有回滚事务,关闭数据库以后: DBVERIFY - Verification starting FILE = /opt/oracle/oradata/orcl/users01.dbf 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 Marked Corrupt : 0 DBVERIFY: Release 10.2.0.1.0 - Production on Mon Aug 8 13:19:28 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. DBVERIFY - Verification starting : FILE = /opt/oracle/oradata/orcl/users01.dbf DBVERIFY - Verification complete Total Pages Examined : 640 Total Pages Processed (Data) : 51 Total Pages Failing (Data) : 0 Total Pages Processed (Index): 63 Total Pages Failing (Index): 0 Total Pages Processed (Other): 145 Total Pages Processed (Seg) : 0 Total Pages Failing (Seg) : 0 Total Pages Marked Corrupt : 0 Highest block SCN : 794582 (0.794582)