7.4. Block Media Recovery

Block Media Recovery (BMR) is a Recovery Manager (RMAN) feature that was new in Oracle 9i. BMR is used to recover an individual block or a group of corrupt blocks in a datafile. This allows you to recover individual data blocks instead of the whole datafile. BMR should be used as a supplement to datafile recovery, not as a replacement. BMR is best used where block corruption is minimal, not widespread. Block corruption cases that are not widespread where memory corruptions or sporadic I/O errors get written to disk are best suited for BMR.

Nevertheless, BMR has some major advantages over recovering the whole datafile. One big advantage of using BMR is that it reduces the mean time to recovery (MTTR), because only the affected blocks are restored and recovered instead of the whole datafile. Also, the operation of the database can be unaffected when using BMR, because the datafile does not have to be taken offline to restore and recover a block. Additionally, BMR can potentially recover when you have missing redo logs, if the redo records do not affect the blocks being recovered.

BMR has some limitations that you should be aware of:

  • BMR must be used with RMAN.

  • You must perform complete recovery of individual blocks. All redo logs must be applied to the block.

  • You can never recover blocks marked corrupt from the media backup source. This is known as a media corrupt block.

  • You must have a full RMAN backup, not an incremental backup. Remember, incremental backups back up only changed blocks.

  • Media corrupt blocks are not accessible to users until the recovery is complete.

Let's look at how to perform a BMR. The first step you need to perform includes identifying the datafile and block that you need to recover.

As you learned in the section titled "Block Corruption Symptoms" earlier in this chapter, most detection of block corruption occurs in the ALERT.LOG and in associated trace files. The following is an example of output that is written in a trace file in the BDUMP directory:

ORA-01578: ORACLE data block corrupted (file # 5, block # 6)
ORA-01110: data file 7: 'c:oracleoradataora101users01.dbf'

After viewing the trace file, you can now pinpoint the block corruption to file number 5 and block number 6. This is the sixth block in the USERS tablespace. With this information, you can run the RMAN command BLOCKRECOVER. Let's walk through an example:

C:oracleoradataora101> rman

Recovery Manager: Release 10.1.0.2.0 - Production

Copyright (c) 1995, 2004, Oracle. All rights reserved.

RMAN> connect target

connected to target database: ORA101 (DBID=4215248570)

RMAN> blockrecover datafile 5 block 6;


Starting blockrecover at 06-NOV-04
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=145 devtype=DISK

starting media recovery
media recovery complete

Finished blockrecover at 06-NOV-04

RMAN>

As you can see, BMR is a nice supplement to datafile recovery options. The process is fairly quick and does not impact database operations, because you do not have to take the datafile offline to restore and recover. Remember, BMR is not designed to perform recovery of widespread block corruption. Widespread block corruption would be better resolved by datafile recovery or database recovery.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset