Tuesday, May 6, 2008

Block Media Recovery with RMAN ORA-01578: ORA-01110:

Suppose in the alert.log, or trace files, or a media management interface you got the following output.

ORA-01578: ORACLE data block corrupted (file # 4, block # 45)
ORA-01110: data file 4: '/oradata2/users01.dbf'

In this case you can use the BLOCKRECOVER command to restore and recover individual datablocks within a datafile. Here datafile 4 and block 45. You should keep in mind that if you want to BLOCKRECOVER command you had to have a previous backup of the datafile or database.

Block media recovery is not useful in cases where the extent of data loss or corruption is not known; in this case, use datafile recovery instead.

Suppose if I got above error message data block corrupted then I can use BLOCKRECOVER as following,

1)$rman TARGET /
RMAN>BLOCKRECOVER DATAFILE 4 BLOCK 45;

2)If you want from backup set or image copy then use,

RMAN>BLOCKRECOVER DATAFILE 4 BLOCK 45 FROM BACKUPSET;
RMAN>BLOCKRECOVER DATAFILE 4 BLOCK 45 FROM IMAGECOPY;


3)From a Specified backup,

RMAN>BLOCKRECOVER DATAFILE 4 BLOCK 45 FROM TAG level0;


4)Limiting to a certain point,
RMAN>BLOCKRECOVER DATAFILE 4 BLOCK 45 RESTORE UNTIL 'SYSDATE-2';
RMAN>BLOCKRECOVER DATAFILE 4 BLOCK 45 RESTORE UNTIL SCN 1111;


Remember if you use UNTIL clasue then RMAN must perform more recovery on the blocks, and the recovery phase must scan all logs for changes to the specified blocks.

Whenever you use BACKUP command to BACKUP your database or use BACKUP VALIDATE command Use RMAN to Validate Backup the V$DATABASE_BLOCK_CORRUPTION view is populated. Set MAXCORRUPT to continue backup or backup validate and thus continue populate the V$DATABASE_BLOCK_CORRUPTION view.

If you want to recover all marked corrupt block in the V$DATABASE_BLOCK_CORRUPTION view then just use,

BLOCKRECOVER CORRUPTION LIST RESTORE UNTIL TIME 'SYSDATE-2';

Related Documents:
--------------------

Use RMAN to Validate Backup
ora-19566

1 comment:

  1. You can look at my blog for some tips as well :)
    http://www.orainsights.com

    cheers,

    Ido

    ReplyDelete