Oracle RMAN 11g Backup and Recovery (135 page)

Chapter 16: Maintaining RMAN
401

it becomes available again (for example, after the recovery of a failed disk drive), then the
crosscheck
command will return that piece’s status to AVAILABLE.

You must be connected to a target database to run the
crosscheck
command. There is no requirement to be connected to a recovery catalog. If your backups are on disk, you will not need to allocate a channel before issuing the
crosscheck
command. If you are backing up to a tape device (via MML, for example), then you will need to allocate a maintenance channel before you can issue the
crosscheck
command. This is not required if you have configured predefined channels. If you use mixed channels (some to disk and some to SBT, for example), then the
crosscheck
command will only check the backups that were made using the channel used during the backup.

In the following example of the execution of the
crosscheck
command, we are checking the status of all backup sets and determining whether they exist on the backup medium: RMAN> crosscheck backup;

using channel ORA DISK 1

crosschecked backup piece: found to be 'AVAILABLE'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/backupset/2009 09 08

/o1 mf annnn TAG20090908T025101 5bd6qydw .bkp RECID 2 STAMP 696999070

crosschecked backup piece: found to be 'AVAILABLE'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/backupset/2009 09 08

/o1 mf nnndf TAG20090908T025112 5bd6r0mz .bkp RECID 3 STAMP 696999072

crosschecked backup piece: found to be 'EXPIRED'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/backupset/2009 09 08

/o1 mf annnn TAG20090908T031112 5bd7xjo7 .bkp RECID 9 STAMP 697000272

Crosschecked 3 objects

In this example, we have crosschecked a total of four backup set pieces. Notice that the
crosscheck
command lists all the backup set pieces that were found to be available. It also lists those backup set pieces that were not found on the backup media, shows them to be EXPIRED, and sets their status to EXPIRED at the same time. Note that the
crosscheck
command will not change a backup set piece with a status of DELETE to AVAILABLE. Any backup marked with a status of DELETE cannot be changed.

You can also crosscheck datafile backups, tablespace backups, control file backups, and SPFILE backups. Additionally, you can be selective in the specific backup you want to crosscheck by identifying the tag associated with that backup. You can even crosscheck all backups taken based on the device used or based on a time period. The following are several examples of crosschecking backups:

crosscheck backup of datafile 1;

crosscheck backup of tablespace users;

crosscheck backup of controlfile;

crosscheck backup of spfile;

crosscheck backup tag 'SAT BACKUP';

crosscheck backup completed after 'sysdate - 2';

crosscheck backup completed between 'sysdate - 5' and 'sysdate - 2;

crosscheck backup device type sbt;

402
Part III: Using RMAN Effectively

The first example is a crosscheck of backups. As you might expect, you also can crosscheck archive log backups:

RMAN> crosscheck archivelog all;

released channel: ORA DISK 1

allocated channel: ORA DISK 1

channel ORA DISK 1: SID=36 device type=DISK

validation succeeded for archived log

archived log file

name=/oracle/app/oracle/flash recovery area/ROB1/archivelog/2009 09 08

/o1 mf 1 7 5bd8qq6g .arc RECID=10 STAMP=697001111

validation succeeded for archived log

archived log file

name=/oracle/app/oracle/flash recovery area/ROB1/archivelog/2009 09 08

/o1 mf 1 8 5bd8qr29 .arc RECID=11 STAMP=697001112

validation failed for archived log

archived log file

name=/oracle/app/oracle/flash recovery area/ROB1/archivelog/2009 09 08

/o1 mf 1 9 5bd8qv45 .arc RECID=12 STAMP=697001115

validation succeeded for archived log

archived log file name=/oracle/app/oracle/flash recovery area/ROB1/archivelog/2009 09 08

/o1 mf 1 10 5bd8rco9 .arc RECID=13 STAMP=697001131

Crosschecked 4 objects

You can crosscheck archived redo log backups based on a number of criteria, including time, SCN (specific or high/low range), or log sequence number. You can even use the
like
parameter, along with wildcards, to crosscheck specific archive log backups. Here are some variations in the
crosscheck
command:

crosscheck archivelog like 'ARC001.log';

crosscheck archivelog 'D:\ORACLE\ADMIN\RECOVER\ARCH\ARC00012.001';

crosscheck archivelog like '%ARC00012.001';

crosscheck archivelog from time "to date('01-10-2006', 'mm-dd-yyyy')"; crosscheck archivelog until time "to date('01-10-2006', 'mm-dd-yyyy')"; crosscheck archivelog from sequence 12;

