设为首页 收藏本站
查看: 962|回复: 0

[经验分享] OCP-1Z0-053-V12.02-179题

[复制链接]

尚未签到

发表于 2015-11-8 16:00:33 | 显示全部楼层 |阅读模式
179.You have lost datafiles 1 and 3 from your database, and the database has crashed. In what order
should you perform the following steps to recover your database?
1. Take the datafiles that were lost offline.
2. startup mount the database
3. Issue the alter database open command.
4. Restore the datafiles that were lost
5. Recover the datafiles with the recover datafile command.
6. Bring the datafiles back online.
7. Recover the database with the recover database command.
A. 2, 1, 3, 4, 5, 6
B. 2, 4, 5, 3
C. 4, 7, 3
D. 2, 4, 7, 3
E. 2, 7, 3
Answer: B
答案解析:
参考:http://blog.iyunv.com/rlhua/article/details/12346829
一般的数据文件恢复,offline--restore--recover--online
关键的数据文件,如system,undo等,shutdown-startup mount---restore--recover--alter database open
文件中的1和3文件是system和undo关键性数据文件,故用第二种方法。
实验验证:


首先查看数据文件:

  sys@TEST1107> select file_id,file_name from dba_data_files;
  

  FILE_ID FILE_NAME
  ---------- --------------------------------------------------
  4 /u01/app/oracle/oradata/test1107/users01.dbf
  3 /u01/app/oracle/oradata/test1107/undotbs01.dbf
  2 /u01/app/oracle/oradata/test1107/sysaux01.dbf
  1 /u01/app/oracle/oradata/test1107/system01.dbf
  5 /u01/app/oracle/oradata/test1107/example01.dbf
  6 /u01/app/oracle/oradata/test1107/test01.dbf
  

  6 rows selected.
  

  OS删除数据文件1和3
  
  [oracle@rtest ~]$ rm -f /u01/app/oracle/oradata/test1107/system01.dbf
  [oracle@rtest ~]$ rm -f /u01/app/oracle/oradata/test1107/undotbs01.dbf
  

  关库,再起库,报错,关库,在起到mount状态
  
  sys@TEST1107> shutdown immediate
  Database closed.
  Database dismounted.
  ORACLE instance shut down.
  sys@TEST1107> startup
  ORACLE instance started.
  

  Total System Global Area 1269366784 bytes
  Fixed Size                  2227984 bytes
  Variable Size             872415472 bytes
  Database Buffers          385875968 bytes
  Redo Buffers                8847360 bytes
  Database mounted.
  ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
  ORA-01110: data file 1: '/u01/app/oracle/oradata/test1107/system01.dbf'
  

  

  sys@TEST1107> shutdown immediate
  ORA-01109: database not open
  

  

  Database dismounted.
  ORACLE instance shut down.
  sys@TEST1107> startup mount;
  ORACLE instance started.
  

  Total System Global Area 1269366784 bytes
  Fixed Size                  2227984 bytes
  Variable Size             872415472 bytes
  Database Buffers          385875968 bytes
  Redo Buffers                8847360 bytes
  Database mounted.
  

  使用rman进行restore和recover,然后打开数据库。
  
  [oracle@rtest ~]$ rman target /
  

  Recovery Manager: Release 11.2.0.3.0 - Production on Thu Nov 7 13:28:23 2013
  

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

  connected to target database: TEST1107 (DBID=2336818266, not open)
  

  RMAN> restore datafile 1,3
  2> ;
  

  Starting restore at 07-NOV-13
  using target database control file instead of recovery catalog
  allocated channel: ORA_DISK_1
  channel ORA_DISK_1: SID=189 device type=DISK
  allocated channel: ORA_DISK_2
  channel ORA_DISK_2: SID=221 device type=DISK
  allocated channel: ORA_DISK_3
  channel ORA_DISK_3: SID=3 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 00003 to /u01/app/oracle/oradata/test1107/undotbs01.dbf
  channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/TEST1107/backupset/2013_11_07/o1_mf_nnndf_TAG20131107T131035_97qox15d_.bkp
  channel ORA_DISK_2: starting datafile backup set restore
  channel ORA_DISK_2: specifying datafile(s) to restore from backup set
  channel ORA_DISK_2: restoring datafile 00001 to /u01/app/oracle/oradata/test1107/system01.dbf
  channel ORA_DISK_2: reading from backup piece /u01/app/oracle/fast_recovery_area/TEST1107/backupset/2013_11_07/o1_mf_nnndf_TAG20131107T131035_97qowz79_.bkp
  channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/TEST1107/backupset/2013_11_07/o1_mf_nnndf_TAG20131107T131035_97qox15d_.bkp tag=TAG20131107T131035
  channel ORA_DISK_1: restored backup piece 1
  channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
  channel ORA_DISK_2: piece handle=/u01/app/oracle/fast_recovery_area/TEST1107/backupset/2013_11_07/o1_mf_nnndf_TAG20131107T131035_97qowz79_.bkp tag=TAG20131107T131035
  channel ORA_DISK_2: restored backup piece 1
  channel ORA_DISK_2: restore complete, elapsed time: 00:02:56
  Finished restore at 07-NOV-13
  

  RMAN> recover datafile 1,3;
  

  Starting recover at 07-NOV-13
  using channel ORA_DISK_1
  using channel ORA_DISK_2
  using channel ORA_DISK_3
  

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

  Finished recover at 07-NOV-13
  

  RMAN> alter database open;
  

  database opened
         版权声明:本文为博主原创文章,未经博主允许不得转载。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-136709-1-1.html 上篇帖子: OCP-1Z0-053-V13.02-641题 下篇帖子: OCP-1Z0-053-V12.02-204题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表