Databases Reference
In-Depth Information
The previous
crosscheck
command will search for all backups on all channels with the same device type as the
channel that was used to make the RMAN backups.
How It Works
The
crosscheck
command helps you update backup information about corrupted backups on disk and tape,
as well as any manually deleted archived redo logs or other backup files. For disk backups, the
crosscheck
command
validates the file headers, and for tape backups, it checks whether the backups are in the media management layer
(MML) catalog.
It's a good strategy to always first use the
list
command to see what backups you have and follow it up with the
crosscheck
command to make sure you really do have those backups. You can use the
delete expired
command to
remove RMAN repository data for all those backups that fail the checking performed by the
crosscheck
command.
The
crosscheck backup
command checks all backups on both disk and tape, provided you've already configured
an automatic channel for your tape backups. As you know, RMAN already comes with a single preconfigured disk
channel.
If you haven't configured an automatic sbt channel, you must allocate a maintenance channel within a
run
block
before you execute the
crosscheck
command, as shown here:
RMAN> allocate channel for maintenance device type sbt;
crosscheck backup;
Once you've configured an sbt channel through the
configure
command or manually allocated it through the
allocate channel
command shown previously, you can then check backups on both disk and tape with a single
crosscheck
command, as shown here:
RMAN> crosscheck backup;
There are three possible values for the status of a file following the execution of the
crosscheck
command—
available, unavailable, and expired.
When the
crosscheck
command fails to locate the backups and copies you're looking for on disk or tape (files
are absent or RMAN can't access them), it'll update the RMAN repository to show the backup record status for those
backups and copies as expired. You can then consequently use the
delete expired
command to delete the expired
backup records (metadata) from the RMAN repository. Thus, you use the following sequence of commands to delete
expired backups:
RMAN> crosscheck backup;
RMAN> delete expired backup;
The
crosscheck
command checks whether the backups still exist. The command checks backup sets,
proxy copies, and image copies. The
delete expired backup
command will delete the expired backups. Here's
another example:
RMAN> crosscheck backupset of tablespace users
device type sbt completed before 'sysdate-14';
RMAN> delete expired backupset of tablespace users
device type sbt completed before 'sysdate-14';
The
crosscheck
command checks the media manager for expired backups of the tablespace users, and the
delete
command removes their repository records.