您的位置:首页 > 数据库 > Oracle

oracle: ocp题解与实验(11/205) .

2011-11-09 10:36 363 查看
题目:
11. You work as a database administrator at Certkiller .com. 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)
ORA-01110: 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 point-in-time recovery
Answer: D

题目翻译:简单来说是数据库运行于archivelog模式,周日做了rman的全备,而周一早上看到日志错误:block corrupted 发生在data file 5 并有指定的文件号和块号,要求datafile online并且mttr尽可能的短,不能用备份控制文件,但所有的归档日志文件可用,你会选择哪种方式?

答案解释:明显是在考block recovery的,块坏了,是最小范围的错误,当然没必要大动干戈,使用块恢复方法即可,看下官方文档的描述:

Performing Block Media Recovery with RMAN

The
BLOCKRECOVER
command can restore and recover individual datablocks within a datafile.
This procedure is useful when a trace file or standard output reveals that a small number of blocks within a datafile are corrupt.

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.

文档并给出了和题目一样场景的示例:

Block Media Recovery Using All Available Backups

In this scenario, you identify the blocks that require recovery and then use any available backup to perform the restore and recovery of these blocks.

To recover datablocks by using all available backups:

Obtain the datafile numbers and block numbers for the corrupted blocks. Typically, you obtain this output from the standard output, the
alert.log
, trace files, or a media management interface. For example,
you may see the following in a trace file:

ORA-01578: ORACLE data block corrupted (file # 8, block # 13)


ORA-01110: data file 8: '/oracle/oradata/trgt/users01.dbf'


ORA-01578: ORACLE data block corrupted (file # 2, block # 19)


ORA-01110: data file 2: '/oracle/oradata/trgt/undotbs01.dbf'


Assuming that you have preallocated automatic channels, run the
BLOCKRECOVER
command at the RMAN prompt, specifying the file and block numbers for the corrupted blocks as in the following example:

RMAN> BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 19;


所以答案D是最合适的。值得注意的是alert_###.log会报出错误哦,且有详细的块信息!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: