首页 » ORACLE » 11G ADG automatic repair corrupt data blocks(ABMR自动坏块修复)测试二

11G ADG automatic repair corrupt data blocks(ABMR自动坏块修复)测试二

上一篇11G ADG automatic repair corrupt data blocks(ABMR自动坏块修复)测试一中,primary site 的ABMR 测试是成功的,而standby site 的ABMR没有成功, 后来是怀疑buffer header中有mrec 的block, 现在我接着测试如果buffer header 中没有此类block,ABMR是否成功?以前用bbed 标记corrupt block的方式, 如果有corrupt block时rman backup 又会怎么样?实验开始..

sys@sora245>select dbms_rowid.ROWID_RELATIVE_FNO(rowid), dbms_rowid.rowid_block_number(rowid) from anbob.testbmr;
DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID) DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------------------------ ------------------------------------
                                   5                                  131

sys@sora245>select file#,block#,status,objd,stale from v$bh where file#=5 and block#=131;

               FILE#               BLOCK# STATUS                     OBJD S
-------------------- -------------------- ---------- -------------------- -
                   5                  131 free                      87361 N
                   5                  131 xcur                      87361 N

sys@sora245>alter system flush buffer_cache;
System altered.

sys@sora245>select file#,block#,status,objd,stale from v$bh where file#=5 and block#=131;
               FILE#               BLOCK# STATUS                     OBJD S
-------------------- -------------------- ---------- -------------------- -
                   5                  131 free                      87361 N
                   5                  131 free                      87361 N

[oracle@dbserver58 ~]$ dd of=/oradata/sora245/tbs_test01.dbf bs=8192 seek=131 conv=notrunc count=1 if=/dev/zero                                   
1+0 records in
1+0 records out
8192 bytes (8.2 kB) copied, 3.8116e-05 seconds, 215 MB/s


sys@sora245>select * from anbob.testbmr;
                  ID
--------------------
                   3

alert log writen the following :
=======================================
Hex dump of (file 5, block 131) in trace file /oracle/diag/rdbms/sora245/sora245/trace/sora245_ora_10022.trc
Corrupt block relative dba: 0x01400083 (file 5, block 131)
Completely zero block found during multiblock buffer read
Reading datafile ‘/oradata/sora245/tbs_test01.dbf’ for corruption at rdba: 0x01400083 (file 5, block 131)
Reread (file 5, block 131) found same corrupt data (no logical check)
Automatic block media recovery requested for (file# 5, block# 131)
2014-02-21 13:41:02.134000 +08:00
Automatic block media recovery requested for (file# 5, block# 131)
Automatic block media recovery successful for (file# 5, block# 131)
Automatic block media recovery successful for (file# 5, block# 131)

TIP:
可以看到这次用了同样的dd 破坏造成的物理corrupt block,buffer header中没有mrec 状态的block 时是可以成功自动repair的(select时).

BBED 构造逻辑currup block及rman 备份测试


[oracle@dbserver58 ~]$ bbed filename=/oradata/sora245/tbs_test01.dbf mode=edit
Password: 

BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 21 16:46:05 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

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

BBED> set block 131
        BLOCK#          131

BBED> dump                              
 File: /oradata/sora245/tbs_test01.dbf (0)
 Block: 131              Offsets:    0 to  511           Dba:0x00000000
------------------------------------------------------------------------
 06a20000 83004001 a4951000 00000206 3fc50000 01000000 41550100 b77a1000 
 00000000 03003200 80004001 ffff0000 00000000 00000000 00000000 00800000 
 b77a1000 0a000800 a4030000 bc01c000 ff003f00 01200000 a4951000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 
 ffff1400 771f631f 631f0000 01007a1f 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 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>

BBED> corrupt block 131              
Block marked media corrupt.

BBED> dump
 File: /oradata/sora245/tbs_test01.dbf (0)
 Block: 131              Offsets:    0 to  511           Dba:0x00000000
------------------------------------------------------------------------
 06a20000 83000000 00000000 0000ff04 6fc60000 01000000 41550100 b77a1000 
 00000000 03003200 80004001 ffff0000 00000000 00000000 00000000 00800000 
 b77a1000 0a000800 a4030000 bc01c000 ff003f00 01200000 a4951000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00010100 
 ffff1400 771f631f 631f0000 01007a1f 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 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 

 <32 bytes per line>
 
 RMAN> backup datafile 5;
 
Starting backup at 21-FEB-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=228 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/oradata/sora245/tbs_test01.dbf
channel ORA_DISK_1: starting piece 1 at 21-FEB-14
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 02/21/2014 16:50:14
ORA-19566: exceeded limit of 0 corrupt blocks for file /oradata/sora245/tbs_test01.dbf

sys@sora245>alter system flush buffer_cache;
System altered.

sys@sora245>select * from anbob.testbmr;
                  ID
--------------------
                   3
alert log
============================
Hex dump of (file 5, block 131) in trace file /oracle/diag/rdbms/sora245/sora245/trace/sora245_ora_10982.trc
Corrupt block relative dba: 0x01400083 (file 5, block 131)
Bad header found during backing up datafile
Data in bad block:
 type: 6 format: 2 rdba: 0x00000083
 last change scn: 0x0000.00000000 seq: 0xff flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x000006ff
 check value in block header: 0xc66f
 computed block checksum: 0x0
Reread of blocknum=131, file=/oradata/sora245/tbs_test01.dbf. found same corrupt data
Reread of blocknum=131, file=/oradata/sora245/tbs_test01.dbf. found same corrupt data
Reread of blocknum=131, file=/oradata/sora245/tbs_test01.dbf. found same corrupt data
Reread of blocknum=131, file=/oradata/sora245/tbs_test01.dbf. found same corrupt data
Reread of blocknum=131, file=/oradata/sora245/tbs_test01.dbf. found same corrupt data
Deleted Oracle managed file /flrvarea/SORA245/SORA245/backupset/2014_02_21/o1_mf_nnndf_TAG20140221T165012_9jg4t51o_.bkp
2014-02-21 16:50:47.965000 +08:00
ALTER SYSTEM: Flushing buffer cache
2014-02-21 16:50:49.831000 +08:00
Hex dump of (file 5, block 131) in trace file /oracle/diag/rdbms/sora245/sora245/trace/sora245_ora_10987.trc
Corrupt block relative dba: 0x01400083 (file 5, block 131)
Bad header found during multiblock buffer read
Data in bad block:
 type: 6 format: 2 rdba: 0x00000083
 last change scn: 0x0000.00000000 seq: 0xff flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x000006ff
 check value in block header: 0xc66f
 computed block checksum: 0x0
Reading datafile '/oradata/sora245/tbs_test01.dbf' for corruption at rdba: 0x01400083 (file 5, block 131)
Reread (file 5, block 131) found same corrupt data (no logical check)
Automatic block media recovery requested for (file# 5, block# 131)
Automatic block media recovery requested for (file# 5, block# 131)
Automatic block media recovery successful for (file# 5, block# 131)
Automatic block media recovery successful for (file# 5, block# 131)


TIP:
可以看到bbed 只是修改了block的几个标志位造成corrupt block, rman 备份时会出错,通过select 可以触发ABMR,也会在primary site ,block 发现更新时覆盖standby site的corrupt block,此时alert 无记录。

打赏

,

对不起,这篇文章暂时关闭评论。