Oracle® Database Backup and Recovery Reference 11g Release 2 (11.2) Part Number E10643-01 |
|
|
View PDF |
Purpose
Use the VALIDATE
command to check for corrupt blocks and missing files, or to determine whether a backup set can be restored.
If VALIDATE
detects a problem during validation, then RMAN displays it and triggers execution of a failure assessment. If a failure is detected, then RMAN logs it into the Automated Diagnostic Repository. You can use LIST
FAILURE
to view the failures.
Prerequisites
The target database must be mounted or open.
Usage Notes
The options in the VALIDATE
command are semantically equivalent to options in the BACKUP
VALIDATE
command. Unlike BACKUP VALIDATE
, however, VALIDATE
can check individual backup sets and data blocks.
The VALIDATE
command skips never-used blocks. RMAN also skips currently unused (as opposed to never used) blocks for locally managed tablespaces when the COMPATIBLE
parameter is set to 10.2 or greater. If RMAN does not read a block because of unused block compression, and if the block is corrupt, then RMAN does not detect the corruption. A corrupt unused block is not harmful.
In a physical corruption, the database does not recognize the block at all. In a logical corruption, the contents of the block are logically inconsistent. By default, the VALIDATE
command checks for physical corruption only. You can specify CHECK LOGICAL
to check for logical corruption as well. RMAN populates the V$DATABASE_BLOCK_CORRUPTION
view with its findings.
Block corruptions can be divided into interblock corruption and intrablock corruption. In intrablock corruption, the corruption occurs within the block itself and can be either physical or logical corruption. In interblock corruption, the corruption occurs between blocks and can only be logical corruption. The VALIDATE
command checks for intrablock corruptions only.
Syntax
validate::=
(validateObject::=, validateOperand::=)
(archivelogRecordSpecifier::=, copyOfSpec::=, blockObject::=, datafileCopySpec::=, datafileSpec::=)
copyOfSpec::=
blockObject::=
(deviceSpecifier::=, sizeSpec::=, skipSpec::=)
skipSpec::=
Semantics
This subclause specifies backup sets for validation. Refer to validate::= for syntax.
Syntax Element | Description |
---|---|
validateOperand |
Specifies options that control the validation.
See Also: |
validateObject |
Specifies the files to be validated.
See Also: |
INCLUDE CURRENT CONTROLFILE |
Creates a snapshot of the current control file and validates it. |
PLUS ARCHIVELOG |
Includes archived redo log files in the validation. Causes RMAN to perform the following steps:
|
This subclause specifies database files for validation. Refer to validateObject::= for syntax.
Syntax Element | Description |
---|---|
archivelogRecordSpecifier |
Validates a range of archived redo log files. VALIDATE ARCHIVELOG is equivalent to BACKUP VALIDATE ARCHIVELOG . |
BACKUPSET primary_key |
Checks that the backup sets specified by primary_key exist and can be restored.
You can obtain the primary keys of backup sets by executing a The Use If you do not have automatic channels configured, then manually allocate at least one channel before executing Note: If multiple copies of a backup set exist, then RMAN validates only the most recent copy. The |
CONTROLFILECOPY {' filename ' | ALL | LIKE ' string_pattern '} |
Validates control file copies. You can specify a control file copy in one of the following ways:
The control file copy can be created with the |
copyOfSpec |
Validates image copies of datafiles and control files.
See Also: |
blockObject |
Validates individual data blocks.
See Also: |
CURRENT CONTROLFILE |
Validates the current control file. |
DATABASE |
Validates the database.
RMAN validates all datafiles and control files. If the database is currently using a server parameter file, then RMAN validates the server parameter file. Note: The online redo log files and tempfiles are not validated. |
datafileCopySpec |
Validates one or more datafile image copies.
When validating datafile copies, RMAN checks for block corruption but does not terminate the validation if corruption is discovered. Unlike See Also: |
DATAFILE datafileSpec |
Specifies a list of one or more datafiles that contain blocks requiring validation.
Note: You do not have to take a datafile offline if you are validating it. See Also: |
RECOVERY AREA |
Validates recovery files created in the current and all previous fast recovery area destinations. Recovery files are full and incremental backup sets, control file autobackups, archived redo log files, and datafile copies. Flashback logs, the current control file, and online redo logs are not validated. |
DB_RECOVERY_FILE_DEST |
Semantically equivalent to RECOVERY AREA . |
RECOVERY FILES |
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 datafile copies. Flashback logs are not validated. |
SPFILE |
Validates the server parameter file currently used by the database. RMAN cannot validates other copies of the server parameter file, and cannot validate the server parameter file when the instance was started with an initialization parameter file. |
TABLESPACE tablespace_name |
Validates the specified tablespaces. RMAN translates tablespace names internally into a list of datafiles, then validates all datafiles that are currently part of the tablespaces. RMAN validates all datafiles that are currently members of the specified tablespaces. |
This subclause specifies modifiers for the validation. Refer to validateOperand::= for syntax.
Syntax Element | Description |
---|---|
CHECK LOGICAL |
Tests data and index blocks in the files that pass physical corruption checks for logical corruption, for example, corruption of a row piece or index entry. If RMAN finds logical corruption, then it logs the block in the alert log and server session trace file. The RMAN command completes and V$DATABASE_BLOCK_CORRUPTION is populated with corrupt block ranges.
Note: |
DEVICE TYPE deviceSpecifier |
Allocates automatic channels for the specified device type only. This option is valid only if you have configured automatic channels and have not manually allocated channels. For example, if you configure automatic disk and tape channels, and run VALIDATE ...DEVICE TYPE DISK , RMAN allocates only disk channels.
See Also: |
NOEXCLUDE |
When specified on a VALIDATE DATABASE or VALIDATE COPY OF DATABASE command, RMAN validates all tablespaces, including any for which a CONFIGURE EXCLUDE command has been entered. This option does not override SKIP OFFLINE or SKIP READONLY . |
SECTION SIZE sizeSpec |
Parallelizes the validation by dividing each file into the specified section size.
Only specify this parameter when multiple channels are configured or allocated and you want the channels to parallelize the validation, so that multiple channels can validate a single datafile. This parameter applies only when validating datafiles. If you specify a section size that is larger than the size of the file, then RMAN does not parallelize validation for the file. If you specify a small section size that would produce more than 256 sections, then RMAN increases the section size to a value that results in exactly 256 sections. See Also: |
skipSpec |
Excludes the specified files from the validation. |
This subclauses specifies files to be excluded from the validation.
VALIDATE Command Output
Column | Indicates |
---|---|
|
Absolute number of the datafile being validated. |
|
|
|
Number of blocks marked corrupt. These blocks were previously marked corrupt by the database. For example, the database may intentionally mark blocks corrupt during a recovery involving a |
|
Number of blocks that either have never been used. |
|
Total number of blocks in the file. |
|
The highest SCN recorded in the file. |
|
The name of the file being validated. |
|
The type of block validated: |
|
The number of blocks that fail the corruption check. These blocks are newly corrupt. |
|
The number of blocks checked for corruption. |
Table 3-12 List of Control File and SPFILE
Column | Indicates |
---|---|
|
Type of file: |
|
|
|
The number of blocks that fail the corruption check. These blocks are newly corrupt. |
|
Total number of blocks in the file. |
Table 3-13 List of Archived Logs
Column | Indicates |
---|---|
|
The redo thread number. |
|
The log sequence number. |
|
|
|
The number of blocks that fail the corruption check. These blocks are newly corrupt. |
|
Total number of blocks in the file. |
|
The name of the archived redo log file. |
Example 3-65 Validating a Backup Set
This example lists all available backup sets and then validates them. As the sample output indicates, RMAN confirms that it is possible to restore the backups.
RMAN> LIST BACKUP SUMMARY; List of Backups =============== Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag ------- -- -- - ----------- --------------- ------- ------- ---------- --- 3871 B F A DISK 08-MAR-07 1 1 NO TAG20070308T092426 3890 B F A DISK 08-MAR-07 1 1 NO TAG20070308T092534 RMAN> VALIDATE BACKUPSET 3871, 3890; Starting validate at 08-MAR-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /disk2/PROD/backupset/2007_03_08/o1_mf_nnndf_TAG20070308T092 426_2z0kpc72_.bkp channel ORA_DISK_1: piece handle=/disk2/PROD/backupset/2007_03_08/o1_mf_nnndf_TAG20070308T092426_2z0kpc72_.bkp ta g=TAG20070308T092426 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:18 channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /disk2/PROD/autobackup/2007_03_08/o1_mf_s_616670734_2z0krhjv_.bkp channel ORA_DISK_1: piece handle=/disk2/PROD/autobackup/2007_03_08/o1_mf_s_616670734_2z0krhjv_.bkp tag=TAG20070308T092534 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:00 Finished validate at 08-MAR-07
Example 3-66 Validating the Database
This example validates the database and includes sample output. The validation finds one corrupt block in datafile 1. The VALIDATE
output indicates that more information about the corruption can be found in the specified trace file.
RMAN> VALIDATE DATABASE; Starting validate at 26-FEB-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation input datafile file number=00001 name=/disk1/oradata/prod/system01.dbf input datafile file number=00002 name=/disk1/oradata/prod/sysaux01.dbf input datafile file number=00003 name=/disk1/oradata/prod/undotbs01.dbf input datafile file number=00004 name=/disk1/oradata/prod/cwmlite01.dbf input datafile file number=00005 name=/disk1/oradata/prod/drsys01.dbf input datafile file number=00006 name=/disk1/oradata/prod/example01.dbf input datafile file number=00007 name=/disk1/oradata/prod/indx01.dbf input datafile file number=00008 name=/disk1/oradata/prod/tools01.dbf input datafile file number=00009 name=/disk1/oradata/prod/users01.dbf channel ORA_DISK_1: validation complete, elapsed time: 00:01:25 List of Datafiles ================= File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 1 FAILED 0 4140 57600 498288 File Name: /disk1/oradata/prod/system01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 1 41508 Index 0 7653 Other 0 4299 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 2 OK 0 8918 20040 498237 File Name: /disk1/oradata/prod/sysaux01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 2473 Index 0 2178 Other 0 6471 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 3 OK 0 36 2560 498293 File Name: /disk1/oradata/prod/undotbs01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 2524 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 4 OK 0 1 1280 393585 File Name: /disk1/oradata/prod/cwmlite01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 1279 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 5 OK 0 1 1280 393644 File Name: /disk1/oradata/prod/drsys01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 1279 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 6 OK 0 1 1280 393690 File Name: /disk1/oradata/prod/example01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 1279 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 7 OK 0 1 1280 393722 File Name: /disk1/oradata/prod/indx01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 1279 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 8 OK 0 1 1280 393754 File Name: /disk1/oradata/prod/tools01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 1279 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN ---- ------ -------------- ------------ --------------- ---------- 9 OK 0 1272 1280 393785 File Name: /disk1/oradata/prod/users01.dbf Block Type Blocks Failing Blocks Processed ---------- -------------- ---------------- Data 0 0 Index 0 0 Other 0 8 validate found one or more corrupt blocks See trace file /disk2/oracle/log/diag/rdbms/prod/prod/trace/prod_ora_10609.trc for details channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation including current control file for validation including current SPFILE in backup set channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 List of Control File and SPFILE =============================== File Type Status Blocks Failing Blocks Examined ------------ ------ -------------- --------------- SPFILE OK 0 2 Control File OK 0 506 Finished validate at 26-FEB-07