The data recovery advisor makes it possible to detect corruption or loss of data, determines the actions to be carried out and suggests the actions to be taken to repair the database.
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
———- ——– ——— ————- ——-
48 HIGH OPEN 22-FEB-12 One or more non-system datafiles are missing
ADVISE FAILURE
ADVISE FAILURE as its name indicates, allows you to give advice for repairing the problems listed by the LIST FAILURE command. If possible it will create a script to fix the problem.
If another failure appears after the list failure, this will not be included in the advice given by the ADVISE FAILURE command. You must redo a FAILURE LIST for this to be taken into account.
RMAN> advise failure;
List of Database Failures
=========================
Failure ID Priority Status Time Detected Summary
———- ——– ——— ————- ——-
48 HIGH OPEN 22-FEB-12 One or more non-system datafiles are missing
analyzing automatic repair options; this may take some time
using channel ORA_DISK_1
analyzing automatic repair options complete
Mandatory Manual Actions
========================
no manual actions available
Optional Manual Actions
=======================
1. If file /oracle/oradata/orcl/datafile/o1_mf_users_7n6xprq9_.dbf was unintentionally renamed or moved, restore it
Automated Repair Options
========================
Option Repair Description
—— ——————
1 Restore and recover datafile 4
Strategy: The repair includes complete media recovery with no data loss
Repair script: /oracle/diag/rdbms/orcl/ORCL/hm/reco_1941492637.hm
RMAN> REPAIR FAILURE PREVIEW;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /oracle/diag/rdbms/orcl/ORCL/hm/reco_1941492637.hm
contents of repair script:
# restore and recover datafile
sql ‘alter database datafile 4 offline’;
restore datafile 4;
recover datafile 4;
sql ‘alter database datafile 4 online’;
By default, the REPAIR FAILURE command requests confirmation to apply the corrections. This can be overridden with the NOPROMPT option.
RMAN> REPAIR FAILURE NOPROMPT;
Strategy: The repair includes complete media recovery with no data loss
Repair script: /oracle/diag/rdbms/orcl/orcl/hm/reco_1941492637.hm
contents of repair script:
# restore and recover datafile
sql ‘alter database datafile 4 offline’;
restore datafile 4;
recover datafile 4;
sql ‘alter database datafile 4 online’;
executing repair script
sql statement: alter database datafile 4 offline
Starting restore at 22-FEB-12
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 00004 to /oracle/oradata/ORCL/datafile/o1_mf_users_7n6xprq9_.dbf
channel ORA_DISK_1: reading from backup piece /oracle/flash_recovery_area/backups/ORCL/ORCL_db_gqn3uqh2.rmanbck
channel ORA_DISK_1: piece handle=/oracle/flash_recovery_area/backups/ORCL/ORCL_db_gqn3uqh2.rmanbck tag=TAG20120222T095753
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 22-FEB-12
Starting recover at 22-FEB-12
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 22-FEB-12
sql statement: alter database datafile 4 online
repair failure complete