日期:2014-05-16  浏览次数:20579 次

[每日一题] 11gOCP 1z0-053 :2013-10-14 普通文件损的最佳恢复步骤.................................54

转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/12760867



正确答案C

 

这题简单,主要考在归档模式下,有备份,一个非关键性的文件坏了的恢复过程。

 

答案A不正确,看上面的错误提示,数据库在重启时,报11号文件不能打开,说明这个文件已损坏或丢失了,库都打不开了,怎么重建这个表空间呢?

 

答案B不正确,少了最后一步recover恢复命令。

 

答案C正确。实验演示:

(1)      rman全库备份

   
[oracle@mydb ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Tue Oct 15 23:15:42 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: OCM (DBID=2206937749)

RMAN> backup database;

Starting backup at 15-OCT-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=149 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/ocm/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/ocm/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/ocm/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ocm/undotbs01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/ocm/gyj01.dbf
input datafile file number=00010 name=/u01/app/oracle/oradata/ocm/tp2.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ocm/gyj02.dbf
input datafile file number=00008 name=/u01/app/oracle/oradata/ocm/tp01.dbf
input datafile file number=00009 name=/u01/app/oracle/oradata/ocm/mrkt01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ocm/users01.dbf
channel ORA_DISK_1: starting piece 1 at 15-OCT-13
channel ORA_DISK_1: finished piece 1 at 15-OCT-13
piece handle=/u01/app/oracle/product/11.2.0/dbs/1eomgj63_1_1 tag=TAG20131015T231619 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 15-OCT-13

Starting Control File and SPFILE Autobackup at 15-OCT-13
piece handle=/backup/rman/c-2206937749-20131015-00 comment=NONE
Finished Control File and SPFILE Autobackup at 15-OCT-13

(2)      删除数据文件

 [oracle@mydb ~]$ rm -rf /u01/app/oracle/oradata/ocm/gyj02.dbf

(3)      数据库关闭

RMAN> shutdown abort;

Oracle instance shut down

(4)      数据库重启报错

RMAN> startup

connected to target database (not started)
Oracle instance started
database mounted
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 10/15/2013 23:25:52
ORA-01157: cannot identify/lock data file 7 - see DBWR trace file
ORA-01110: data file 7: '/u01/app/oracle/oradata/ocm/gyj02.dbf'


(5)      开始还原7号文件

RMAN> restore datafile 7;

Starting restore at 15-OCT-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from back