kdbchk: the amount of space used is not equal to block size

一.对数据文件检查

注意:应该在关闭数据库模式下进行bbed的操作

[[email protected] controlfile]$  dbv file=/u01/app/oracle/oradata/ORCL/datafile/test_01.dbf blocksize=8192

DBVERIFY: Release 10.2.0.1.0 - Production on Fri Jan 16 23:05:01 2015

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

DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf
Block Checking: DBA = 20974772, Block Type = KTB-managed data block
data header at 0xb7ee3264
kdbchk: the amount of space used is not equal to block size
        used=3681 fsc=7 avsp=4407 dtl=8088
Page 3252 failed with check code 6110

DBVERIFY - Verification complete

Total Pages Examined         : 12800
Total Pages Processed (Data) : 3204
Total Pages Failing   (Data) : 1
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 68
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 9528
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Highest block SCN            : 434362 (0.434362)
[[email protected] controlfile]$ 

文件test_01.dbf的3252块 出现问题

二.查找资料

  dbsnake的建议,将所有itl的fsc全部改为0,然后将kdbh.kdbhavsp和kdbh.kdbhtosp的值改成相等。它们的值都等于dbv校验中显示的dtl-used=8088-3681=4407。

三.利用bbed修复

BBED> set dba 5,3252
        DBA             0x01400cb4 (20974772 5,3252)

BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf
BLOCK = 3252

Block Checking: DBA = 20974772, Block Type = KTB-managed data block
data header at 0xb7e7b264
kdbchk: the amount of space used is not equal to block size
        used=3681 fsc=7 avsp=4407 dtl=8088
Block 3252 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 Empty            : 0
Total Blocks Marked Corrupt   : 0
Total Blocks Influx           : 0

BBED> print kdbh
struct kdbh, 14 bytes                       @100
   ub1 kdbhflag                             @100      0x00 (NONE)
   b1 kdbhntab                              @101      1
   b2 kdbhnrow                              @102      333
   sb2 kdbhfrre                             @104     -1
   sb2 kdbhfsbo                             @106      684
   sb2 kdbhfseo                             @108      5423
   b2 kdbhavsp                              @110      4407
   b2 kdbhtosp                              @112      4416

BBED> 

3.1 查看itl中的fsc

BBED> p ktbbhitl
struct ktbbhitl[0], 24 bytes                @44
   struct ktbitxid, 8 bytes                 @44
      ub2 kxidusn                           @44       0x0004
      ub2 kxidslt                           @46       0x001e
      ub4 kxidsqn                           @48       0x000000eb
   struct ktbituba, 8 bytes                 @52
      ub4 kubadba                           @52       0x00803a71
      ub2 kubaseq                           @56       0x005f
      ub1 kubarec                           @58       0x30
   ub2 ktbitflg                             @60       0x2001 (KTBFUPB)
   union _ktbitun, 2 bytes                  @62
      b2 _ktbitfsc                          @62       7
      ub2 _ktbitwrp                         @62       0x0007
   ub4 ktbitbas                             @64       0x0006a0ba
struct ktbbhitl[1], 24 bytes                @68
   struct ktbitxid, 8 bytes                 @68
      ub2 kxidusn                           @68       0x0002
      ub2 kxidslt                           @70       0x0022
      ub4 kxidsqn                           @72       0x000000f8
   struct ktbituba, 8 bytes                 @76
      ub4 kubadba                           @76       0x008090ac
      ub2 kubaseq                           @80       0x0085
      ub1 kubarec                           @82       0x1f
   ub2 ktbitflg                             @84       0x8000 (KTBFCOM)
   union _ktbitun, 2 bytes                  @86
      b2 _ktbitfsc                          @86       0
      ub2 _ktbitwrp                         @86       0x0000
   ub4 ktbitbas                             @88       0x000600bc

BBED>

修改 b2 _ktbitfsc 的值使其为0.

BBED> dump /v dba 5,3252 offset 62 count 32
 File: /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf (5)
 Block: 3252    Offsets:   62 to   93  Dba:0x01400cb4
-------------------------------------------------------
 0700baa0 06000200 2200f800 0000ac90 l ..籂...."...

                                                     80008500 1f000080 0000bc00 06000000 l ..............

 <16 bytes per line> 

