Home » Oracle » Oracle Database » How to use RMAN Crosscheck command

How to use RMAN Crosscheck command

In this post, we will learn about RMAN crosscheck command like rman crosscheck archivelog all, RMAN crosscheck backup etc

What is RMAN Crosscheck command

  • The RMAN crosscheck command is used to check the status of the backup, archivelog, etc from the RMAN repository with the location it is stored. If it is stored on a physical disk, it checks the status on the physical disk and if it is in the Tape location, it checks on it
  • If the backup/archivelog etc is not found there, it makes the status expire in the Repository
  • If the backup is on disk, then the CROSSCHECK command determines whether the header of the file is valid. If the backup is on tape, then the command simply checks that the backup exists
  • The possible status values for backups are AVAILABLE, UNAVAILABLE, and EXPIRED.
  • The CROSSCHECK command does not delete operating system files, and it does not remove RMAN repository records of backups that are not available at the time of the crosscheck. It only updates the repository records with the status of the backups
  • A maintenance channel is not required for a disk crosscheck. If you use a media manager and have not configured automatic channels for it, then you must run ALLOCATE CHANNEL FOR MAINTENANCE before CROSSCHECK.

RMAN Crosscheck backup

Here is the command to do a Crosscheck backup

rman target /
crosscheck backup:

The above will do a crosscheck for the backup on the disk and tapes if the automatic Tape channel is already configured.

See also  How to check all constraints on a table in Oracle

If the automatic Tape channel is not configured, we can do a crosscheck backup on tape using the below Run Block

RUN 
{
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
CROSSCHECK BACKUP;
}

we can other variations like

rman target /
CROSSCHECK BACKUP OF DATAFILE 1 COMPLETED AFTER 'SYSDATE-10';

RMAN crosscheck copy

The crosscheck copy command can be used to check the datafile copies. This is used disk base copies

rman target / 
crosscheck copy:

RMAN crosscheck archivelog all

We can use crosscheck archivelog all to match the status of archivelog in disk to the repository

rman target /  
crosscheck archivelog all:

If you have deleted the archivelog files using the Operating system command, then this will show those archives as expired in the above command

There can be other variations to this command as

rman target /
crosscheck archivelog completed after sysdate -5;

Also Reads
RMAN Backup Commands: Check out the RMAN Backup commands in this post. This is going to be very helpful for the person who is involved in backup and recovery
Oracle RMAN interview questions: Oracle RMAN Interview Questions are a must for Oracle DBAs looking for a change. Oracle Backup and recovery is one of the essential duties of Oracle DBA
Oracle DBA interview questions for experienced professionals: check out awesome Oracle DBA interview questions and answers to succeed in any Oracle database interviews. This will test your knowledge on various fronts
RMAN-06059: Check out how to resolve the RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
RMAN-20004: RMAN-20004 happens when a Database has been cloned and a connection is made from the clone to the Catalog using rman without changing the DBID of the clone,
RMAN Catalog Command: Check out this post on How to use RMAN Catalog Command, rman catalog start with, catalog the backup pieces on tape,rman catalog backup piece
How to delete the archive logs in Oracle: Visit this page to find out How to delete the archive logs in Oracle after backup, how to delete the expired archive log
https://docs.oracle.com/cd/B19306_01/backup.102/b14192/bkup007.htm

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top