053-668
Examine the following RMAN script:
RMAN> run {
debug on;
allocate channel c1 type disk;
backup datafile 5;}
Which statement describes the purpose of the script?
A. The data file is checked for physical corruption and backed up if found clean.
B. The backup of data file 5 is performed and the interactive messages during the backup are suppressed.
C. The existing backup for the data file is checked and the backup is performed if there are changes in the data file after the last backup.
D. The backup of data file 5 is performed and all SQL statements that are executed during RMAN compilation and their results are displayed
DEBUG 选项用于:
– 查看生成的 PL/SQL
– 准确判断 RMAN 命令在何处挂起或出错
• DEBUG 选项是在 RMAN 提示符下或者在 run 块内指定的。
• DEBUG 选项会创建大量输出,因此要将输出重定向到跟踪文件:
$ rman target / catalog rman/rman debug trace trace.log
DEBUG 选项显示在 RMAN 编译期间执行的全部 SQL 语句以及执行结果。另外,还显示恢复目录 PL/SQL程序包生成的所有信息。以下示例中,在备份数据文件 3 期间会写入 DEBUG 输出,但是在备份数据文件 4 期间则不会:
DEBUG 输出可能非常大,所以请确保有足够的磁盘空间可供跟踪文件使用。
例如:
$ rman target <connection> catalog <connection> debug trace=/tmp/rmanDebug.trc
log=/tmp/rmanLog.txt
run {
...Run your backup commands here
}
如果还需要跟进一步的跟踪可以再使用 10046 trace:
$ rman target <connection> catalog <connection> debug trace=/tmp/rmanDebug.trc
log=/tmp/rmanLog.txt
RMAN> sql "alter session set tracefile_identifier=''rman_10046''";
RMAN> sql "alter session set events ''10046 trace name context forever,level 12''";
RMAN> run-your-commands;
RMAN> exit;