mardi 29 novembre 2011

Oracle 11g: Database block recovery


There are some pre-requisite to the database block recovery :
  1.  The database must be in ARCHIVELOG
  2.  The database must be mounted or opened

The rman utility can use the following components for block recovery purposes:
  1.  Full database backup or incremential level 0 database could be used for block recovery
  2.  Archived redo log if available
  3.  Flashback database logs if available

To check which blocks need recovery, you can look at:
  1.  The V$DATABASE_BLOCK_CORRUPTION
  2.  Results returned by the following rman commands :
    •  LIST FAILURE
    •  VALIADTE {DATABASE|TABLESPACE|DATAFILE}
    •  BACKUP DATABASE VALIDATE
    •  ANALYZE {TABLE|INDEX}
    •  Trace files (for location look at the V$DIAG_INFO)
    •  DBVERIFY utility

To revocver a block : After identifying the block number and associated file number of the corrupted block to repair, you can issue:
RMAN> RECOVER DATAFILE 4 BLOCK 2;
RMAN> RECOVER
  DATAFILE 1 BLOCK 9
  DATAFILE 4 BLOCK 254
  DATAFILE 5 BLOCK 454;
or to repair all block registered in the v$database_block_corruption :
RMAN> RECOVER CORRUPTION LIST;