Data Recovery Advisor – The Easiest Way of Data Recovery

The Data Recovery Advisor is a new adviser to repair data failures and corruptions. You can use the Data Recovery Advisor via Enterprise Manager, Grid Control or RMAN cli.

Lets look the Data Recovery Advisory commands

  • List Failure  : List the failure with its priority and status.

Here is an example :  

RMAN> list failure;

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

Failure ID Priority Status    Time Detected Summary
———- ——– ——— ————- ——-
342        HIGH     OPEN      10-JUL-14     One or more non-system datafiles are missing

  • Advise Failure  : Shows manual and automatic repair options.

Lets see the advice for the failure 342:

RMAN> advise failure;

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

Failure ID Priority Status    Time Detected Summary
———- ——– ——— ————- ——-
342        HIGH     OPEN      10-JUL-14     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=125 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/ORA/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/ora/ORA/hm/reco_4130221454.hm

 My sysaux01.dbf corrupted as you see :). Output of “advise failure” command has 3 sections. In my example “Optional Manual Actions” section has an advise if file can be restored manually. However we have a script for restoring and recoving the data file in the last section of the output called “Automated Repair Options”. Lets have a look at the script.

$ more /u01/app/oracle/diag/rdbms/ora/ORA/hm/reco_668670694.hm
   # restore and recover datafile
   sql ‘alter database datafile 2 offline’;
   restore datafile 2;
   recover datafile 2;
   sql ‘alter database datafile 2 online’;

Running this RMAN script will resolve the problem with no data loss.

  • Repair Failure  : If you don’t want to run RMAN script manually, Oracle can do it for you:). After runninng “advise failure” , please run “repair failure” command and write down “YES”. Here is the example for another datafile failure:

RMAN> repair failure ;

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

contents of repair script:
   # restore and recover datafile
   sql ‘alter database datafile 6 offline’;
   restore datafile 6;
   recover datafile 6;
   sql ‘alter database datafile 6 online’;

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

sql statement: alter database datafile 6 offline

Starting restore at 10-JUL-14
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 00006 to /u01/app/oracle/oradata/ORA/sg01.dbf
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/ORA/backupset/2014_07_10/o1_mf_nnndf_TAG20140710T111214_9vwlpyl0_.bkp
channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/ORA/backupset/2014_07_10/o1_mf_nnndf_TAG20140710T111214_9vwlpyl0_.bkp tag=TAG20140710T111214
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 10-JUL-14

Starting recover at 10-JUL-14
using channel ORA_DISK_1

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

Finished recover at 10-JUL-14

sql statement: alter database datafile 6 online
repair failure complete

That’s All.

  • Change Failure : Sometimes we may want to change the priority of failure. Because of dummy monitoring systems,dummy check scripts etc. In such cases, you can use this command to change the priority.

RMAN> CHANGE FAILURE <#ofFailure> PRIORITY LOW;

Example :

RMAN> CHANGE FAILURE 324 PRIORITY LOW;

Advertisements