Friday, August 5, 2011

Testing Media Recovery


You need to perform a database recovery, but you suspect one of your archived redo log files is bad.You want to perform a test to see whether all of the redo is available and can be applied. The recover test command instructs Oracle to apply the redo necessary to perform recovery but does not make the changes permanent in the datafiles. When you recover in test
mode, Oracle applies the required redo but rolls back the changes at the end of the process.

This example starts up the database in mount mode, restores the entire database, and then does a test recovery:

RMAN> connect target /

RMAN> startup mount;

RMAN> restore database;

RMAN> recover database test;

Here is a partial snippet of the output showing that the test recovery was successful:

ORA-10574: Test recovery did not corrupt any data block
ORA-10573: Test recover tested redo from change 847960 to 848243
ORA-10570: Test recovery complete

Enjoy:-)