Wednesday, December 3, 2008

RMAN Backup Validation Check

To Test and Check the Integrity for Backups
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The database prevents operations that result in unusable backup files or corrupt restored datafiles. The database server automatically does the following:

* Blocks access to datafiles while they are being restored or recovered
* Allows only one restore operation for each datafile at a time
* Ensures that incremental backups are applied in the correct order
* Stores information in backup files to allow detection of corruption

To Detect of Logical Block Corruption
--------------------------------------

This tests data and index blocks for logical corruption, such as corruption of a row piece or index entry. If RMAN finds logical corruption, then it logs the block in the alert.log

1. Start RMAN in nocatalog mode and connect to your database:

From the operating system prompt issue at database host :

$ rman target / nocatalog

2. From the RMAN> prompt issue the validate command with the "check logical"
clause:

The following example shows how to validate a single datafile:

run {
allocate channel d1 type disk;
backup check logical validate datafile 77;
release channel d1;
}


If you wish to monitor the progress of RMAN backup validate, you may issue this
query:

SQL> select sid, serial#, context, sofar, totalwork,
round(sofar/totalwork*100,2) "%_complete"
from v$session_longops
where opname like 'RMAN%'
and opname not like '%aggregate%'
and totalwork != 0
and sofar <> totalwork
/


3. Once the validate process is complete, you either check the alert log or a
view depending on the version of Oracle being used.

In Oracle9i and beyond you can query the view name V$DATABASE_BLOCK_CORRUPTION
to determine what corruption, if any, was found by RMAN.

No comments: