【BBED】使用bbed 修改data block Block Misplaced

使用bbed 修改数据块物理校验出错的问题。
SQL> select * from yangtab;
select * from yangtab
              *
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 388)
ORA-01110: data file 4: '/opt/oracle/oradata/orcl/users01.dbf'
使用dbv 进行验证。
oracle@localhost.localdomain:/home/oracle>dbv file=/opt/oracle/oradata/orcl/users01.dbf 
DBVERIFY: Release 10.2.0.1.0 - Production on Sun Aug 7 20:01:34 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
DBVERIFY - Verification starting : FILE = /opt/oracle/oradata/orcl/users01.dbf
Page 388 is marked corrupt
Corrupt block relative dba: 0x01000184 (file 4, block 388)
Bad header found during dbv: 
Data in bad block:
 type: 6 format: 2 rdba: 0x0100018c与本来应该的rdba  0x01000184不一致。
 last change scn: 0x0000.000b0c25 seq: 0x2 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x0c250602
 check value in block header: 0x24df
 computed block checksum: 0x0
 
#Block Checking: DBA = 16777612, Block Type = KTB-managed data block
#data header at 0x2b92e120827c
#kdbchk: the amount of space used is not equal to block size
#        used=613 fsc=41 avsp=7451 dtl=8064
#Page 396 failed with check code 6110-- 这是另一个问题,查看技术解决
DBVERIFY - Verification complete
Total Pages Examined         : 640
Total Pages Processed (Data) : 45
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 Empty            : 389
Total Pages Marked Corrupt   : 1
Total Pages Influx           : 0
Highest block SCN            : 747176 (0.747176)

从上面dbv检查的信息查看,数据块388的错误信息属于数据块的物理校验Block Misplaced
解决方法是使用bbed 修改kcbh.rdba_kcbh 的值和Corrupt block relative dba: 0x01000184 (file 4, block 388)中的rdba一致。
BBED> set dba 4,388
        DBA             0x01000184 (16777604 4,388)
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        0x0100018c
   ub4 bas_kcbh                             @8        0x000b0c25
   ub2 wrp_kcbh                             @12       0x0000
   ub1 seq_kcbh                             @14       0x02
   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
   ub2 chkval_kcbh                          @16       0x24df
   ub2 spare3_kcbh                          @18       0x0000
BBED> set dba 4,388 offset 4
        DBA             0x01000184 (16777604 4,388)
        OFFSET          4
BBED> dump /v dba 4,388 offset 4 count 64
 File: /opt/oracle/oradata/orcl/users01.dbf (4)
 Block: 388     Offsets:    4 to   67  Dba:0x01000184
-------------------------------------------------------
 8c010001 250c0b00 00000204 df240000 l ....%........$..
 01000000 2ecd0000 240c0b00 00000000 l ........$.......
 03003200 89010001 ffff0000 00000000 l ..2.............
 00000000 00000000 00800000 240c0b00 l ............$...
 <16 bytes per line>
注意0x0100018c 在块里的存储方式是低位优先的:8c010001
BBED> modify /x 84
 File: /opt/oracle/oradata/orcl/users01.dbf (4)
 Block: 388              Offsets:    4 to   67           Dba:0x01000184
------------------------------------------------------------------------
 84010001 250c0b00 00000204 df240000 01000000 2ecd0000 240c0b00 00000000 
 03003200 89010001 ffff0000 00000000 00000000 00000000 00800000 240c0b00 
 <32 bytes per line>
重新应用校验和。
BBED> sum dba 4,388
Check value for File 4, Block 388:
current = 0x24df, required = 0x24d7
BBED> sum dba 4,388 apply
Check value for File 4, Block 388:
current = 0x24d7, required = 0x24d7
在bbed中进行检查,坏块已经修复。
BBED> verify
DBVERIFY - Verification starting
FILE = /opt/oracle/oradata/orcl/users01.dbf
BLOCK = 388
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

数据库中检查,成功。
SQL> select * from yangtab;
     EMPNO ENAME           JOB               MGR HIREDATE                  SAL       COMM     DEPTNO
