[Translated from mos] ABMR: A method to test the Recover feature of the Automatic Block in the asm environment, mosabmr
ABMR: how to test the Recover feature of the Automatic Block in the asm Environment
Reference Original:
ABMR: How to test Automatic Block Recover Feature with ASM setup (Doc ID 1510090.1)
Applicable:
Oracle Database-Enterprise Edition-Version 11.2.0.3 and later
Information in this document applies to any platform.
Objectives:
Warning-note: the steps provided in this document are only intended to test the abmr feature and can only be executed in the test environment.
This article describes how to generate block upload uption and recover bad blocks in a standby environment,
The recover bad block uses the ABMR (Auto BMR Background Process) feature.
This article is only used for testing the use of external redundant asm environment.
As a pre-requirement, the master and slave databases should be properly configured and work properly (that is, the synchronization is normal)
The environment is physical standby database for real-time applications:
SQL> select DATABASE_ROLE, open_mode from v $ database; --> From standby
DATABASE_ROLE OPEN_MODE
------------------------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
Solution:
1) create a tablespace in asm,
SQL> create tablespace test datafile '+/.../datafile/test1.dbf 'size 1 M autoextend on;
2) create a table in the tablespace created in the previous step and inject test data into the table.
SQL> create table abmr_test tablespace test as select * from all_objects;
SQL> commit;
---> Note: commit can be omitted because ddl is implicitly submitted. This is the case in the original article.
3) Offline the tablespace, and then copy the datafile to the file system.
SQL> alter tablespace test offline;
4) Call asmcmd
$ Asmcmd-p
ASMCMD [+]> cp +/.../datafile/test1.dbf/tmp /.
5) destroy this datafile
Dd of =/tmp/test1.dbf bs = 8192 conv = notrunc seek = 11
6) Run dbv to check whether the file is corrupted)
Dbv file =/tmp/test1.dbf blocksize = 8192 feedback = 10000
7) copy the file back to asm and use dbv to verify the bad block.
$ Asmcmd-p
ASMCMD [+]> cp/tmp/test1.dbf +/.../datafile/test1.dbf
$ Dbv file =/tmp/test1.dbf +/.../datafile/test1.dbf userid =.../.. blocksize = 8192 feedback = 10000
8) online datafile
SQL> alter tablespace test online;
9) query table -- verify that the Automatic block recovery startup and repair the corrupted blocks
SQL> select * from ABMR_TEST; <--- when AMBR starts and repairs, this step is pause.
10) tail-f alert. log, you will see that the ambr process is working:
Automatic block media recovery service is active.
Automatic block media recovery requested for (file #9, block #11)
..........
Automatic block media recovery successful for (file #9, block #11)
The above test process is related to abmr.
When rman is used to introduce (manufacture) A Bad block, the file is copied to the OS, the file is damaged, and the restore is directed to the original location. In this case, the abmr will not work.
This is because when restore is in place, rman itself detects upts and reports a ora-01578 error in alert.
When rman detects upt, the 'autobmr 'feature will not be triggered.
Refer:
Note: 1266059.1 ABMR: How to test Automatic Block Recover Feature