Disclaimer

Saturday, 23 November 2024

VALIDATE Vs CROSSCHECK command in RMAN

RMAN always maintains metadata about backups in the control file of every target database on which it performs operations. 

If you use RMAN with a recovery catalog, then RMAN also maintains the metadata from every registered database in the recovery catalog.

Now let's discuss Validate Vs Crosscheck:-

1. VALIDATE Command

  • Purpose: Verifies the integrity of database files or backups to ensure they are readable and usable for recovery.
  • Use Cases:
    • To check if a backup is complete and consistent.
    • To verify whether a datafile or archive log can be backed up or restored.
  • Checks Performed:
    • Ensures that all blocks in the files can be read without errors.
    • Verifies checksum (if enabled) and block corruption.
  • Does Not Update RMAN Repository: This command does not make any changes to the RMAN catalog or control file.
  • Example:
    RMAN> VALIDATE BACKUPSET 10;
    RMAN> VALIDATE DATAFILE 1,2,3; RMAN> VALIDATE DATABASE;
    Output will show the status of blocks and identify corrupted or inaccessible files.

Summary:-

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.




2. CROSSCHECK Command

  • Purpose: Ensures the RMAN repository is synchronized with the actual physical backups stored on disk or tape.

  • Use Cases:
    • To identify backups that are missing or have been manually deleted outside RMAN.
    • To remove obsolete or unavailable backup metadata from the RMAN repository.

  • Checks Performed:
    • Compares the RMAN repository with the physical backup storage.
    • Marks backups as EXPIRED if they are not found in the storage location.

  • Updates RMAN Repository: This command updates the RMAN catalog or control file to reflect the current status of backups.

  • Example:
    RMAN> CROSSCHECK BACKUP;
    RMAN> CROSSCHECK ARCHIVELOG ALL;

Summary:-

If a backup is on disk, then CROSSCHECK determines whether the header of the file is valid. 

If a backup is on tape, then RMAN queries the RMAN repository for the names and locations of the backup pieces to be checked. 

RMAN sends this metadata to the target database server, which queries the media management software about the backups. 

The media management software then checks its media catalog and reports back to the server with the status of the backups.












No comments:

Post a Comment

How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...