RMAN学习之六:Data Recovery Advisor

1、Data Recovery Advisor是11G的新特性。

2、以自带EXAMPLE为例,脱机删掉数据文件。

SQL> alter tablespace EXAMPLE offline;
Tablespace altered.
ASMCMD> rm +DATA/orcl/datafile/example.265.799151711

3、恢复过程。

(1)查看故障。

RMAN> list failure;

List of Database Failures
=========================

Failure ID Priority Status    Time Detected       Summary
---------- -------- --------- ------------------- -------
2475       HIGH     OPEN      2012-11-12 10:35:31 Tablespace 6: 'EXAMPLE' is offline
2355       HIGH     OPEN      2012-11-12 10:32:17 One or more non-system datafiles are offline

有时故障重现不了,需要把库重新启下

(2)故障建议。

RMAN> advise failure;

WARNING: new failures were found since last LIST FAILURE command
List of Database Failures
=========================

Failure ID Priority Status    Time Detected       Summary
---------- -------- --------- ------------------- -------
2361       HIGH     OPEN      2012-11-12 10:52:02 One or more non-system datafiles are missing
2355       HIGH     OPEN      2012-11-12 10:32:17 One or more non-system datafiles are offline
2475       HIGH     OPEN      2012-11-12 10:35:31 Tablespace 6: 'EXAMPLE' is offline

analyzing automatic repair options; this may take some time
using channel ORA_DISK_1
using channel ORA_DISK_2
analyzing automatic repair options complete

Not all specified failures can currently be repaired.
The following failures must be repaired before advise for others can be given.

Failure ID Priority Status    Time Detected       Summary
---------- -------- --------- ------------------- -------
2361       HIGH     OPEN      2012-11-12 10:52:02 One or more non-system datafiles are missing

Mandatory Manual Actions
========================
no manual actions available

Optional Manual Actions
=======================
1. If file +DATA/orcl/datafile/example.265.799151711 was unintentionally renamed or moved, restore it

Automated Repair Options
========================
Option Repair Description
------ ------------------
1      Restore and recover datafile 5  
  Strategy: The repair includes complete media recovery with no data loss
  Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_3825094584.hm

(3)修复预览

RMAN> repair failure preview;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_3745742565.hm

contents of repair script:
   # restore and recover datafile
   restore datafile 5;
   recover datafile 5;

(4)修复故障

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss
Repair script: /u01/app/oracle/diag/rdbms/orcl/orcl/hm/reco_3745742565.hm

contents of repair script:
   # restore and recover datafile
   restore datafile 5;
   recover datafile 5;

Do you really want to execute the above repair (enter YES or NO)? yes
executing repair script

Starting restore at 2012-11-12 10:57:08
using channel ORA_DISK_1
using channel ORA_DISK_2

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 00005 to +DATA/orcl/datafile/example.265.799151711
channel ORA_DISK_1: reading from backup piece +FRA/57nq294r_1_1
channel ORA_DISK_1: piece handle=+FRA/57nq294r_1_1 tag=TAG20121111T172339
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:30
Finished restore at 2012-11-12 10:57:38

Starting recover at 2012-11-12 10:57:38
using channel ORA_DISK_1
using channel ORA_DISK_2

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

Finished recover at 2012-11-12 10:57:42
repair failure complete

别忘了表空间online

SQL> alter tablespace EXAMPLE online;

Tablespace altered.

(5)故障清除

RMAN> list failure;

no failures found that match specification

posted on 2012-11-12 10:40  guarder  阅读(298)  评论(0编辑  收藏  举报