Skip Headers
Oracle® Database Backup and Recovery Reference
10g Release 2 (10.2)

Part Number B14194-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

BLOCKRECOVER

Syntax

blockrecover::=

Description of blockrecover.gif follows
Description of the illustration blockrecover.gif

bmrBlockSpec::=

Description of bmrblockspec.gif follows
Description of the illustration bmrblockspec.gif

bmrOption::=

Description of bmroption.gif follows
Description of the illustration bmroption.gif

Purpose

Block media recovery recovers an individual data block or set of data blocks within a datafile. This type of recovery is useful if the data loss or corruption applies to a small number of blocks rather than to an entire datafile.

Typically, block corruption is reported in error messages in trace files. Block-level data loss usually results from:

You can either use BLOCKRECOVER CORRUPTION LIST to recover all blocks reported in the V$DATABASE_BLOCK_CORRUPTION view, or specify the datafile number and block number or the tablespace and data block address (DBA) when executing the BLOCKRECOVER command.

Restrictions and Usage Notes

Keywords and Parameters

blockrecover

Syntax Element Description
DEVICE TYPE deviceSpecifier Specifies the device type for the backup used in the block recovery.

See Also: "deviceSpecifier"


bmrBlockSpec

Syntax Element Description
bmrBlockSpec Specifies the data blocks that require recovery.
CORRUPTION LIST Recovers all blocks listed in the V$DATABASE_BLOCK_CORRUPTION view. This view displays blocks marked corrupt by the most recent BACKUP (with or without the VALIDATE option), VALIDATE, or CREATE CATALOG command. The following types of corruption result in rows added to this view:
  • Physical corruption (sometimes called media corruption). The database does not recognize the block at all: the checksum is invalid, the block contains all zeros, or the header and footer of the block do not match. Physical corruption checking is on by default, and can be turned off with the NOCHECKSUM option.

  • Logical corruption. The block has a valid checksum, the header and footer match, and so forth, but the contents are logically inconsistent. Logical corruption checking is off by default, and can be turned on with the CHECK LOGICAL option.

    Note: Logical corruption cannot be repaired using block media recovery. To repair logical corruption, restore the datafile from backup and perform media recovery.

DATAFILE datafileSpec Specifies a list of one or more datafiles that contain blocks requiring recovery.

See Also: "datafileSpec"

BLOCK integer Specifies the block number of the block requiring media recovery. Typically, the block number is obtained from error message output.
TABLESPACE tablespace_name Specifies the tablespace name or number containing the corrupt blocks.
DBA integer Specifies the data block address (DBA) of the corrupt block.

bmrOption

Syntax Element Description
bmrOption Specifies various restore options relating to the block recovery.
FROM BACKUPSET Indicates that only backup sets should be restored.
FROM DATAFILECOPY Indicates that only datafile image copies should be restored.
FROM TAG= 'tag_name' Indicates that only the copy of the backup with the specified tag should be restored. Tag names are not case sensitive.

See Also: "BACKUP" to learn how a tag is applied to a copy of a backup.

RESTORE untilClause Specifies that only backups and copies created before the specified time, SCN, or log sequence number should be restored.

See Also: "untilClause"


Examples

Recovering a Group of Corrupt Blocks: Example This example recovers corrupt blocks in three datafiles:

BLOCKRECOVER DATAFILE 2 BLOCK 12, 13 DATAFILE 3 BLOCK 5, 98, 99 DATAFILE 4 BLOCK 19;

Limiting Block Media Recovery by Type of Restore: Example The following example recovers a series of blocks and restores only from datafile copies:

RUN
{
  BLOCKRECOVER DATAFILE 3 BLOCK 2,3,4,5 TABLESPACE sales DBA 4194405, 4194409, 4194412
  FROM DATAFILECOPY;
}

Limiting Block Media Recovery by Backup Tag: Example This example recovers blocks and restores only from the backup with the tag weekly_backup:

BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 FROM TAG "weekly_backup";

Limiting Block Media Recovery by Time: Example The following example recovers two blocks in the SYSTEM tablespace. It restores only from backups that could be used to recover the database to a point two days ago:

BLOCKRECOVER TABLESPACE SYSTEM DBA 4194404, 4194405 RESTORE UNTIL TIME 'SYSDATE-2';

Repairing All Block Corruption in the Database: Example The following example runs a backup validation to populate V$DATABASE_BLOCK_CORRUPTION, then repairs any corrupt blocks recorded in the view:

BACKUP VALIDATE DATABASE;
BLOCKRECOVER CORRUPTION LIST;