If the backup is not recoverable, then it is useless. RMAN provides a way to check database restore capabilities without having to restore the database, and provides several check options for the user.
1. Restore Preview command
This command lets you see which backup set the Rman uses to perform a specific recovery. This command lists the details of the backup set that you want to restore.
rman> Restore Database preview;
Start Restore in August-July-10
Using channel Ora_disk_1
Backup set list
===================
BS keyword type LV size device type after time completion time
------- ---- -- ---------- ----------- ------------ ----------
7 full 987.05M DISK 00:01:40 August-July-10
BP keywords: 7 status: AVAILABLE Compressed: NO mark: tag20100708t161959
Paragraph name: F:/backup/bl_07li9ipg_1_1.bak
List of data files in backup set 7
File LV type CKP SCN CKP time name
---- -- ---- ---------- ---------- ----
1 full 1041819 August-July -10 d:/app/administrator/oradata/bl/system01. Dbf
2 full 1041819 August-July -10 d:/app/administrator/oradata/bl/sysaux01. Dbf
3 Full 1041819 August-July -10 d:/app/administrator/oradata/bl/undotbs01. Dbf
4 full 1041819 August-July -10 d:/app/administrator/oradata/bl/users01. Dbf
5 full 1041819 August-July -10 d:/app/administrator/oradata/bl/bl01. Dbf
List of archived log copies of the database Db_unique_name for BL
=====================================================================
Keyword Line program column S time limit
------- ---- ------- - ----------
8 1 A August-July-10
Name: d:/archivelog/bl_arc0000000012_0723658881.0001
9 1 A August-July-10
Name: d:/archivelog/bl_arc0000000013_0723658881.0001
Media Restore start SCN is 1041819
Recovery range must exceed SCN 1041819 to clear data file ambiguity
Completed restore in August-July-10
2. Restore command with verify and check logical parameters
The RESTORE command provides some options for verifying that a database can be recovered and backed up effectively. First, you can use the Validate parameter of the backup command to enable Rman to check the backup to determine that the database is recoverable. When using the Validate option, Oracle checks the latest backup set used to recover the database to determine that the backup set is complete, and also checks all the data file copies and archived redo log backup sets that the operation needs to use, and determines that they are also intact. In addition, the Validate option performs a comprehensive validation operation on the backup set to ensure the integrity of these backups. The validation operation is not too long, and it is a way to ensure that the database is recoverable.
rman> Restore Database validate;
Start Restore in August-July-10
Using channel Ora_disk_1
Channel Ora_disk_1: Starting validating data file backup set
Channel Ora_disk_1: Reading backup fragment F:/backup/bl_07li9ipg_1_1.bak
Channel Ora_disk_1: Segment handle = F:/backup/bl_07li9ipg_1_1.bak Mark = tag20100708t161959
Channel Ora_disk_1: Backup Fragment 1 restored
Channel Ora_disk_1: Verification completed, when: 00:00:26
Completed restore in August-July-10
In addition, the check logical parameter of the RESTORE command allows you to more fully examine the latest backup set. This command allows Rman to check the backup of the database, if the backups are checked by physical corruption, and to check for logical corruption in the backed-up data and index segments. If a logical corruption is found, Oracle responds to the error using one of the following methods:
(1) If the Maxcorrupt parameter is set and the number of corruption during the restore check logic operation does not exceed this parameter value, Rman populates the list of corruption blocks in Oracle's v$database_block_corruption view.
(2) The operation terminates if the number of corruption during the restore check logical operation exceeds the Maxcorrupt parameter value.
By default, the Maxcorrupt parameter is set to 0, so any logical corruption can cause a failure to check the operation. The SET command allows you to modify the default Maxcorrupt parameter values, but you can only use this command within the scope of the run code block. In addition, the Maxcorrupt parameter is set separately for each data file, not for all data files.
Rman> Run
2> {
3> set maxcorrupt for datafile 1,2,3 to 10; --Set the 1,2,3datafile maxcorrupt to 10
4> Restore database check logical validate;
5>}
Executing command: SET MAX corrupt
Start Restore in August-July-10
Using channel Ora_disk_1