关于DRA的官方描述:

The simplest way to diagnose and repair database problems is to use the Data Recovery Advisor. This Oracle Database tool provides an infrastructure for diagnosing persistent data failures, presenting repair options to the user, and automatically executing repairs.

下面我们来做一个小实验来实际体会下DRA的便利性:

  1. rman登录到目标数据库
  2. 我们这里模拟丢失了一个数据文件
  3. 观察DRA是如何恢复数据库的

1.rman登录到目标数据库

[oracle@JY-DB BACKUP]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Aug 5 11:15:12 2015

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

connected to target database: JYZHAO (DBID=2463175424, not open)

RMAN> LIST FAILURE;

using target database control file instead of recovery catalog
no failures found that match specification

可以看到目前数据库没有找到需要恢复的匹配项。

2.我们这里模拟丢失了一个数据文件

#2.1 正常关库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down. #2.2 删除数据文件+DATA1/jyzhao/datafile/dbs_d_jingyu.259.886871319
#直接删除数据文件会报错
ASMCMD> rm DBS_D_JINGYU.259.886871319
ORA-15032: not all alterations performed
ORA-15028: ASM file '+DATA1/jyzhao/datafile/DBS_D_JINGYU.259.886871319' not dropped; currently being accessed (DBD ERROR: OCIStmtExecute)
#数据库关闭后删除成功
ASMCMD> rm DBS_D_JINGYU.259.886871319
ASMCMD> #2.3 尝试打开数据库报错
SQL> startup
ORACLE instance started. Total System Global Area 1620115456 bytes
Fixed Size 2253704 bytes
Variable Size 905972856 bytes
Database Buffers 704643072 bytes
Redo Buffers 7245824 bytes
Database mounted. ORA-01157: cannot identify/lock data file 15 - see DBWR trace file
ORA-01110: data file 15: '+DATA1/jyzhao/datafile/dbs_d_jingyu.259.886871319'

3.观察DRA是如何恢复数据库的

## 3.1 LIST FAILURE; ##

RMAN> LIST FAILURE;

List of Database Failures
========================= Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
4042 HIGH OPEN 05-AUG-15 One or more non-system datafiles are missing

3.2 ADVISE FAILURE;

RMAN> ADVISE FAILURE;

List of Database Failures
========================= Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
4042 HIGH OPEN 05-AUG-15 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=25 device type=DISK
analyzing automatic repair options complete Mandatory Manual Actions
========================
no manual actions available Optional Manual Actions
=======================
1. If file +DATA1/jyzhao/datafile/dbs_d_jingyu.259.886871319 was unintentionally renamed or moved, restore it
2. Try flush redo using ALTER SYSTEM FLUSH REDO TO 'standby name' command. Then perform a Data Guard role change (failover). Available standbys: jyzhao_s. Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Restore and recover datafile 15
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/jyzhao/jyzhao/hm/reco_4099084102.hm

3.3 REPAIR FAILURE;

RMAN>  REPAIR FAILURE;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/jyzhao/jyzhao/hm/reco_4099084102.hm contents of repair script:
# restore and recover datafile
restore datafile 15;
recover datafile 15;
sql 'alter database datafile 15 online'; Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script Starting restore at 05-AUG-15
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 00015 to +DATA1/jyzhao/datafile/dbs_d_jingyu.259.886871319
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/11.2.0/db_1/dbs/arch/JYZHAO/backupset/2015_08_05/o1_mf_nnndf_TAG20150805T102730_bw2x4m1l_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/11.2.0/db_1/dbs/arch/JYZHAO/backupset/2015_08_05/o1_mf_nnndf_TAG20150805T102730_bw2x4m1l_.bkp tag=TAG20150805T102730
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 05-AUG-15 Starting recover at 05-AUG-15
using channel ORA_DISK_1 starting media recovery
media recovery complete, elapsed time: 00:00:00 Finished recover at 05-AUG-15 sql statement: alter database datafile 15 online
repair failure complete Do you want to open the database (enter YES or NO)? yes
database opened RMAN>

到此,使用DRA自动恢复完毕并成功打开数据库。

