As an Oracle backup and Recovery tool, Rman provides us with powerful capabilities. This includes the physical and logical detection of data files and the validity of backup files.
First of all. Take a look at Rman's detection of data files.
We know that when Rman backs up data, it reads the data into the read cache, and then writes the data from the read cache to the write cache and finally to the database. In the process from read cache to write cache, Rman will perform a physical consistency check (Db_block_checksum not true) and logical consistency check (using the check logical option). Like what:
Sql> Show parameter Db_blockname TYPE VALUE---------------------------------------------------------------- -------------db_block_buffers integer 0db_block_checking string falsedb_block_checksum string truedb_ Block_size
rman> backup tablespace test1; Starting backup at 2014-11-06 15:12:49using channel Ora_disk_1channel ora_disk_1:starting full datafile Backupsetchannel Ora_disk_1:specifying DataFile (s) in Backupsetinput datafile fno=00005 name=/home/app/oraten/oradata/oraten/ Test01.dbfchannel ora_disk_1:starting piece 1 at 2014-11-06 15:12:50rman-00571: ===================================== ======================rman-00569: =============== ERROR MESSAGE STACK follows ===============rman-00571: ============ ===============================================rman-03009:failure of Backup command on Ora_disk_1 channel at 11/06/ 15:12:51ora-19566:exceeded limit of 0 corrupt blocks for FILE/HOME/APP/ORATEN/ORADATA/ORATEN/TEST01.DBF
Sometimes we just want to verify that the data file can be backed up enough. Instead of having to do a real backup, this is where we can use the Validate command. Such as
rman> Backup validate database; Starting backup at 2014-11-06 15:14:23using channel Ora_disk_1channel ora_disk_1:starting full datafile Backupsetchannel Ora_disk_1:specifying DataFile (s) in Backupsetinput datafile fno=00001 name=/home/app/oraten/oradata/oraten/ System01.dbfinput datafile fno=00003 name=/home/app/oraten/oradata/oraten/sysaux01.dbfinput datafile fno=00002 name= /home/app/oraten/oradata/oraten/undotbs01.dbfinput datafile fno=00005 name=/home/app/oraten/oradata/oraten/ Test01.dbfinput datafile fno=00004 Name=/home/app/oraten/oradata/oraten/users01.dbfchannel ora_disk_1:backup Set Complete, elapsed Time:00:00:01channel ora_disk_1:starting full datafile backupsetchannel ora_disk_1:specifying Datafi Le (s) in backupsetincluding current control file in backupsetincluding current SPFILE in Backupsetchannel ora_disk_1:back Up set complete, elapsed time:00:00:03finished backup at 2014-11-06 15:14:27
Attention. There are no physical damage blocks found in test01.dbf,
personally, Rman simply reads the data file into the read cache. Without doing the following, that is to say, the function of the physical block is limited, but. We can use it to detect the readability and location of physical files.
Here are the descriptive narratives in the official documentation:
VALIDATE causes RMAN to scan the specified files and verify their contents, testing whether this file can is back Ed up. RMAN creates no output files. Use this
command periodically to check for physical and logical errors in database files.
Use the Validate command to verify the validity of the backup set, official documentation:
To examine a backup set and report whether it can be restored. RMAN scans all of the backup pieces in the specified backup sets and looks at the checksums to verify
The contents is intact so, the backup can be successfully restored if necessary. Use the This command if you suspect the one or more backup pieces in a backup set
Is missing or has been damaged. Use VALIDATE BACKUPSET to specify which backups to test; Use the VALIDATE option of the "RESTORE command to Let" RMAN
Choose which backups to validate. For validating image copies, run RESTORE VALIDATE from datafilecopy
Demo Sample:
Rman> Run {2> set maxcorrupt for datafile 5 to 2;3> backup database;}
Rman> Validate Backupset 84;using channel ora_disk_1channel ora_disk_1:starting validation of datafile Backupsetchann El ora_disk_1:reading from backup piece/home/app/oraten/flash_recovery_area/oraten/backupset/2014_11_06/o1_mf_ Nnndf_tag20141106t152820_b5p8ro7v_.bkpchannel ora_disk_1:restored backup Piece 1piece Handle=/home/app/oraten/flash _RECOVERY_AREA/ORATEN/BACKUPSET/2014_11_06/O1_MF_NNNDF_TAG20141106T152820_B5P8RO7V_.BKP tag= Tag20141106t152820channel ora_disk_1:validation complete, elapsed time:00:00:01
The validate command verifies the physical validity of the backup rather than the physical validity of the data block stored in the backup.
RESTORE ... PREVIEW
This command is a preview of the Restore command,
you can apply restore ... preview to any restore operation to create a detailed list of every backup To be used in the requested restore operation, as well as the necessary target SCN for recovery after the RESTORE operation is complete. this command accesses the rman repository To query the backup metadata, but does not actually read the backup files to ensure that they can be restored.
rman> Restore Database preview; Starting restore at 2014-11-06 15:44:28using channel ora_disk_1list of Backup sets===================bs Key Type LV Size Device Type Elapsed Time completion time-----------------------------------------------------------------8 4 full 551.76M DISK 00:00:18 2014-11-06 15:28:24 BP key:52 status:available Compressed: NO tag:tag20141106t152820 Piece Name:/home/app/oraten/flash_recovery_area/oraten/backupset/2014_11_06/o1_mf_nnnd F_TAG20141106T152820_B5P8RO7V_.BKP List of Datafiles in Backup set-File LV Type Ckp SCN Ckp time Name -------------------------------------------1 full 922948 2014-11-06 15:28:20/home/app/oraten/oradata/ora TEN/SYSTEM01.DBF 2 full 922948 2014-11-06 15:28:20/home/app/oraten/oradata/oraten/undotbs01.dbf 3 full 922948 2014-11-06 15:28:20/home/app/oraten/oradata/oraten/sysaux01.dbf 4 full 922948 2014-11-0615:28:20/HOME/APP/ORATEN/ORADATA/ORATEN/USERS01.DBF 5 full 922948 2014-11-06 15:28:20/home/app/oraten/oradata /oraten/test01.dbfarchive logs generated after SCN 922948 not found in Repositorymedia recovery start SCN is 922948Recover Y must be do beyond SCN 922948 to clear data files fuzzinessfinished restore at 2014-11-06 15:44:28
RECOVER ... TEST: Simulates the recover process in memory and does not perform a real recovery, which can be used to lift a problem in the discovery recovery. Note that the simulated recovery and normal recovery may encounter different problems.
A simulated recovery initiated with the RECOVER ... TEST command in RMAN or Sql*plus. A trial recovery applies redo in a by-similar to normal media recovery, but it never writes its changes to disk and it AL Ways rolls back its changes. Trial recovery occurs only in memory.
Trial Recovery lets you foresee what problems might occur if you were to continue with normal recovery. For problems caused by ongoing memory corruption, trial recovery and normal recovery can encounter different errors.
Validate Command---Rman for backup and reply verification