053-152
You are performing incomplete recovery using RMAN. You execute the following RUN block:
RUN
{
SET UNTIL SCN 1107600;
RESTORE DATABASE;
RECOVER DATABASE;
}
Which statement is true about the result?
A.RMAN restores all datafiles from the most recent backup available since the failure and applies the redo logs necessary to recover the database to SCN 1107600
B.RMAN restores all datafiles needed to restore the database through SCN 1107599 and applies the redo logs necessary to recover the database through SCN 1107599.
C.RMAN restores all datafiles and control files from the most recent backup
D.The RUN block fails because you did not specify an UNTIL clause in your RECOVER DATABASE command
此题的考点是数据库的不完全恢复:
这个过程假设当前恢复的目标库是当前的 incamation。控制文件是当前的,也就是不需要从备份控制文件中重建控制文件。数据库使用的是当前的参数文件。
在执行 DBPITR 时,可以通过在 run 块开始的时候指定 SET UNTIL 命令,而不是分别给RESTORE 和RECOVER 命令指定,可以避免错误。这个确保来重建的控制文件比在 recover 的时间戳要更早。
确定还原目标。可以查询 alert 日志来确定还原的时间点。以下的查询列除了当前数据库化身的日志:
SELECT RECID, STAMP, THREAD#, SEQUENCE#, FIRST_CHANGE#
FIRST_TIME, NEXT_CHANGE#
FROM V$ARCHIVED_LOG
WHERE RESETLOGS_CHANGE# =
( SELECT RESETLOGS_CHANGE#
FROM V$DATABASE_INCARNATION
WHERE STATUS = 'CURRENT');
可以需要在运行的时候设置好环境变量:
NLS_LANG = american_america.us7ascii
NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
然后连接到目标库,将数据库启动到 mount 状态:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
执行下列 run 块:
RUN
{
SET UNTIL SCN 1000;
RESTORE DATABASE;
RECOVER DATABASE;
}
--如果指定的是时间,必须满足之前设置的 NLS_DATA_FORMAT 的日期格式。例如:
SET UNTIL TIME 'Nov 15 2004 09:00:00';
SET UNTIL SEQUENCE 9923;
SET UNTIL RESTORE POINT before_update;
最后是用 resetlogs 的方式打开数据库:ALTER DATABASE OPEN RESETLOGS;