DRA(Data Recovery Advisor)的使用的更多相关文章

  1. Data Recovery Advisor (DRA)

    数据恢复指导Data Recovery Advisor (DRA)的适用场景:Data Recovery Advisor 是11g 新特性,是Oracle 顾问程序架构的一部分,它会在遇到错误时自动收 ...

  2. Data Recovery Advisor(数据恢复顾问)

    Data Recovery Advisor 是11g新特性,是Oracle顾问程序架构的一部分,它会在遇到错误时自动收集有关故障信息.如果主动运行Data Recovery Advisor,通常可以在 ...

  3. VMware Data Recovery备份恢复vmware虚拟机

    VMware Data Recovery 是VMware虚拟机备份工具,可创建虚拟机备份,同时不会中断虚拟机的使用或虚拟机提供的数据和服务.Data Recovery 管理现有备份,并在这些备份过时后 ...

  4. 转:主流数据恢复软件——EasyRecovery/Ashampoo Undeleter/Wise Data Recovery/Recuva/Undelete 360

    转自:Baidu 空间 2012-10-05 13:57 主流数据恢复软件——EasyRecovery/Ashampoo Undeleter/Wise Data Recovery/Recuva/Und ...

  5. Percona Data Recovery Tool for InnoDB工具恢复单表的案例

    今天上班有个朋友询问我,相关Percona Data Recovery Tool for InnoDB恢复数据中的一些问题,比如说delete,没法恢复数据,原先做过类似的异常处理就,再次模拟了下相关 ...

  6. 使用Percona Data Recovery Tool for InnoDB恢复数据

      运维工作中难免会发生一些误操作,当数据库表被误操作删除需要紧急恢复,或者没有备份时,Percona Data Recovery Tool for InnoDB这个工具也已提供一些便捷的恢复. 当然 ...

  7. Android Data Recovery for Mac(安卓数据恢复软件)破解版安装

    1.软件简介    Android Data Recovery 是 macOS 系统上一款 Android 设备数据恢复软件,能够帮助我们在 mac 电脑上对 Android 设备进行数据恢复,文档. ...

  8. Aiseesoft Data Recovery 1.1.6 专业数据恢复软件破解版

    Aiseesoft Data Recovery是专业的数据恢复软件,它可以帮助你恢复几乎所有删除/丢失的文件,如照片,文件,电子邮件,音频,视频且支持从计算机,硬盘驱动器,闪存驱动器,存储卡,数码相机 ...

  9. 数据恢复(Data recovery)

    定义数据恢复: 当存储介质出现损伤或由于人员误操作.操作系统故障本身故障所造成的数据不可见,无法读取.丢失. 工程师通过特殊的手段读取却在正常状态下不可见,不可读,无法读的数据. 数据恢复(Data ...

随机推荐

  1. 一次千万级别的SQL查询简单优化体验

    背景:从两张有关联的表查询数据,A表数据量1400万,B表数据量8000万.A与B通过ID逻辑关联,没有实际的外键.B表是后来扩展出来的. 问题:根据某个ID查询时超时,运行时跑不出结果. 原因:使用 ...

  2. 使用OAuth打造webapi认证服务供自己的客户端使用(二)

    在上一篇”使用OAuth打造webapi认证服务供自己的客户端使用“的文章中我们实现了一个采用了OAuth流程3-密码模式(resource owner password credentials)的W ...

  3. C#调试入门篇

    DotNet程序的调试,是DotNet程序员必备的技能之一,开发出稳定的程序.解决程序的疑难杂症都需要很强大的调试能力.DotNet调试有很多方法和技巧.现在本文就介绍一下借助DebugView工具进 ...

  4. JavaScript思维导图—DOM基本操作

    JavaScript思维导图-来自@王子墨http://julying.com/blog/the-features-of-javascript-language-summary-maps/ DOM基本 ...

  5. FB引擎系列-之CloudSand

    CloudSand,欲打破之前的集中版本制作的模式, http://code.taobao.org/p/cloudsand包含服务器端代码(php)和客户端代码(unity)   EasyDown的时 ...

  6. js模版引擎handlebars.js实用教程——关于HTML编码

    返回目录 <!DOCTYPE html> <html> <head> <META http-equiv=Content-Type content=" ...

  7. 【译】用jQuery 处理XML-- DOM(文本对象模型)简介

    用jQuery 处理XML--写在前面的话 用jQuery 处理XML-- DOM(文本对象模型)简介 用jQuery 处理XML--浏览器中的XML与JavaScript 用jQuery 处理XML ...

  8. Java框架介绍-13个不容错过的框架项目

    本文转自互联网,个人收藏所用. 下面,我们将一同分享各有趣且颇为实用的Java库,大家请任取所需.不用客气~ 1.极致精简的Java Bootique是一项用于构建无容器可运行Java应用的极简技术. ...

  9. OutputCache属性详解(二)一 Location

    目录 OutputCache概念学习 OutputCache属性详解(一) OutputCache属性详解(二) OutputCache属性详解(三) OutputCache属性详解(四)— SqlD ...

  10. Linux初学 - head,tail,grep,sed,yum,find

    head 查看文件头部 -n 指定查看行数 默认10行 tail 查看文件尾部 n 指定查看行数 默认10行 Grep 命令 用法大全 . 参数: -I :忽略大小写 -c :打印匹配的行数 -l : ...