BBED> modify /x 00 dba 5,3252 offset 62
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
 File: /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf (5)
 Block: 3252             Offsets:   62 to   93           Dba:0x01400cb4
------------------------------------------------------------------------
 0000baa0 06000200 2200f800 0000ac90 80008500 1f000080 0000bc00 06000000 

 <32 bytes per line>

BBED> 

BBED> print ktbbhitl
struct ktbbhitl[0], 24 bytes                @44
   struct ktbitxid, 8 bytes                 @44
      ub2 kxidusn                           @44       0x0004
      ub2 kxidslt                           @46       0x001e
      ub4 kxidsqn                           @48       0x000000eb
   struct ktbituba, 8 bytes                 @52
      ub4 kubadba                           @52       0x00803a71
      ub2 kubaseq                           @56       0x005f
      ub1 kubarec                           @58       0x30
   ub2 ktbitflg                             @60       0x2001 (KTBFUPB)
   union _ktbitun, 2 bytes                  @62
      b2 _ktbitfsc                          @62       0
      ub2 _ktbitwrp                         @62       0x0000
   ub4 ktbitbas                             @64       0x0006a0ba
struct ktbbhitl[1], 24 bytes                @68
   struct ktbitxid, 8 bytes                 @68
      ub2 kxidusn                           @68       0x0002
      ub2 kxidslt                           @70       0x0022
      ub4 kxidsqn                           @72       0x000000f8
   struct ktbituba, 8 bytes                 @76
      ub4 kubadba                           @76       0x008090ac
      ub2 kubaseq                           @80       0x0085
      ub1 kubarec                           @82       0x1f
   ub2 ktbitflg                             @84       0x8000 (KTBFCOM)
   union _ktbitun, 2 bytes                  @86
      b2 _ktbitfsc                          @86       0
      ub2 _ktbitwrp                         @86       0x0000
   ub4 ktbitbas                             @88       0x000600bc

BBED> sum
Check value for File 5, Block 3252:
current = 0x0e90, required = 0x0e97

BBED> sum apply
Check value for File 5, Block 3252:
current = 0x0e97, required = 0x0e97

BBED>

3.2 修改kdbh.kdbhavsp和kdbh.kdbhtosp的值=8088-3681=4407

BBED> print kdbh
struct kdbh, 14 bytes                       @100
   ub1 kdbhflag                             @100      0x00 (NONE)
   b1 kdbhntab                              @101      1
   b2 kdbhnrow                              @102      333
   sb2 kdbhfrre                             @104     -1
   sb2 kdbhfsbo                             @106      684
   sb2 kdbhfseo                             @108      5423
   b2 kdbhavsp                              @110      4407
   b2 kdbhtosp                              @112      4416

BBED> dump /v dba 5,3252 offset 112 count 32
 File: /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf (5)
 Block: 3252    Offsets:  112 to  143  Dba:0x01400cb4
-------------------------------------------------------
 40110000 4d01b01d b81dc01d c81dd01d l @...M.

                                               d81de01d e81df01d f81d001e 081e101e l ......

 <16 bytes per line>

BBED>

--4416的16进制1140 转储后为 4011 

BBED> dump /v dba 5,3252 offset 110 count 32
 File: /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf (5)
 Block: 3252    Offsets:  110 to  141  Dba:0x01400cb4
-------------------------------------------------------
 37114011 00004d01 b01db81d c01dc81d l [email protected]

                                                 d01dd81d e01de81d f01df81d 001e081e l ....

 <16 bytes per line>

BBED> 

--4407的16进制1137 转储后为3711

--修改值
BBED> modify /x 3711 dba 5,3252 offset 112
 File: /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf (5)
 Block: 3252             Offsets:  112 to  143           Dba:0x01400cb4
------------------------------------------------------------------------
 37110000 4d01b01d b81dc01d c81dd01d d81de01d e81df01d f81d001e 081e101e 

 <32 bytes per line>

BBED> 

--应用

BBED> sum apply
Check value for File 5, Block 3252:
current = 0x0ee0, required = 0x0ee0

BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf
BLOCK = 3252

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

--利用dbv检查

[[email protected] controlfile]$  dbv file=/u01/app/oracle/oradata/ORCL/datafile/test_01.dbf blocksize=8192

