Database Reference
In-Depth Information
Performing Block-Level Recovery
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 data file, it's nice to have the option of performing a block-level recovery. Block-level
recovery is useful when a small number of blocks are corrupt within a data file. Block recovery is not appropriate if the
entire data file needs media recovery.
RMAN will automatically detect corrupt blocks whenever a BACKUP , VALIDATE , or BACKUP VALIDATE command is
run. Details on corrupt blocks can be viewed in the V$DATABASE_BLOCK_CORRUPTION view. In the following example the
regular backup job has reported a corrupt block in the output:
ORA-19566: exceeded limit of 0 corrupt blocks for file...
Querying the V$DATABASE_BLOCK_CORRUPTION view indicates which file contains corruption:
SQL> select * from v$database_block_corruption;
FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO CON_ID
---------- ---------- ---------- ------------------ --------- ----------
4 20 1 0 ALL ZERO 0
Your database can be either mounted or open when performing block-level recovery. You do not have to take
offline the data file being recovered. You can instruct RMAN to recover all blocks reported in V$DATABASE_BLOCK_
CORRUPTION , as shown:
RMAN> recover corruption list;
If successful, the following message is displayed:
media recovery complete...
Another way to recover the block is to specify the data file and block number, like so:
RMAN> recover datafile 4 block 20;
It's preferable to use the RECOVER CORRUPTION LIST syntax because it will clear out any blocks recovered from the
V$DATABASE_BLOCK_CORRUPTION view.
Note
rMaN can't perform block-level recovery on block 1 (data file header) of the data file.
Block-level media recovery allows you to keep your database available and also reduces the mean time to
recovery, as only the corrupt blocks are offline during the recovery. Your database must be in archivelog mode for
performing block-level recoveries. Starting with Oracle 11g, RMAN can restore the block from the flashback logs (if
available). If the flashback logs are not available, then RMAN will attempt to restore the block from a full backup,
a level-0 backup, or an image copy backup generated by the BACKUP AS COPY command. After the block has been
restored, any required archived redo logs must be available to recover the block. RMAN can't perform block media
recovery using incremental level-1 (or higher) backups.
Note
If you're using oracle 10g or oracle9i, use the BLOCKRECOVER command to perform block media recovery.
 
 
Search WWH ::




Custom Search