In Oracle 11g, RMAN provides a new advisor called Data Recovery Advisor (DRA). DRA has several new commands to help DBAs for performing recovery tasks.
To list of database failures, you can issue:
1 2 3 4 5 6 7 8 9 |
RMAN> list failure; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------- 522 HIGH OPEN 08-SEP-09 One or more non-system datafiles are missing |
DRA will consolidate related failures into a single failure. You can list a failure individually by issuing “list failure X detail” command.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
RMAN> list failure 522 detail; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------- 522 HIGH OPEN 08-SEP-09 One or more non-system datafiles are missing Impact: See impact for individual child failures List of child failures for parent failure ID 522 Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------- 525 HIGH OPEN 08-SEP-09 Datafile 4: '/abc' is missing Impact: Some objects in tablespace USERS might be unavailable |
By default, the list failure command shows all failures with the critical and high priorities. You can list failures for a specific priority:
1 2 3 4 |
RMAN> list failure closed; RMAN> list failure low; RMAN> list failure high; RMAN> list failure critical; |
When you fix a failure, the failure will be closed automatically. However, sometimes a failure may be irrelevant for you. In this case, you can use RMAN’s change failure command to close it. You can also use this command to change the priority (you can’t change a priority level of critical):
1 2 |
RMAN> change failure 522 closed; RMAN> change failure 522 priority low; |
DRA can also recommend how to fix the failures:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
RMAN> advise failure; List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------- 522 HIGH OPEN 08-SEP-09 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 /u01/oracle/oradata/users01.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: /u01/oracle/diag/rdbms/reco_990089206.hm |
Once DRA provides its repair recommendations, you can choose to run the repair failure command to fix and close a specific failure. If the advise failure command recommends any manual repairs, you need to perform these repairs first:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
RMAN> repair failure; Strategy: The repair includes complete media recovery with no data loss Repair script: /u01/oracle/diag/rdbms/reco_990089206.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'; Do you really want to execute the above repair (enter YES or NO)? YES executing repair script sql statement: alter database datafile 4 offline Starting restore at 08-SEP-09 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 4 to /u01/oracle/oradata/users01.dbf channel ORA_DISK_1: reading from backup piece /u01/oracle/fra/backup.bkp channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:03 Finished restore at 08-SEP-09 Starting recover at 08-SEP-09 using channel ORA_DISK_1 starting media recovery media recovery complete, elapsed time: 00:00:01 Finished recover at 08-SEP-09 sql statement: alter database datafile 4 online repair failure complete |
If you don’t want RMAN actually repair the failure but just want to examine RMAN’s repair actions, you can use the preview option:
1 |
RMAN> repair failure preview; |
Phong Kieu
Gokhan Atil