Oracle RMAN 11g Backup and Recovery (104 page)

BOOK: Oracle RMAN 11g Backup and Recovery
6.93Mb size Format: txt, pdf, ePub
ads

instance mode). You also cannot use this command with a physical

standby database.

The
list failure
command does not check for database errors itself. The database is constantly checking for corruption issues, and those issues regularly are recorded in the data dictionary (and in the physical ADR repository, which is on disk and not in the database).

If the failure occurred while the database was shut down, a failure will not be detected until that missing component is needed. For example, if the control file is missing, that will not be detected until an attempt to mount the database occurs. If a datafile is missing, then that event will not be detected until you try to open the database. If the database was open when the event occurred, it is likely that the event will be detected while the database is open.

If a failure with an OPEN status appears in the list, this means you have a current problem that you will need to deal with. This problem will be linked to one or more repair actions that you can view via the new
advise failure
command. These options will help you to determine what repair options are available to correct the situation. Let’s look at that command next.

NOTE

If you just have a datafile offline, then that datafile will not be reported
as a failure. If the offline datafile is physically missing, then it will be
reported as a failure.

300
Part II: Setup Principles and Practices

The advise failure Command
Once the
list failure
command displays an open failure, the
advise failure
command can be used to provide recommended actions that you can take to correct the failure. Here is an example of the use of the
advise failure
command: RMAN> advise failure;

List of Database Failures

Failure ID Priority Status Time Detected Summary

---------- -------- --------- ------------- -------

187 HIGH OPEN 05-JUN-09 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 129 device type DISK

analyzing automatic repair options complete

Manual Checklist

1. If file C:\ORACLE\ORADATA\ROB11GR4\ROB11GR4\DOOGLE01.DBF was

unintentionally renamed or moved, restore it

Automated Repair Options

Option Repair Description

------ ------------------

1 Restore and recover datafile 6

Strategy: The repair includes complete media recovery with

no data loss

Repair script:

C:\ORACLE\PRODUCT\diag\rdbms\rob11gr4\rob11gr4\hm\reco 1214740950.hm

NOTE

As with the
list failure
command, the
advise failure
command can
only be run on a single instance database (thus, the RAC cluster must
be brought now to single instance mode). You also cannot use this

command with a physical standby database.

You will notice from the output that RMAN provides both manual and automated repair options. The automated repair option contains RMAN commands that can be used to correct the problem. These automated repair options may differ based on the state the database is in (say, nomount versus mount). We recommend then that you open the database as much as possible. For example, if you can successfully mount the database, do so rather than leave it in nomount mode.

Also note that repair options may involve data loss, and that the Data Recovery Advisor will indicate if data loss will occur if a given recovery option is used. These commands are contained in a file within the ADR structure. Here is an example of the recovery file:

# restore and recover datafile

restore datafile 6;

recover datafile 6;

sql 'alter database datafile 6 online';

Chapter 12: RMAN Restore and Recovery
301

You can choose to run the recovery file manually, or you can use the
repair failure
command, which is our next topic.

The repair failure Command
Now that we have detected a failure and determined the recovery actions recommended by Oracle, we can manually repair the failure, or allow Oracle to repair the failure automatically with the
repair failure
command. To run the
repair failure
command, the target database instance must be started. If multiple repairs are required, Oracle will try to consolidate them into one repair operation. Also, RMAN will double-check that the failures still exist and will not perform a recovery operation if the failure has been corrected. Here is an example of using the
repair failure
command from RMAN (we have removed some RMAN

output for brevity’s sake):

RMAN> repair failure;

Strategy: The repair includes complete media recovery with no data loss

Repair script:

C:\ORACLE\PRODUCT\diag\rdbms\rob11gr4\rob11gr4\hm\reco 110341808.hm

contents of repair script:

# restore and recover datafile

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

Starting restore at 05-JUN-09

using channel ORA DISK 1

... Typical RMAN restore output is removed for brevity...

Starting recover at 05-JUN-00

using channel ORA DISK 1

... Typical RMAN recover output is removed for brevity...

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

Finished recover at 05-JUN-09

sql statement: alter database datafile 6 online

repair failure complete

NOTE

Again, the
repair failure
command can only be run on a single
instance database (thus, the RAC cluster must be brought now to

single instance mode). Note that this command will not repair failures
such as datafiles that cannot be accessed by a specific node in a RAC

cluster.

If you wish to preview a failure action, you can use the
repair failure preview
command. This command will display the repair actions to be applied, but not execute the repair itself.

The change failure Command
The RMAN
change
command now has a new
failure
keyword that allows you to change the status of failures detected by the Oracle Database. For example, you can change the priority of a specific failure, or change all failures from high to low. You can also opt to close one or more failures. By default, RMAN will prompt you to ensure that you wish to make the change. You can use the
noprompt
clause of the
change
command to force the

302
Part II: Setup Principles and Practices

change to occur without prompting. Here is an example where we change the priority of failure 187 to LOW:

RMAN> Change failure 187 priority low;

List of Database Failures

Failure ID Priority Status Time Detected Summary

---------- -------- --------- ------------- -------

BOOK: Oracle RMAN 11g Backup and Recovery
6.93Mb size Format: txt, pdf, ePub
ads

Other books

Bliss by Kathryn Littlewood
Once Upon a Cowboy by Maggie McGinnis
Virulent: The Release by Shelbi Wescott
Crave by Bonnie Bliss
Pendant of Fortune by Gold, Kyell
Keep Me in the Dark by Ashe, Karina
Temptations Box Set books 1 & 2 by Adams, Kristin Michelle
Spoonwood by Ernest Hebert
Hostage Midwife by Cassie Miles