OCP-1Z0-052-V8.02-92题

92. You executed the following commands in an RMAN session for your database instance that has
failures:
RMAN> LIST FAILURE;
After some time, you executed the following command in the same session:
RMAN> ADVISE FAILURE;
But there are new failures recorded in the Automatic Diagnostic Repository (ADR) after the execution of
the last LIST FAILURE command. Which statement is true for the above ADVISE FAILURE command in
this scenario?
A.It produces a warning for new failures before advising for CRITICAL and HIGH failures.
B.It ignores new failures and considers the failures listed in the last LIST FAILURE command only.
C.It produces advice only for new failures and the failures listed in the last LIST FAILURE command are
ignored

D.It produces an error with recommendation to run the LIST FAILURE command before the ADVISE
FAILURE command.

 答案解析:

1、2窗口,首先里看一下文件的位置

sys@TESTDB> select file#,name from v$datafile;

     FILE# NAME
---------- --------------------------------------------------
         1 /u01/app/oracle/oradata/testdb/system01.dbf
         2 /u01/app/oracle/oradata/testdb/sysaux01.dbf
         3 /u01/app/oracle/oradata/testdb/undotbs01.dbf
         4 /u01/app/oracle/oradata/testdb/users01.dbf
         5 /u01/app/oracle/oradata/testdb/example01.dbf
         6 /u01/app/oracle/oradata/testdb/test1.dbf
         7 /u01/app/oracle/oradata/testdb/test2.dbf

7 rows selected.


2、 1窗口,做实验前先备份一下backup database,或backup tablespace test1和backup tablespace users,这里实验先会删除test1.dbf,后删除user01.dbf

全备份数据库

RMAN> backup database;

Starting backup at 02-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/testdb/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/testdb/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/testdb/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/testdb/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/testdb/test1.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/testdb/test2.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/testdb/users01.dbf
channel ORA_DISK_1: starting piece 1 at 02-SEP-13

channel ORA_DISK_1: finished piece 1 at 02-SEP-13
piece handle=/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_09_02/o1_mf_nnndf_TAG20130902T130124_929k37g6_.bkp tag=TAG20130902T130124 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:08:28
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 02-SEP-13
channel ORA_DISK_1: finished piece 1 at 02-SEP-13
piece handle=/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_09_02/o1_mf_ncsnf_TAG20130902T130124_929km1ll_.bkp tag=TAG20130902T130124 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 02-SEP-13


 或者备份test1表空间,users表空间已经在91题备份过

RMAN> backup tablespace test1;

Starting backup at 02-SEP-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=131 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/u01/app/oracle/oradata/testdb/test1.dbf
channel ORA_DISK_1: starting piece 1 at 02-SEP-13
channel ORA_DISK_1: finished piece 1 at 02-SEP-13
piece handle=/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_09_02/o1_mf_nnndf_TAG20130902T125847_929jy9jw_.bkp tag=TAG20130902T125847 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
Finished backup at 02-SEP-13

3、3窗口,os删除文件

[oracle@rtest ~]$ rm -rf /u01/app/oracle/oradata/testdb/test1.dbf
[oracle@rtest ~]$ ls /u01/app/oracle/oradata/testdb/test1.dbf
ls: /u01/app/oracle/oradata/testdb/test1.dbf: No such file or directory

4、2窗口,强制关闭,并重启

sys@TESTDB> shutdown abort;
ORACLE instance shut down.
sys@TESTDB> startup
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size                  2230952 bytes
Variable Size             553649496 bytes
Database Buffers         1929379840 bytes
Redo Buffers               20078592 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: '/u01/app/oracle/oradata/testdb/test1.dbf'

5、1窗口,进入rman恢复

RMAN> list failure;

using target database control file instead of recovery catalog
List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
182        HIGH     OPEN      02-SEP-13     One or more non-system datafiles are missing

6、3窗口,此时又删除users01.dbf

[oracle@rtest ~]$ rm -rf /u01/app/oracle/oradata/testdb/users01.dbf
[oracle@rtest ~]$ ls /u01/app/oracle/oradata/testdb/users01.dbf
ls: /u01/app/oracle/oradata/testdb/users01.dbf: No such file or directory

2窗口强制关闭,然后重启

sys@TESTDB> shutdown abort;
ORACLE instance shut down.
sys@TESTDB> startup
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size                  2230952 bytes
Variable Size             553649496 bytes
Database Buffers         1929379840 bytes
Redo Buffers               20078592 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u01/app/oracle/oradata/testdb/users01.dbf'

7、1窗口,接着第5步的下面输入,用advise failure,报错并退出


RMAN> advise failure;

RMAN-06900: WARNING: unable to generate V$RMAN_STATUS or V$RMAN_OUTPUT row
RMAN-06901: WARNING: disabling update of the V$RMAN_STATUS and V$RMAN_OUTPUT rows
ORACLE error from target database: 
ORA-03135: connection lost contact
Process ID: 475
Session ID: 127 Serial number: 13

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00601: fatal error in recovery manager
RMAN-03004: fatal error during execution of command
RMAN-04022: target database mount id 2608415880 does not match channel's mount id 2608385963
RMAN-03002: failure of advise command at 09/02/2013 13:42:27
ORA-03114: not connected to ORACLE


8、1窗口,重新rman进去,执行list failure-->advise failure-->repair failure步骤进行恢复。


RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
182        HIGH     OPEN      02-SEP-13     One or more non-system datafiles are missing

RMAN> advise failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected Summary
---------- -------- --------- ------------- -------
182        HIGH     OPEN      02-SEP-13     One or more non-system datafiles are missing

analyzing automatic repair options; this may take some time
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=189 device type=DISK
analyzing automatic repair options complete

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file /u01/app/oracle/oradata/testdb/test1.dbf was unintentionally renamed or moved, restore it
2. If file /u01/app/oracle/oradata/testdb/users01.dbf was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 6; Restore and recover datafile 4 
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u01/app/oracle/diag/rdbms/testdb/testdb/hm/reco_3215015603.hm

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/testdb/testdb/hm/reco_3215015603.hm

contents of repair script:
   # restore and recover datafile
   restore datafile 4, 6;
   recover datafile 4, 6;
   sql 'alter database datafile 4, 6 online';

Do you really want to execute the above repair (enter YES or NO)? y
executing repair script

Starting restore at 02-SEP-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/testdb/users01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/testdb/test1.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_09_02/o1_mf_nnndf_TAG20130902T130124_929k37g6_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TESTDB/backupset/2013_09_02/o1_mf_nnndf_TAG20130902T130124_929k37g6_.bkp tag=TAG20130902T130124
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 02-SEP-13

Starting recover at 02-SEP-13
using channel ORA_DISK_1

starting media recovery
media recovery complete, elapsed time: 00:00:00

Finished recover at 02-SEP-13

sql statement: alter database datafile 4, 6 online
repair failure complete

Do you want to open the database (enter YES or NO)? y
database opened




此题答案选A

原文地址:https://www.cnblogs.com/hzcya1995/p/13317266.html