dataguard数据库坏块自动修复

在dg环境中数据库的坏块是可以自动修复的。

主库创建测试表

select distinct dbms_rowid.rowid_relative_fno(rowid),dbms_rowid.rowid_block_number(rowid) from scott.test;

DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID) DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)


               6                      131

dd if=/dev/zero of=/data/dbadb/ts.dbf bs=8192 count=1 seek=131 conv=notrunc
执行后,再次查看测试表

SQL> alter system flush buffer_cache;

System altered.

SQL> select count(*) from scott.test;

  COUNT(*)
----------
    32

查看alert日志
Corrupt block relative dba: 0x01800083 (file 6, block 131)
Completely zero block found during buffer read
Reading datafile ‘/data/dbadb/ts.dbf’ for corruption at rdba: 0x01800083 (file 6, block 131)
Reread (file 6, block 131) found same corrupt data (no logical check)
Starting background process ABMR
Mon Oct 16 17:34:41 2017
ABMR started with pid=31, OS id=12409
Automatic block media recovery service is active.
Automatic block media recovery requested for (file# 6, block# 131)
Mon Oct 16 17:34:41 2017
Automatic block media recovery successful for (file# 6, block# 131)
Automatic block media recovery successful for (file# 6, block# 131)

在单实例上是不会自动修复的

你可能感兴趣的:(dataguard)