Example: Restoring and Recovering One or Many Data Blocks in a PDB

Block media recovery enables you to recover one more corrupt data blocks while the data file is still online. This example demonstrates how to perform block media recovery to recover one or more corrupt data blocks.

See Also: Oracle Database Backup and Recovery User’s Guide

The existence of corrupt data blocks can be indicated by one of the following methods:

Sun Aug 17 09:34:48 2014
Hex dump of (file 2, block 16385) in trace file /u01/app/oracle/diag/rdbms/dbstress/dbstress/trace/dbstress_ora_9732.trc

Corrupt block relative dba: 0x00004001 (file 2, block 16385)
Fractured block found during backing up datafile
Data in bad block:
 type: 6 format: 2 rdba: 0x00004001
 last change scn: 0x0000.00a564c0 seq: 0x1 flg: 0x06
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x00000000
 check value in block header: 0xd6dd
 computed block checksum: 0x58f7
RMAN-08038: channel c3: starting piece 1 at 2014/08/17 09:34:43
RMAN-03009: failure of backup command on c1 channel at 08/17/2014 09:34:50
ORA-19566: exceeded limit of 0 corrupt blocks for file /SHARED1/ORADATA/DBF/dbstress/soe.dbf
.
.
RMAN-03002: failure of backup plus archivelog command at 08/17/2014 09:35:55
RMAN-03009: failure of backup command on c1 channel at 08/17/2014 09:34:50
ORA-19566: exceeded limit of 0 corrupt blocks for file /SHARED1/ORADATA/DBF/dbstress/soe.dbf

To restore and recover corrupt data blocks in the protected database:

  1. Ensure that the prerequisites described in “Prerequisites for Restoring and Recovering Data from Recovery Appliance” are met.

  2. Use RMAN to connect to the protected database as TARGET and the Recovery Appliance catalog as CATALOG as described in “Connecting to the Protected Database and Recovery Appliance Using CLI”.

  3. Identify the corrupt blocks that need to be recovered.

    Use the entries in the protected database alert log to identify corrupt blocks and the data files that contain these corrupt blocks. Or, query the V$DATABASE_BLOCK_CORRUPTION view to identify corrupt blocks.

  4. Use the BLOCKRECOVER command to recover the corrupt data blocks.

    The following example recovers the data blocks 46, 56, and 84 in data file 4.

RUN
{
  BLOCKRECOVER CORRUPTION LIST;
  BLOCKRECOVER DATAFILE 4 BLOCK 46,56,84;
}