[每日一题] 11gOCP 1z0-052 :2013-09-1 RMAN-- repair failure........................................A20
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10859315
正确答案:D
一、模拟上题的错误:
1、删除4号文件
[oracle@mydb ~]$ cd /u01/app/oracle/oradata/ocm/
[oracle@mydb ocm]$ rm -rf users01.dbf
2、数据库宕机
sys@OCM> shutdown abort;
ORACLE instance shut down.
3、启动数据库报错,与上题报错一样
sys@OCM> startup
ORACLE instance started. Total System Global Area 839282688 bytes
Fixed Size 2233000 bytes
Variable Size 583011672 bytes
Database Buffers 247463936 bytes
Redo Buffers 6574080 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u01/app/oracle/oradata/ocm/users01.dbf'
4、如果试图在没有执行advise failure命令时使用repair failure命令,将出现如下错误:
[oracle@mydb ~]$ rman target /
RMAN> repair failure; using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of repair command at 09/01/2013 23:15:16
RMAN-06954: REPAIR command must be preceded by ADVISE command in same session
主要原因是:在运行repairfailure之前,要先运行advise failure,让rman列出错误,并且生成修复脚本,之后运行repair failure修复错误。
一、正确的恢复的过程如下:
1、 启动RMAN客户机,并使用前一节介绍的数据库修复命令来解决丢失数据问题,我们从list failure命令开始:
RMAN> list failure; List of Database Failures
========================= Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
2002 HIGH OPEN 01-SEP-13 One or more non-system datafiles are missing
2、advisefailure命令对记录在自动诊断信息库中的所有故障给出建议。默认时,此命令只列出具有critical或high优先级的那些故障。除了产生所有输入故障的摘要外,此命令还对每个故障提供一个建议修复选项。通常,advise failure命令同时给出自动和手动修复选项。在advisefailure命令输出结束时,RMAN生成一个脚本,列出建议的修复选项的细节。如果你想自己进行修复,可以直接使用这个脚本,或者对它进行修改。
RMAN> advise failure; List of Database Failures
========================= Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
2002 HIGH OPEN 01-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=10 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/ocm/users01.dbf was unintentionally renamed or moved, restore it Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Restore and recover datafile 4
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/ocm/ocm/hm/reco_3275375759.hm
3、利用advise failure命令提供的建议,epair failure根据建议修复错误。
RMAN> repair failure; Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/ocm/ocm/hm/reco_3275375759.hm contents of repair script:
# restore and recover datafile
restore datafile 4;
recover datafile 4;
sql 'alter database datafile 4 online'; Do you really want to execute the above repair (enter YES or NO)? Y
executing repair script Starting restore at 01-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/ocm/users01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/dbs/0uoiptgq_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/dbs/0uoiptgq_1_1 tag=TAG20130901T230250
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 01-SEP-13 Starting recover at 01-SEP-13
using channel ORA_DISK_1 starting media recovery
media recovery complete, elapsed time: 00:00:01 Finished recover at 01-SEP-13 sql statement: alter database datafile 4 online
repair failure complete Do you want to open the database (enter YES or NO)? Y
database opened
QQ:252803295
学习交流QQ群:
DSI&Core Search Ⅰ 群:127149411(技术:已满)
DSI&Core Search Ⅱ 群:177089463(技术:未满)
DSI&Core Search Ⅲ 群:284596437(技术:未满)
DSI&Core Search Ⅳ 群:192136702(技术:未满)
DSI&Core Search Ⅴ 群:285030382(闲聊:未满)
最新文章
- js中获取css的样式
- ubuntu 编译源码坏境配置
- 学习myBatis - 如何配置myBatis
- java EE实现动态SQL的
- Tomcat类加载器机制
- 再谈自主开发与企业IT管理
- 转!!java中关键字volatile的作用
- jquery实现点击页面空白隐藏指定菜单
- linux下vsftpd的安装与配置说明
- 关于iOS中用AudioFile相关API解码或播放AAC_HE_V2时仅仅能识别单声首22.05k採样率的问题
- ASP.NET MVC IOC 之Ninject攻略
- git reflog -- 显示所有提交
- Linux结束进程到底有多少种方法?
- n2n的编译和运行、配置
- 基于FeignClient提供简单的用户查询服务
- Python socket文件传送md5校验
- 开源项目Zookeeper、Doozer、etcd进行总结
- Android调用系统的打电话和发短信界面(1.将消息内容带过去2.实现群发)
- AOP 环绕通知 集成了前置 后置 返回通知等功能
- LUA返回的是引用
热门文章
- 主流的phpcms分析
- [Linux]XAMPP安装
- Python 学习笔记(3) - 控制流、函数
- 使用PHP生成二维码的两种方法(带logo图像)
- 【产品对比分析】See做了明星衣橱想做的东西?
- jQuery分页插件jBootstrapPage,一个Bootstrap风格的分页插件
- wget命令解析
- 开启Eclipse 智能感知代码功能
- The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
- vs查看虚函数表和类内存布局