Validates all recovery files on disk, whether they are stored in the fast recovery area or other locations on disk. Recovery files include full and incremental backup sets, control file autobackups, archived redo log files, and data file copies. Flashback logs are not validated.The Oracle 12c Documentation for 12c RMAN VALIDATE says the same thing, that is that backup sets are included in the files to be validated. Clearly the intent seems to have been for this to work with VALIDATE RECOVERY FILES, but for some reason the fix was simply to disable the functionality. So, what can you use instead? Now the VALIDATE BACKUPSET command must be used to validate the backups. This is not nearly as convenient as simply issuing the VALIDATE RECOVERY FILES command, as VALIDATE BACKUPSET takes a mandatory argument, which is the primary key of the backup set. The documentation recommends using the LIST BACKUPSET command, but this is rather inconvenient as the keys must be parsed from report text as seen. [code lang="sql"] RMAN list backupset; List of Backup Sets ================== BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 1 Full 9.36M DISK 00:00:04 18-MAR-14 BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20140318T170034 Piece Name: /u01/app/oracle/rman/rman-db-02p3ggdi_1_1.bkup SPFILE Included: Modification time: 18-MAR-14 SPFILE db_unique_name: ORCL Control File Included: Ckp SCN: 1014016 Ckp time: 18-MAR-14 BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 2 Full 1.07G DISK 00:01:36 18-MAR-14 BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20140318T170212 Piece Name: /u01/app/oracle/rman/rman-db-03p3gggk_1_1.bkup List of Datafiles in backup set 2 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 1014604 18-MAR-14 /u02/app/oracle/oradata/orcl/system01.dbf 2 Full 1014604 18-MAR-14 /u02/app/oracle/oradata/orcl/sysaux01.dbf 3 Full 1014604 18-MAR-14 /u02/app/oracle/oradata/orcl/undotbs01.dbf 4 Full 1014604 18-MAR-14 /u02/app/oracle/oradata/orcl/users01.dbf 5 Full 1014604 18-MAR-14 /u02/app/oracle/oradata/orcl/example01.dbf BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 3 Full 9.36M DISK 00:00:02 18-MAR-14 BP Key: 3 Status: AVAILABLE Compressed: NO Tag: TAG20140318T170212 Piece Name: /u01/app/oracle/rman/rman-db-04p3ggjt_1_1.bkup SPFILE Included: Modification time: 18-MAR-14 SPFILE db_unique_name: ORCL Control File Included: Ckp SCN: 1014639 Ckp time: 18-MAR-14 [/code] This is fine for manually validating just a few files, but is really not a workable solution for programmatically validating backup sets. Fortunately there is a better method - just use the v$backup_set_details view. [code lang="sql"] 1 select session_key, session_recid, session_stamp, bs_key, recid 2 from v$backup_set_details 3* order by session_key 15:58:37 dev.jks.com - jkstill@js01 SQL / SESSION_KEY SESSION_RECID SESSION_STAMP BS_KEY RECID ----------- ------------- ------------- ---------- ---------- 469 469 842532214 106 106 469 469 842532214 107 107 469 469 842532214 105 105 3 rows selected. RMAN> validate backupset 105; Starting validate at 18-MAR-14 using channel ORA_DISK_1 channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fra/JS01/backupset/2014_03_18/o1_mf_nnndf_TAG20140318T125302_9lk90z0k_.bkp channel ORA_DISK_1: piece handle=/u01/app/oracle/fra/JS01/backupset/2014_03_18/o1_mf_nnndf_TAG20140318T125302_9lk90z0k_.bkp tag=TAG20140318T125302 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:07 Finished validate at 18-MAR-14 -- the same was done for BS_KEY values 106 and 107 [/code] It is usually a good idea to investigate when something is found to work differently than expected. It was certainly beneficial in this case, as I was developing code on 11.2.0.3 that would later run on 11.2.0.4. While that bit of code would not work as expected on 11.2.0.4, it would also not cause an error, and probably not be noticed until it caused a recovery problem. Using VALIDATE BACKUPSET is a workable solution, but not nearly as convenient as using VALIDATE RECOVERY FILES. Perhaps there will be a fix for it in future releases.
On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Recovering an Oracle Database with Missing Redo
Recovering an Oracle Database with Missing Redo
Mar 10, 2015 12:00:00 AM
14
min read
RMAN 12c : Say goodbye to your backup when dropping your PDB
RMAN 12c : Say goodbye to your backup when dropping your PDB
Feb 14, 2014 12:00:00 AM
6
min read
Table recovery with rman in Database 12c
Table recovery with rman in Database 12c
Sep 23, 2013 12:00:00 AM
12
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.