Get in touch: [email protected]

Suggesting Corrective Action – RMAN Backups and Reporting

The ADVISE FAILURE command gives advice about how to recover from potential problems detected by the Data Recovery Advisor. If you have multiple failures with your database, you can directly specify the failure ID to get advice on a given failure, like so:

RMAN> advise failure 6222;

Here is a snippet of the output for this particular issue:

Optional Manual Actions

1. If file /u01/dbfile/db23c/system01.dbf was unintentionally renamed or moved,

restore it

Automated Repair Options Option Repair Description

1       Restore and recover datafile 1

Strategy: The repair includes complete media recovery with no data loss Repair script: /ora01/app/oracle/diag/rdbms/db23c/db23c/hm/ reco_4116328280.hm

In this case, the Data Recovery Advisor created a script that can be used to potentially fix the problem. The contents of the repair script can be viewed with an OS utility; for example,

$ cat /ora01/app/oracle/diag/rdbms/db23c/db23c/hm/reco_4116328280.hm

Here are the contents of the script for this example:

# restore and recover datafile restore ( datafile 1 ); recover datafile 1;

sql ‘alter database datafile 1 online’;

After reviewing the script, you can decide to run the suggested commands manually, or you can have the Data Recovery Advisor run the script via the REPAIR command (see the next section for details).

Repairing Failures

If you have identified a failure and viewed the recommended advice, you can proceed to the repair work. If you want to inspect what the REPAIR FAILURE command will do without actually running the commands, use the PREVIEW clause:

RMAN> repair failure preview;

Before you run the REPAIR FAILURE command, ensure that you first run the LIST FAILURE and ADVISE FAILURE commands from the same connected session. In other words, the RMAN session that you are in must run the LIST and ADVISE commands within the same session before running the REPAIR command.

If you are satisfied with the repair suggestions, then run the REPAIR FAILURE command:

RMAN> repair failure;

You will be prompted at this point for confirmation:

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

Type YES to proceed:

YES

If all goes well, you should see a final message such as this in the output:

repair failure complete