OCP-043 RMAN BLOCKRECOVER

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:

  • I/O errors causing minor data loss

  • Memory corruptions that get flushed to disk

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

  • The target database must be mounted or open. You do not have to take a datafile offline if you are performing block media recovery on it.

  • You can only perform complete media recovery of individual blocks. Point-in-time recovery of individual data blocks is not supported.

  • You can only perform block media recovery on corrupt blocks.

  • Blocks marked media corrupt are not accessible until recovery completes.

  • You cannot perform block media recovery when using a backup control file.

  • You cannot use proxy backups to perform block media recovery. If the only backups that you have are proxy backups, then you can restore them to a nondefault location on disk, which causes RMAN to view the restored files as datafile copies. You can then use the datafile copies for block media recovery.

  • You must have a full backup of the file containing the corrupt blocks: block media recovery cannot use incremental backups.

  • If RMAN fails to access a specific archived redo log file needed for block media recovery, it performs restore failover, trying all other backups listed in the RMAN repository that are suitable for use in this operation, and only fails if no suitable backup is available. See Oracle Database Backup and Recovery Advanced User's Guide for details on restore failover.

  • Block media recovery cannot survive a missing or inaccessible archived log, although it can sometimes survive missing or inaccessible records (Oracle Database Backup and Recovery Advanced User's Guide).

  • The datafile header block (block 1) cannot be recovered.

  • You cannot perform block media recovery in NOARCHIVELOG mode.

Keywords and Parameters

blockrecover

Syntax ElementDescription
DEVICE TYPE deviceSpecifierSpecifies the device type for the backup used in the block recovery.

See Also: "deviceSpecifier"


bmrBlockSpec

Syntax ElementDescription
bmrBlockSpecSpecifies the data blocks that require recovery.
CORRUPTION LISTRecovers 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.

DATAFILEdatafileSpecSpecifies a list of one or more datafiles that contain blocks requiring recovery.

See Also: "datafileSpec"

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

bmrOption

Syntax ElementDescription
bmrOptionSpecifies various restore options relating to the block recovery.
FROM BACKUPSETIndicates that only backup sets should be restored.
FROM DATAFILECOPYIndicates 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 untilClauseSpecifies 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;


29. Your database is open and running in ARCHIVELOG mode. You take RMAN full backups every
Sunday night. On Monday morning, while querying the user1.employees table, you receive the following
error message:
01578: ORACLE data block corrupted (file # 5, block # 51) ORA01110:
data file 5:
'/u01/app/oracle/oradata/orcl/example01.dbf'
You need to rectify the corruption while ensuring the following:
The data file should remain online.
The mean time to recover (MTTR) should be minimal.
You are not using a backup control file, and all the archived logs are accessible. Which option would you
choose?
A.flash back the corrupted blocks
B.use the DBMS_REPAIR package
C.use the RMAN TSPITR command
D.use the RMAN BLOCKRECOVER command
E.use the RESTORE DATABASE and RECOVER DATABASE commands
F.investigate the time at which the corruption occurred and perform a pointintime
recovery
Testinside
| English | Chinese(Traditional) | Chinese(Simplified) | 13
TestInside
Information Co., Ltd. All rights reserved.
Answer: D


30. You are performing a block media recovery on the tools01.dbf data file in the SALES database by
using RMAN. Which two statements are correct in this scenario? (Choose two.)
A.You must ensure that the SALES database is mounted or open.
B.You must restore a backup control file to perform a block media recovery.
C.You must take the tools01.dbf data file offline before you start a block media recovery.
D.You must put the database in NOARCHIVELOG mode to perform a block media recovery.
E.You can perform only a complete media recovery of individual blocks; pointintime
recovery of
individual data blocks is not supported.
Answer: AE


31. You execute the following RMAN commands in the order shown below:
BACKUP VALIDATE DATABASE;
BLOCKRECOVER CORRUPTION LIST;


What will these commands do?
A.create a backup of the database and recover all corrupted blocks found in the backup
B.run a backup validation and list all the logically corrupt blocks as well as physically corrupt blocks in the
database
C.run a backup validation to populate V$COPY_CORRUPTION view, and then list any corrupt blocks
recorded in the view
D.run a backup validation to populate V$DATABASE_BLOCK_CORRUPTION view, and then repair any
corrupt blocks recorded in the view
E.run a backup validation, repair any corrupt blocks found during the validation process, and then update
V$DATABASE_BLOCK_CORRUPTION view to indicate which corrupt blocks have been repaired
Answer: D


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值