当前位置:操作系统 > Unix/Linux >>

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

 [每日一题] 11gOCP 1z0-053 :2013-10-14 普通文件损的最佳恢复步骤
 
 
 
正确答案C
 
这题简单,主要考在归档模式下,有备份,一个非关键性的文件坏了的恢复过程。
 
答案A不正确,看上面的错误提示,数据库在重启时,报11号文件不能打开,说明这个文件已损坏或丢失了,库都打不开了,怎么重建这个表空间呢?
 
答案B不正确,少了最后一步recover恢复命令。
 
答案C正确。实验演示:
(1)      rman全库备份
   
[html] 
[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)      删除数据文件
[html] 
[oracle@mydb ~]$ rm -rf /u01/app/oracle/oradata/ocm/gyj02.dbf  
 
(3)      数据库关闭
[html] 
RMAN> shutdown abort;  
  
Oracle instance shut down  
 
(4)      数据库重启报错
[html] 
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号文件
[html] 
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 backup set  
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/ocm/gyj02.dbf  
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbs/1eomgj63_1_1  
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbs/1eomgj63_1_1 tag=TAG20131015T231619  
channel ORA_DISK_1: restored backup piece 1  
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01  
Finished restore at 15-OCT-13  
 
(6)      开始恢复7号文件
[html] 
 RMAN> recover datafile 7;  
  
Starting recover at 15-OCT-13  
using channel ORA_DISK_1  
  
starting media recovery  
media recovery complete, elapsed time: 00:00:00  
  
Finished recover at 15-OCT-13  
 
(7)      正常打开数据库
[html] 
RMAN> alter database open;  
  
database opened  
 
答案D不正确,在归档模式下,某一个文件坏了,归档日志、在线重做日志都是好的,那做完全恢复就可以了,做完全恢复,只要还原那一个损坏的文件和恢复它就Ok了,无须还原全部数据文件和恢复全部文件。
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,