关于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. 彻底理解ThreadLocal一

    synchronized这类线程同步的机制可以解决多线程并发问题,在这种解决方案下,多个线程访问到的,都是同一份变量的内容.为了防止在多线程访问的过程中,可能会出现的并发错误.不得不对多个线程的访问进 ...

  2. ado.net 向sql中插入新数据的同时获取自增重的id值

    两种方法都可以实现: 要获取的自增长列为phonebookID 方法一: sql = "insert into phonebook (mobile,peoplename) output in ...

  3. pthread——pthread_cleanup

    Pthread_cleanup用于注册线程清理函数,注册的清理函数将在线程被取消或者主动调用pthread_exit时被调用:     一个简单的示例: #include <pthread.h& ...

  4. 配置tomcat编码格式

    tomcat默认编码格式为“ISO-8859-1”,打开tomcat的“server.xml”文件,找到下面行并修改 <Connector connectionTimeout="200 ...

  5. Lucene 查询工具 LQT

    Lucene Query Tool (lqt) 是一个命令行工具用来执行 Lucene 查询并对结果进行格式化输出. 使用方法: 01 $ ./lqt 02 usage: LuceneQueryToo ...

  6. mono for android学习过程系列教程(6)

    接着上一讲,今天讲的是Button,CheckBox这二个安卓元素, 我们来看第一个Button这个控件,类似winform和webform里面一样,它也是 存在有触发事件的,我们新建初始化项目直接就 ...

  7. HTTP解析

    前言 B/S网络架构的核心是HTTP,掌握HTTP对一个从事互联网工作的程序员来说非常重要.要理解HTTP,最重要的是要熟悉HTTP的HTTP Header,HTTP Header控制着互联网上成千上 ...

  8. 作业七:团队项目——Alpha版本冲刺阶段-10

    部分代码: public void run(){ while (true){ //单击棋子第一下开始闪烁 if (chessManClick){ play[Man].setVisible(false) ...

  9. IO完成端口

    从MSDN中翻译了IO完成端口的文章,不得不说翻译的很烂,英语需要继续提高啊... 在一个多处理器系统上,IO完成端口提供一个非常高效的线程模型来处理多个异步IO请求.当一个进程创建了一个IO完成端口 ...

  10. Unity3D音乐音效研究-MIDI与波表

    其实音乐音效这个命题本身没什么好研究的. Unity3D提供了丰富的结构和使用方式,足够使用了. 但是我有一些小小的想法和需求,一般的Unity资料并没有给我答案. 一个是容量要小.MP3.OGG的高 ...