DBVERIFY: Release 10.2.0.1.0 - Production on Fri Jan 16 23:40:02 2015

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

DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/ORCL/datafile/test_01.dbf

DBVERIFY - Verification complete

Total Pages Examined         : 12800
Total Pages Processed (Data) : 3204
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 68
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 9528
Total Pages Marked Corrupt   : 0
Total Pages Influx           : 0
Highest block SCN            : 434362 (0.434362)
[[email protected] controlfile]$
时间: 2024-08-10 23:28:36

kdbchk: the amount of space used is not equal to block size的相关文章

磁盘被占满 &nbsp; 系统出现 no space left on 报错(block被占满/inode被占满)

系统出现 no space left on 报错 但是使用df -h 发现磁盘并没有满 企业中在什么情况下会发生 解答: ext4文件系统在格式化的时候会创建inode 和 block 磁盘空间满是由inode和block两个标准来决定的 题意说用df -h 查看没有满 df -h 是查看block块的说明block块没有满所以应使用df -i 查看inode是否满了 1 block被占满 定位问题 查看实际文件占用空间的大小 # find / -type f | xargs du -s | a

利用BBED恢复UPDATE修改前的值

实验过程如下: 1.创建表guo_test1 [email protected]> create table guoyJoe_t1(id int,name varchar2(10)); Table created. [email protected]> insert into guoyJoe_t1 values(1,'guoyJoe'); 1 row created. [email protected]> insert into guoyJoe_t1 values(1,'tom'); 1

【Oracle】使用bbed恢复update的数据

使用bbed不仅仅可以找回已经delete的数据还可以恢复update的数据,当然过程要比恢复delete的数据复杂一些. 实验过程如下: [email protected]>create table bbed_test(x int,y varchar2(20)); Table created. [email protected]>insert into bbed_test values(1,'BADLY9'); 1 row created. [email protected]>inse

使用BBED手工提交事务

测试数据准备: SQL> create user sunhailong identifiedby abcd; User created. SQL> alter user sunhailong defaulttablespace users; User altered. SQL> grant dba to sunhailong; Grant succeeded. SQL> conn sunhailong Enter password: Connected. SQL> SQL&g

[20190226]测试使用bbed恢复索引.txt

--//上午做tab$删除恢复测试时发现,tab$的索引i_tab1很小.可以尝试使用bbed解决这个问题.--//首先在普通表上做一个测试看看. 1.环境:SCOTT@book> @ ver1PORT_STRING                    VERSION        BANNER------------------------------ -------------- -------------------------------------------------------

[20190531]ORA-600 kokasgi1故障模拟与恢复(后续).txt

--//http://blog.itpub.net/267265/viewspace-2646340/=>[20190531]ORA-600 kokasgi1故障模拟与恢复.txt--//后续有一些恢复没做,补充测试看看. --//先更正链接http://blog.itpub.net/267265/viewspace-2646340/的一些错误:--//1.前面做坏块恢复时,少写了执行步骤:.BBED> assign kcbh.seq_kcbh = 0x01--//2.使用system用户登录

[20190531]ORA-600 kokasgi1故障模拟与恢复.txt

--//昨天看链接:http://www.xifenfei.com/2019/05/ora-600-kokasgi1-recovery.html,google半天看到的还是惜分飞网站的链接.--//既然他提到sys和system被人重命名,解决相对容易,通过测试说明问题.千万不要在生产系统做这样的测试.--//再次提醒大家,下载oracle介质要选择官方网站并且要做md5sum,不对坚决不要使用!!一些工具下载也要注意检查里面的一些登录执行的sql脚本.--//另外千万注意不要使用别人的电脑登录

使用BBED恢复DELETE的数据

测试环境请参见 使用BBED手工提交事务 尝试恢复delete的数据: BBED> modify /x 2c offset 5064 File: /data/orcl/orcl/users01.dbf (4) Block: 68               Offsets: 5064 to 5071           Dba:0x01000044 ------------------------------------------------------------------------ 2

Low overhead memory space management

Methods, apparatus, and systems, including computer programs encoded on a computer storage medium, manage an address space. In some implementations, a method includes managing an allocation data structure for a memory, wherein the allocation data str