Friday, August 5, 2011

Performing Block-Level Recovery

When performing daily backups, you notice that RMAN is reporting in your target database alert.log file that there is a corrupt block in a large datafile. It could take a significant amount of time to perform the traditional restore and recover of a large datafile. You wonder whether there is a method for just recovering the corrupt block and not the entire datafile.

You can instruct RMAN to recover blocks in two ways:

• Use the corruption list clause.
• Specify individual datafiles and blocks.

Block-level corruption is rare and is usually caused by some sort of I/O error. However, if you do have an isolated corrupt block within a large datafile, it’s nice to have the option of performing a block-level recovery

RMAN> backup tablespace tools;

RMAN-03009: failure of backup command on ORA_DISK_1 channel
ORA-19566: exceeded limit of 0 corrupt blocks for file /ora01/VISHU/tools01.dbf

SQL> select * from v$database_block_corruption;

5 20 1 0 ALL ZERO

RMAN> recover datafile 5 block 20;