News
Perth, Australia
+ (61) 417713124
prosolutions@gavinsoorma.com

RMAN Restore Validate Examples

  • Posted by Gavin Soorma
  • On November 20, 2009
  • 0 Comments

We can use the RMAN RESTORE VALIDATE command to check and verify the integrity of the backups which are stored on tapes or disk as well.

A point to keep in mind is that the RESTORE DATABASE VALIDATE command will only check for the datafile backups and will not check for either the archivelog of controlfile backups. We need to issue additional RESTORE ARCHIVELOG VALIDATE as well as RESTORE CONTROLFILE VALIDATE commands.

We can also issue the RESTORE SPFILE VALIDATE command to check the backup of the server parameter file. By default, RMAN only checks for physical corruption while validating. We can also instruct RMAN to check for logical corruption via the VALIDATE CHECK LOGICAL command.

The RESTORE DATABASE VALIDATE command will check for the last level 0 or FULL tape or disk based backup, but the RESTORE ARCHIVELOG ALL command will check for all the archivelog files catalogued based on the retention policy.

So when we are validating the restore of archivelog files, it may be better to check for the existence or accessibility in the tape library or disk of all the archivelog files which have been generated since the last full or level 0 backup.

For example if we are taking daily backups, we would like to check for all archivelog file backups for the past day using the command as shown below:

RMAN> restore archivelog from time ‘sysdate-1’ validate;

Some other examples of the VALIDATE command are:

RMAN> restore database validate;
RMAN> restore controlfile validate;
RMAN> restore spfile validate;
RMAN> restore tablespace users validate;
RMAN> validate backupset 922;
RMAN> validate recovery area;

An example is shown below where we are checking the validity of a database backup for a database which has a weekly level 0 backup. Note that the RESTORE DATABASE VALIDATE command will cause RMAN to check for the last level 0 backup which has been performed in this case on the 15th of November.

RMAN> restore database validate;

Starting restore at 20-NOV-09
using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1

channel ORA_SBT_TAPE_1: starting validation of datafile backup set
channel ORA_SBT_TAPE_1: reading from backup piece vnkud0k5_1_1
channel ORA_SBT_TAPE_1: piece handle=vnkud0k5_1_1 tag=TAG20091115T060908
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: validation complete, elapsed time: 00:14:15
Finished restore at 20-NOV-09

RMAN> list backup of database tag TAG20091115T060908;

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
3054 Incr 0 15.59G SBT_TAPE 00:39:00 15-NOV-09
BP Key: 3054 Status: AVAILABLE Compressed: NO Tag: TAG20091115T060908
Handle: vnkud0k5_1_1 Media:
List of Datafiles in backup set 3054
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
1 0 Incr 23674579905 15-NOV-09 /u04/oradata/emrep/system01.dbf
2 0 Incr 23674579905 15-NOV-09 /u04/oradata/emrep/undotbs01.dbf
3 0 Incr 23674579905 15-NOV-09 /u04/oradata/emrep/sysaux01.dbf
4 0 Incr 23674579905 15-NOV-09 /u04/oradata/emrep/users01.dbf
5 0 Incr 23674579905 15-NOV-09 /u04/oradata/emrep/mgmt.dbf
6 0 Incr 23674579905 15-NOV-09 /u04/oradata/emrep/mgmt_ecm_depot1.dbf
7 0 Incr 23674579905 15-NOV-09 /u04/oradata/emrep/patrol01.dbf

Let us simulate the case where an archivelog is not present on disk and hence the validate will fail as shown below.

[PROD] emrep:/u05/oradata/emrep/arch > mv arch18053.1.669202302.log arch18053.1.669202302.log.old
[PROD] emrep:/u05/oradata/emrep/arch > rman target /

Recovery Manager: Release 11.1.0.6.0 – Production on Fri Nov 20 12:23:31 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: EMREP (DBID=3892233981)

RMAN> restore archivelog from time ‘sysdate-1’ validate;

Starting restore at 20-NOV-09
using target database control file instead of recovery catalog
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=261 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.4.1.0
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=221 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/20/2009 12:23:37
RMAN-06026: some targets not found – aborting restore
RMAN-06025: no backup of archived log for thread 1 with sequence 18053 and starting SCN of 23679034351 found to restore

 

0 Comments

Leave Reply

Your email address will not be published. Required fields are marked *