Bugman ( RMAN ) validate restore “bug”
If you are using RMAN (BUGMAN) like I do then you probably used VALIDATE command.Validate command is used to verify integrity of backups
without performing backups etc.
There are some “issues” with validate command.Actually Oracle intentionally did it but nevertheless it can be potential problem if you do not pay attention to it.
Let me start with two validate command:
restore database validate and restore database validate check logical
First command validate physical backups while second command check logical corruption only.
If you are validating your backups using these commands then you are missing files needed for database recovery or archivelogs.
Restore database validate command only validates that all DATAFILES that can be restored.ARCHIVELOGS ARE NOT INCLUDED.
Archivelog files are used for recovery and this command does not validate them.
Simple scenario:
I will get database backup only:
RMAN> backup device type sbt tag ‘backup_demo’ database;
Starting backup at 26-AUG-09
using channel ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: starting full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/oracle/datafile/sysaux01.dbf
input datafile file number=00001 name=/oracle/datafile/system01.dbf
input datafile file number=00003 name=/oracle/datafile/undotbs01.dbf
input datafile file number=00004 name=/oracle/datafile/users01.dbf
channel ORA_SBT_TAPE_1: starting piece 1 at 26-AUG-09
channel ORA_SBT_TAPE_1: finished piece 1 at 26-AUG-09
piece handle=0aknlvog_1_1 tag=backup_demo comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
Finished backup at 26-AUG-09
Starting Control File and SPFILE Autobackup at 26-AUG-09
piece handle=c-1547588308-20090826-04 comment=API Version 2.0,MMS Version 8.1.3.0
Finished Control File and SPFILE Autobackup at 26-AUG-09
Then backup archivelogs:
RMAN> backup device type sbt tag ‘backup_demo’ archivelog all not backed up;
Starting backup at 26-AUG-09
current log archived
released channel: ORA_DISK_1
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=136 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
channel ORA_SBT_TAPE_1: starting archived log backup set
channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=4 STAMP=695923598
input archived log thread=1 sequence=2 RECID=5 STAMP=695923599
input archived log thread=1 sequence=3 RECID=6 STAMP=695923603
input archived log thread=1 sequence=4 RECID=7 STAMP=695923604
input archived log thread=1 sequence=5 RECID=8 STAMP=695923605
input archived log thread=1 sequence=6 RECID=9 STAMP=695923605
input archived log thread=1 sequence=9 RECID=12 STAMP=695926628
input archived log thread=1 sequence=10 RECID=13 STAMP=695926649
channel ORA_SBT_TAPE_1: starting piece 1 at 26-AUG-09
channel ORA_SBT_TAPE_1: finished piece 1 at 26-AUG-09
piece handle=0cknlvrq_1_1 tag=backup_demo comment=API Version 2.0,MMS Version 8.1.3.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-AUG-09
Starting Control File and SPFILE Autobackup at 26-AUG-09
piece handle=c-1547588308-20090826-05 comment=API Version 2.0,MMS Version 8.1.3.0
Finished Control File and SPFILE Autobackup at 26-AUG-09
and finaly run
RMAN> restore database validate;
Starting restore at 26-AUG-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=132 device type=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=170 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
channel ORA_SBT_TAPE_1: starting validation of datafile backup set
channel ORA_SBT_TAPE_1: reading from backup piece 0aknlvog_1_1
channel ORA_SBT_TAPE_1: piece handle=0aknlvog_1_1 tag=backup_demo
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: validation complete, elapsed time: 00:00:01
Finished restore at 26-AUG-09
Finished successfully!
or check for logical corruption:
RMAN> restore database validate check logical;
Starting restore at 26-AUG-09
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: starting validation of datafile backup set
channel ORA_SBT_TAPE_1: reading from backup piece 0aknlvog_1_1
channel ORA_SBT_TAPE_1: piece handle=0aknlvog_1_1 tag=backup_demo
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: validation complete, elapsed time: 00:00:03
Finished restore at 26-AUG-09
Now I will run validate command with PREVIEW option.
The PREVIEW option of the RESTORE command allows you to identify the backups required to complete a specific restore operation.
RMAN> restore database validate preview;
Starting restore at 26-AUG-09
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
6511 Full 1.22G SBT_TAPE 00:00:04 26-AUG-09
BP Key: 6514 Status: AVAILABLE Compressed: NO Tag: backup_demo
Handle: 0aknlvog_1_1 Media: /tape,0aknlvog_1_1
List of Datafiles in backup set 6511
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
1 Full 2471629 26-AUG-09 /oracle/datafile/system01.dbf
2 Full 2471629 26-AUG-09 /oracle/datafile/sysaux01.dbf
3 Full 2471629 26-AUG-09 /oracle/datafile/undotbs01.dbf
4 Full 2471629 26-AUG-09 /oracle/datafile/users01.dbf
List of Archived Log Copies for database with db_unique_name demo
=====================================================================
Key Thrd Seq S Low Time
——- —- ——- – ———
6556 1 9 A 26-AUG-09
Name: /oracle/flash_recovery_area/demo/archivelog/2009_08_26/o1_mf_1_9_59c8f4pl_.arc
6583 1 10 A 26-AUG-09
Name: /oracle/flash_recovery_area/demo/archivelog/2009_08_26/o1_mf_1_10_59c8fsqc_.arc
6669 1 11 A 26-AUG-09
Name: /oracle/flash_recovery_area/demo/archivelog/2009_08_26/o1_mf_1_11_59c8hhr2_.arc
Media recovery start SCN is 2471629
Recovery must be done beyond SCN 2471629 to clear datafile fuzziness
validation succeeded for backup piece
Finished restore at 26-AUG-09
Preview option will list datafiles and archivelogs files used for recovery process.
Just for test I will remove archivelog logseq 11:
rm /oracle/flash_recovery_area/demo/archivelog/2009_08_26/o1_mf_1_11_59c8hhr2_.arc
and the run
RMAN> restore database validate preview;
Starting restore at 28-AUG-09
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=120 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: WARNING: Oracle Test Disk API
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
8 Full 1.22G SBT_TAPE 00:00:04 26-AUG-09
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: BACKUP_demo.WORLD__082609040911
Handle: 0aknlvog_1_1 Media: /tape,0aknlvog_1_1
List of Datafiles in backup set 8
File LV Type Ckp SCN Ckp Time Name
—- — —- ———- ——— —-
1 Full 2471629 26-AUG-09 /oracle/datafile/system01.dbf
2 Full 2471629 26-AUG-09 /oracle/datafile/sysaux01.dbf
3 Full 2471629 26-AUG-09 /oracle/datafile/undotbs01.dbf
4 Full 2471629 26-AUG-09 /oracle/datafile/users01.dbf
using channel ORA_DISK_1
using channel ORA_SBT_TAPE_1
no backup of archived log for thread 1 with sequence 11 and starting SCN of 2471801 found to restore
List of Archived Log Copies for database with db_unique_name demo
=====================================================================
Key Thrd Seq S Low Time
——- —- ——- – ———
12 1 9 A 26-AUG-09
Name: /oracle/flash_recovery_area/demo/archivelog/2009_08_26/o1_mf_1_9_59c8f4pl_.arc
13 1 10 A 26-AUG-09
Name: /oracle/flash_recovery_area/demo/archivelog/2009_08_26/o1_mf_1_10_59c8fsqc_.arc
15 1 12 A 26-AUG-09
Name: /oracle/flash_recovery_area/demo/archivelog/2009_08_27/o1_mf_1_12_59gc0qsp_.arc
Media recovery start SCN is 2471629
Recovery must be done beyond SCN 2471629 to clear datafile fuzziness
validation succeeded for backup piece
Finished restore at 28-AUG-09
It will report missing archivelog.
Comments
3 Responses to “Bugman ( RMAN ) validate restore “bug””Trackbacks
Check out what others are saying...-
[...] Miladin Modrakovic-Bugman ( RMAN ) validate restore “bug” [...]
Thank you so much for this precious information.
thnaks for useful info