crosscheck archivelog until sequence 522;

To crosscheck copies, use the
crosscheck copy
command. You can crosscheck datafile copies, control file copies, archived redo log copies, and archived redo logs (on disk). Here are two examples of crosschecking these kinds of objects:

crosscheck copy of datafile 5;

crosscheck datafilecopy 'd:\oracle\oradata\recover\recover users 01.dbf';
RMAN Workshop:
Using the crosscheck Command

Workshop Notes

This workshop assumes that you have a functional Oracle database running in ARCHIVELOG

mode. Additionally, this workshop assumes that you are backing up your database to disk, that you have a tablespace called USERS in your database, and that one datafile is associated with the USERS tablespace. Note that our sample output might look different than your output does.

Step 1.
Using RMAN, back up the USERS tablespace:

RMAN> backup tablespace users;

Chapter 16: Maintaining RMAN
403

Starting backup at 08-SEP-09

using channel ORA DISK 1

channel ORA DISK 1: starting full datafile backup set

channel ORA DISK 1: specifying datafile(s) in backup set

input datafile file number 00004 name /ora01/oracle/rob1/rob1/users01.dbf channel ORA DISK 1: starting piece 1 at 08-SEP-09

channel ORA DISK 1: finished piece 1 at 08-SEP-09

piece handle=/oracle/app/oracle/flash_recovery_area/ROB1/backupset/2009_09_08

/o1_mf_nnndf_TAG20090908T032848_5bd8yjmq_.bkp tag=TAG20090908T032848

comment=NONE

channel ORA DISK 1: backup set complete, elapsed time: 00:00:01

Finished backup at 08-SEP-09

Starting Control File and SPFILE Autobackup at 08-SEP-09

piece handle /oracle/app/oracle/flash recovery area/ROB1/autobackup/2009 09 08

/o1 mf s 697001330 5bd8ylgv .bkp comment NONE

Finished Control File and SPFILE Autobackup at 08-SEP-09

Step 2.
Look at the output of the backup, and determine the backup set piece that has just been created. The backup set piece is highlighted in the output in Step 1. Note that we are not removing the control file autobackup set piece.

Step 3.
Remove the backup piece from the disk.

Step 4.
Issue the
crosscheck
command to determine the status of the backup set piece. RMAN

will detect that the backup set piece has been removed and mark it EXPIRED. Note that the control file autobackup piece is still available.

RMAN> crosscheck backup;

using channel ORA DISK 1

crosschecked backup piece: found to be 'AVAILABLE'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/backupset/2009 09 08

/o1 mf annnn TAG20090908T025101 5bd6qydw .bkp RECID 2 STAMP 696999070

crosschecked backup piece: found to be 'AVAILABLE'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/backupset/2009 09 08

/o1 mf nnndf TAG20090908T025112 5bd6r0mz .bkp RECID 3 STAMP 696999072

crosschecked backup piece: found to be 'EXPIRED'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/backupset/2009 09 08

/o1 mf annnn TAG20090908T031112 5bd7xjo7 .bkp RECID 9 STAMP 697000272

crosschecked backup piece: found to be 'EXPIRED'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/backupset/2009 09 08

/o1 mf nnndf TAG20090908T032848 5bd8yjmq .bkp RECID 14 STAMP 697001328

crosschecked backup piece: found to be 'AVAILABLE'

backup piece

handle /oracle/app/oracle/flash recovery area/ROB1/autobackup/2009 09 08

/o1 mf s 697001330 5bd8ylgv .bkp RECID 15 STAMP 697001330

Crosschecked 5 objects

404
Part III: Using RMAN Effectively

Validation of RMAN Backups

RMAN provides the
validate
command, which allows you to examine a given backup set and verify that it can be restored. This command is similar to the
backup validate
command, with a few extra bells and whistles. With this command, you can choose which backup sets to verify, whereas the
validate
parameter of the
backup
or
restore
command allows RMAN to determine which backup set to validate. Typically, in a production environment, you would use the
backup
validate check logical
command after you have completed a backup to perform database validation.

Other books

I Dream of Zombies by Johnstone, Vickie
Rain Girl by Gabi Kreslehner
Come the Revolution by Frank Chadwick
The Prophecy by Desiree Deorto
Return to Poughkeepsie by Debra Anastasia
The Man Who Ate the 747 by Ben Sherwood