BBED模拟表数据块的损坏

来源:互联网 发布:php 限制访问上级目录 编辑:程序博客网 时间:2024/05/18 17:23
1.创建测试表SQL> conn tes1t/test 1Connected.SQL> create table testbbed as select * from dba_tables;Table created.SQL> col segment_name format a20;SQL> select segment_name,file_id,block_id from dba_extents where owner='TEST1' and segment_name='TESTBBED';SEGMENT_NAME                                                                         FILE_ID   BLOCK_ID--------------------------------------------------------------------------------- ---------- ----------TESTBBED                                                                                   5        128TESTBBED                                                                                   5        136TESTBBED                                                                                   5        144TESTBBED                                                                                   5        152TESTBBED                                                                                   5        160TESTBBED                                                                                   5        168TESTBBED                                                                                   5        176TESTBBED                                                                                   5        184TESTBBED                                                                                   5        192TESTBBED                                                                                   5        200TESTBBED                                                                                   5        208SEGMENT_NAME                                                                         FILE_ID   BLOCK_ID--------------------------------------------------------------------------------- ---------- ----------TESTBBED                                                                                   5        216TESTBBED                                                                                   5        224TESTBBED                                                                                   5        23214 rows selected.2.创建BBED参数文件BBED无法对ASM操作SQL> select file_id, file_name from dba_data_files;   FILE_ID FILE_NAME---------- --------------------------------------------------------------------------------------------------------------------------------------------------------------         4 /u01/app/oracle/oradata/single2/users01.dbf         3 /u01/app/oracle/oradata/single2/undotbs01.dbf         2 /u01/app/oracle/oradata/single2/sysaux01.dbf         1 /u01/app/oracle/oradata/single2/system01.dbf         5 /u01/app/oracle/oradata/single2/test1.dbf[oracle@single2 ~]$ vi filelist.txt5 /u01/app/oracle/oradata/single2/test1.dbf[oracle@single2 ~]$ vi bbed.parblocksize=8192listfile=filelist.txtmode=edit3.BBED基本操作[oracle@single2 ~]$ bbed parfile=bbed.parPassword:BBED: Release 2.0.0.0.0 - Limited Production on Wed Feb 17 03:46:16 2016Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.************* !!! For Oracle Internal Use only !!! ***************BBED> info all File#  Name                                                        Size(blks) -----  ----                                                        ----------     5  /u01/app/oracle/oradata/single2/test1.dbf                            0BBED> set file 5        FILE#           5BBED> show        FILE#           5        BLOCK#          1        OFFSET          0        DBA             0x01400001 (20971521 5,1)        FILENAME        /u01/app/oracle/oradata/single2/test1.dbf        BIFILE          bifile.bbd        LISTFILE        filelist.txt        BLOCKSIZE       8192        MODE            Edit        EDIT            Unrecoverable        IBASE           Dec        OBASE           Dec        WIDTH           80        COUNT           512        LOGFILE         log.bbd        SPOOL           No4.模拟坏块BBED> modify 1000 file 5 block 136    --修改第二个segment File: /u01/app/oracle/oradata/single2/test1.dbf (5) Block: 136              Offsets:    0 to  511           Dba:0x01400088------------------------------------------------------------------------ 03e80000 88004001 b97a2f00 00000204 32c80000 01000000 895a0100 b27a2f00 00000000 03003201 80004001 ffff0000 00000000 00000000 00000000 00800000 b27a2f00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00011d00 ffff4c00 89033d03 3d030000 1d007b1e 791d731c 7b1b8c1a 9a19a718 b417c416 d115d814 e013ed12 fa110b11 1910260f 330e440d 4e0c530b 5c0a6c09 77088207 8a068d05 86048903 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>如果修改错误,可以执行revert命令回滚5.验证坏块BBED> verifyDBVERIFY - Verification startingFILE = /u01/app/oracle/oradata/single2/test1.dbfBLOCK = 136Block 136 is corrupt                      -------------------------------------Corrupt block relative dba: 0x01400088 (file 0, block 136)Bad header found during verificationData in bad block: type: 3 format: 0 rdba: 0x01400088 last change scn: 0x0000.002f7ab9 seq: 0x2 flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x7ab90602 check value in block header: 0xc832 computed block checksum: 0x4a05DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 1Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBED6.DBV验证[oracle@single2 ~]$ dbv file=/u01/app/oracle/oradata/single2/test1.dbf blocksize=8192DBVERIFY: Release 11.2.0.4.0 - Production on Wed Feb 17 04:23:46 2016Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.DBVERIFY - Verification starting : FILE = /u01/app/oracle/oradata/single2/test1.dbfPage 136 is marked corruptCorrupt block relative dba: 0x01400088 (file 5, block 136)Bad header found during dbv:Data in bad block: type: 3 format: 0 rdba: 0x01400088 last change scn: 0x0000.002f7ab9 seq: 0x2 flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x7ab90602 check value in block header: 0xc832 computed block checksum: 0x4a05DBVERIFY - Verification completeTotal Pages Examined         : 12800Total Pages Processed (Data) : 98Total Pages Failing   (Data) : 0Total Pages Processed (Index): 0Total Pages Failing   (Index): 0Total Pages Processed (Other): 136Total Pages Processed (Seg)  : 0Total Pages Failing   (Seg)  : 0Total Pages Empty            : 12565Total Pages Marked Corrupt   : 1Total Pages Influx           : 0Total Pages Encrypted        : 0Highest block SCN            : 3111633 (0.3111633)7.读取SQL> conn test1/test1Connected.SQL> select count(1) from testbbed;  COUNT(1)----------      2834SQL> alter system flush buffer_cache;System altered.SQL> select count(1) from testbbed;select count(1) from testbbed                     *ERROR at line 1:ORA-01578: ORACLE data block corrupted (file # 5, block # 136)ORA-01110: data file 5: '/u01/app/oracle/oradata/single2/test1.dbf'告警日志中:ALTER SYSTEM: Flushing buffer cacheHex dump of (file 5, block 136) in trace file /u01/app/oracle/diag/rdbms/single2/single2/trace/single2_ora_2605.trcCorrupt block relative dba: 0x01400088 (file 5, block 136)Bad header found during multiblock buffer readData in bad block: type: 3 format: 0 rdba: 0x01400088 last change scn: 0x0000.002f7ab9 seq: 0x2 flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x7ab90602 check value in block header: 0xc832 computed block checksum: 0x4a05Reading datafile '/u01/app/oracle/oradata/single2/test1.dbf' for corruption at rdba: 0x01400088 (file 5, block 136)Reread (file 5, block 136) found same corrupt data (no logical check)Wed Feb 17 04:24:45 2016Corrupt Block Found         TSN = 6, TSNAME = TEST1         RFN = 5, BLK = 136, RDBA = 20971656         OBJN = 88713, OBJD = 88713, OBJECT = TESTBBED, SUBOBJECT =         SEGMENT OWNER = TEST1, SEGMENT TYPE = Table SegmentCorrupt Block Found         TSN = 6, TSNAME = TEST1         RFN = 5, BLK = 136, RDBA = 20971656         OBJN = 88713, OBJD = 88713, OBJECT = TESTBBED, SUBOBJECT =         SEGMENT OWNER = TEST1, SEGMENT TYPE = Table SegmentErrors in file /u01/app/oracle/diag/rdbms/single2/single2/trace/single2_ora_2605.trc  (incident=99809):ORA-01578: ORACLE data block corrupted (file # 5, block # 136)ORA-01110: data file 5: '/u01/app/oracle/oradata/single2/test1.dbf'

0 0