[每日一题] 11gOCP 1z0-052 :2013-09-17 DRA--Data Recovery Advisor.............................B31
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/11818529
正确答案:AD
数据库恢复顾问(DRA)是一个诊断和修复数据库问题的工具。共有两个界面:RMAN可执行程序和Enteprise Manger。DRA能够生成脚本来修复数据文件和(在某些境下)控制文件受到的损坏:它不提供有关服务器参数文件和联机重做日志文件问题的建议。DRA依赖于自动诊断知识库(Automatic DiagnosticRepository,ADR)和Health Monitor。虽然DBA不使用HealthMonitor和DRA时会采用相同的诊断和修复方法,但Health Monitor 收集信息和DRA给出建议的过程更快捷,发生错误的概率更低。
1、 Health Monitor 和DRA
Health Monitor是一组检查,会在特定错误条件出现时自动运行,也可以根据DAR的指示以手功方式运行。检查结果不存储在数据库,而存储在文件系统中。其原因在于,一些错误的性质决定了数据库不再可用:因此,需要一个外部知识库来存储Health Monitor的结果。该知识库就是自动诊断知识库(AutomaticDiagnostic Repository,ADR),位于Diganostic_dest实例参数指定的目录中。
2、 DRA的功能和局限性
只有实例处于nomount模式或更高模式时,DRA才能奏效。如果初始化文件存在问题,它就起不到帮助作用。在nomount模式中,它可以诊断控制文件的问题,并通过使用现有的有效副本(如果不存在,就尝试从备份集(如果存在)中提取一个副本)生成用来还原的脚本。一旦数据库进入mount模式,DRA就可以诊断有关数据文件缺失或受损的问题,以及联机日志文件组丢失的问题,并生成修复脚本。
当前版本的DRA仅支持单实例数据库。如果RAC数据库由于故障而失败,就可以在单实例模式中加模它,使用DRA修复损坏的内容,然后关闭它并在RAC模式中重新打开。此技可能无法修复在一个实例本地发生的损坏。DRA不能使用备用数据库的块和文件来修复主数据库的故障,也不能修复备用数据库的故障。
考点:DRA只能用于单实例数据库的环境。它不能用于RAC集群数据库,也不能用于Data Guard备用数据库。
3、一个实验,使用ADR诊断问题并提出建议,将数据库引发一个问题,然后使用DRA予以报告。
(1) 在oracle的sys用户下启动RMAN
[oracle@mydb ~]$ rman target / Recovery Manager: Release 11.2.0.3.0 - Production on Wed Sep 18 17:08:36 2013 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: OCM (DBID=2206937749)
(2) 确认存在SYSAUX表空间的全部完整备分:
RMAN> list backup of tablespace sysaux; List of Backup Sets
=================== BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
17 Full 1.22G DISK 00:00:58 18-SEP-13
BP Key: 17 Status: AVAILABLE Compressed: NO Tag: TAG20130918T171810
Piece Name: /backup/rman/0nok63mi_1_1
List of Datafiles in backup set 17
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 Full 3077276 18-SEP-13 /u01/app/oracle/oradata/ocm/sysaux01.dbf
如果没有返回至少一个full类型的备份集,就创建一个:
Backup as bakcupset tablespace sysaux;
(3)关闭实例并退出rman
RMAN> shutdown immediate; database closed
database dismounted
Oracle instance shut down RMAN> exit Recovery Manager complete.
(4) 使用操作系统实用程序,删除在步骤(2)中列出的sysaux表空间的数据文件。如果使用Windows就必须停止实例在其下的Windows服务,以便在执行删除前释放Windows文件块。
[oracle@mydb ~]$ rm -rf /u01/app/oracle/oradata/ocm/sysaux01.dbf
(5) 使用SQL*Plus连接到数据库,并试着启动:
idle> conn / as sysdba
Connected to an idle instance.
idle> startup
ORACLE instance started. Total System Global Area 839282688 bytes
Fixed Size 2233000 bytes
Variable Size 562040152 bytes
Database Buffers 268435456 bytes
Redo Buffers 6574080 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
ORA-01110: data file 2: '/u01/app/oracle/oradata/ocm/sysaux01.dbf'
这将在启动到MOUNT模式,并出现有关丢失文件的错误。如果使用Windows,确保已经启动了服务。
(6)像步骤(1)那样,启动RMAN可执行程序并连接。
[oracle@mydb ~]$ rman target / Recovery Manager: Release 11.2.0.3.0 - Production on Wed Sep 18 17:25:43 2013 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: OCM (DBID=2206937749, not open)
(7)诊断问题,列出当前的所有故障:
将返回一条消息,指出丢失一个或多个非系统数据文件时产生的影响。
RMAN> list failure; using target database control file instead of recovery catalog
List of Database Failures
========================= Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
2002 HIGH OPEN 18-SEP-13 One or more non-system datafiles are missing
(8)生成有关故障的建议:
RMAN> advise failure; List of Database Failures
========================= Failure ID Priority Status Time Detected Summary
---------- -------- --------- ------------- -------
2002 HIGH OPEN 18-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/sysaux01.dbf was unintentionally renamed or moved, restore it Automated Repair Options
========================
Option Repair Description
------ ------------------
1 Restore and recover datafile 2
Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/ocm/ocm/hm/reco_2271988430.hm
这将建议你还原和恢复数据文件,并成修复脚本。使用任意操作系统编辑器打开脚本,并研究其内容。第一条建议,系统管理员犯下的一些错误导致了问题,问题可以手功修复。此后是一个有关还原和恢复的自动修复建议。这是RMAN脚本形式。脚本内容如下:
# restore and recover datafile
restore datafile 2;
recover datafile 2;
要运行脚本,将使用以下命令:
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_2271988430.hm contents of repair script:
# restore and recover datafile
restore datafile 2;
recover datafile 2;
sql 'alter database datafile 2 online'; Do you really want to execute the above repair (enter YES or NO)? Y
executing repair script Starting restore at 18-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 00002 to /u01/app/oracle/oradata/ocm/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece /backup/rman/0nok63mi_1_1
channel ORA_DISK_1: piece handle=/backup/rman/0nok63mi_1_1 tag=TAG20130918T171810
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 18-SEP-13 Starting recover at 18-SEP-13
using channel ORA_DISK_1 starting media recovery
media recovery complete, elapsed time: 00:00:00 Finished recover at 18-SEP-13 sql statement: alter database datafile 2 online
repair failure complete Do you want to open the database (enter YES or NO)? Y
database opened
然后打开数据库。
提示:DRA可以运行,但你通常可以做得更好。例如,在执行还原和恢复前,DRA不生成通过打开数据库将停机时间最小化的脚本。
使用Database control连接到受损数据库,始终有一个名为Perform Recovery的按钮。如下图所示。Information部分显示存在一个故障,并因此加载了数据库。Advise And Recover按钮将启动一个向导,此向导列出故障的详细信息,生成修复脚本,然后将其作为作业提交给Eterprise Manager作业系统,最后提示打开数据库。
考点:
如果不首先要求DRA列出故障,则DRA不会发生成任何建议。对于最近一次列出之后发生的任何故障或修复的任何故障,DRA不提供任何建议。
DRA可以生成脚,以还原丢失或受损控制文件副本,重新生成丢失的联机日志文组,并还原或恢复丢失或受损的数据文件。如果多重日志文件组的成员受损,它将不会采取任何操作。
QQ:252803295
技术交流QQ群:
DSI&Core Search Ⅰ 群:127149411(2000人技术群:未满)
DSI&Core Search Ⅱ 群:177089463(1000人技术群:未满)
DSI&Core Search Ⅲ 群:284596437(500人技术群:未满)
DSI&Core Search Ⅳ 群:192136702(500人技术群:未满)
DSI&Core Search Ⅴ 群:285030382(500人闲聊群:未满)
MAIL:dbathink@hotmail.com
BLOG: http://blog.csdn.net/guoyjoe
WEIBO:http://weibo.com/guoyJoe0218
ITPUB: http://www.itpub.net/space-uid-28460966.html
OCM: http://education.oracle.com/education/otn/YGuo.HTM
[每日一题] 11gOCP 1z0-052 :2013-09-17 DRA--Data Recovery Advisor.............................B31的更多相关文章
- [每日一题] 11gOCP 1z0-052 :2013-09-1 RMAN-- repair failure........................................A20
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10859315 正确答案:D 一.模拟上题的错误: 1.删除4号文件 [oracle@myd ...
- [每日一题] 11gOCP 1z0-053 :2013-10-9 backup with the KEEP option....................................33
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/12517603 正确答案:AB 在Oracle 11g中,可以使用backup ….keep ...
- [每日一题] 11gOCP 1z0-053 :2013-10-12 RESULT_CACHE在哪个池?.............................44
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/12657479 正确答案:B Oracle 11g 新特性:Result Cache , ...
- [每日一题] 11gOCP 1z0-052 :2013-08-31 数据库的存储结构....................................................A8
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10784599 . 正确答案:A 将逻辑存储与物理存储分开是关系数据库范例的必要部分.关系数 ...
- [每日一题] 11gOCP 1z0-052 :2013-09-19 创建用户...................................................B41
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/11834661 正确答案:BC 这道题比较简单,我就以答案来解析,如下来自官方文档创建用户的 ...
- [每日一题] 11gOCP 1z0-052 :2013-09-5 runInstaller oracle of no swap
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/11186995 正确答案:A 我们先来看下面这张截图,这是我在安装Oracle 11.2.0 ...
- [每日一题] 11gOCP 1z0-053 :2013-10-11 Flashback Data Archive属性.........................43
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/12656897 正确答案:BD 闪回数据归档请参考:http://blog.csdn.net ...
- [每日一题] 11gOCP 1z0-053 :2013-10-7 the backup of MULT_DATA................................32
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/12500579 正确答案:D RMAN 的新增功能 对超大型文件应用 Intraf ...
- [每日一题] 11gOCP 1z0-052 :2013-09-2 ADDM(Automatic Database Diagnostic Monitor)...................A28
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10951207 正确答案:BC AWR简称Automatic Workload Reposi ...
随机推荐
- Extjs Store 的用法详解
Ext.data.Store的基本用法 在使用之前,首先要创建一个Ext.data.Store的实例,如下面的代码所示. 每个store最少需要两个组件的支持,分别是proxy和reade ...
- Web 前端知识点
- CentOS 6下配置本地用户访问vsftpd并赋予写权限
一.安装并测试可用性 1.安装命令 yum install vsftpd 2.配置防火墙,加入一行 -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT 在其它机测试 ...
- mongodb or操作与连接池
mongodb # 类似于sql中的in或者or操作 mulites field query: db.cool.find({$or:[{field1:'val'},{'field2':'val'}-] ...
- C语言如何定义结构体
原文地址 1. struct与typedef struct区别 struct是结构体的关键字,用来声明结构体变量如 struct student { char num[10]; ch ...
- 复习-C语言内嵌汇编-初级(2)
汇编取出内存中的值 # include <stdio.h> int main() { ; ; int *p = &i; //ret = *p; __asm__( "ldr ...
- delphi 实现vip126发邮件
本例是 TSimpleThread , TSimpleList, IdhttpEx 网页模拟(POST)的综合运用. Demo只写了发送,但亦可收取,详见源码. (此源码写于2年前,那时还写得不好,请 ...
- HTTP协议漫谈
简介 园子里已经有不少介绍HTTP的的好文章.对HTTP的一些细节介绍的比较好,所以本篇文章不会对HTTP的细节进行深究,而是从够高和更结构化的角度将HTTP协议的元素进行分类讲解. HTTP的定义和 ...
- https://repo1.maven.org/maven2/com/github/,开源软件清单list
Index of /maven2/com/github/ ../ 0312birdzhang/ 26-Jun-2015 07:21 - 120011676/ 22-Mar-2016 11:16 - 1 ...
- C与C++不同
常量表示方法不同 C不支持引用,C++支持 注释不同,C89不支持单行注释 (++i)++在C中不合法 (a=3)=4在C中不合法 不能在for循环头部定义变量 C++注重类型,强类型,严格检查类型 ...