---------- --------------- ---------- ---------- ------------------ ---------- ---------- ----------
      7369 SMITH           CLERK            7902 17-DEC-80                 800                    20
      7499 ALLEN           SALESMAN         7698 20-FEB-81                1600        300         30
      7521 yang            SALESMAN         7698 22-FEB-81                1250        500         30
      7566 JONES           MANAGER          7839 02-APR-81                2975                    20
      7654 MARTIN          SALESMAN         7698 28-SEP-81                1250       1400         30
      7698 BLAKE           MANAGER          7839 01-MAY-81                2850                    30
      7782 CLARK           MANAGER          7839 09-JUN-81                2450                    10
      7788 SCOTT           ANALYST          7566 19-APR-87                3000                    20
      7839 KING            PRESIDENT             17-NOV-81                5000                    10
      7844 TURNER          SALESMAN         7698 08-SEP-81                1500          0         30
      7876 ADAMS           CLERK            7788 23-MAY-87                1100                    20
      7900 JAMES           CLERK            7698 03-DEC-81                 950                    30
      7902 FORD            ANALYST          7566 03-DEC-81                3000                    20
      7934 MILLER          CLERK            7782 23-JAN-82                1300                    10
14 rows selected.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22664653/viewspace-704356/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22664653/viewspace-704356/

提供10g,11g linux及windows BBED工具 及详细编译说明readme文件。 一. 10g linux编译BBED [oracle@node3 ~]$ cd $ORACLE_HOME/rdbms/lib [oracle@node3 lib]$ make -f ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed 直接生成到bin下为可执行文件 编译完成后: 编译成功后登陆BBED,登陆时需要密码(BBED的默认密码是blockedit) [oracle@node3 bin]$ bbed Password: BBED: Release 2.0.0.0.0 - Limited Production on Wed Apr 11 10:01:07 2018 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. ************* !!! For Oracle Internal Use only !!! *************** BBED> 二. 11g linux编译BBED oracle 11gR2环境中编译BBED可执行文件所需要的ssbbded.o和sbbdpt.o对象文件被移除,不过可以从oracle 10g环境中将这两个文件拷贝到oracle11g环境进行编译。 除了将上面的ssbbded.o和sbbdpt.o 文件拷贝到11g环境外,BBED还需要用到 $ORACLE_HOME/rdbms/mesg目录下的bbedus.msb这个信息文件, 这几个文件都需要从oracle10g中拷贝到oracle11g中对于的目录中。 文件夹linux_10g_bbed_64 包括了这3个文件。 下面是将以上3个文件从Oracle 10g中拷贝到11g对于目录后编译的过程。 1)把linux_10g_bbed_64目录下的10g的ssbbded.o和sbbdpt.o 放到 $ORACLE_HOME/rdbms/lib 目录下 2)把linux_10g_bbed_64目录下的10g的 bbedus.msb 文件拷贝到 $ORACLE_HOME/rdbms/mesg目录下 3)编译 [oracle@node1 ~] cd $ORACLE_HOME/rdbms/lib [oracle@node1 ~] make -f ins_rdbms.mk BBED=$ORACLE_HOME/bin/bbed $ORACLE_HOME/bin/bbed [oracle@node3 bin]$ bbed Password: BBED: Release 2.0.0.0.0 - Limited Production on Wed Apr 11 10:01:07 2018 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. ************* !!! For Oracle Internal Use only !!! *************** BBED> 三、windows 11GR2 bbed oracle9i版本以后Oracle不装载BBED了, Windows上也没有makefile来编译bbed。 所以,如果你想在Windows上使用bbed,你需要很多文件(本下载压缩包已经全包含了): 你需要一个bbed.exe. 你只能从Oracle 9i的安装中得到它。 你需要有一堆的DLL。所有这些DLL在Oracle9i安装中可以得到。 使用BBED需要消息文件。这文件是“bbedus.msb”,位于Oracle9i安装的MESG目录下。而你需要将其复制到ORACLE_HOME的RDBMS\MESG目录下。 这些在目录本压缩包的 bbed_win 中已经全部提供了。 把它们放在BBED安装的目录下(比如D:\bbed_win),环境变量ORACLE_HOME设置好。确保消息文件在$ORACLE_HOME\RDBMS\MESG下,最后启动BBED: D:\bbed_win>bbed Password: BBED: Release 2.0.0.0.0 - Limited Production on Wed Apr 11 10:20:43 2018 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. ************* !!! For Oracle Internal Use only !!! *************** BBED>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值