Data Aging from the RMAN Command Line for Oracle

You can manage Oracle backup data retention by using the RMAN retention policy instead of the CommCell Console data aging. You must perform the following procedures to use RMAN for data aging.

  1. Set the CommCell Console storage policy to have infinite retention when you use the RMAN retention.

  2. Specify the RMAN retention criteria with the CONFIGURE RETENTION POLICY command. See Setting the Oracle RMAN Retention Policy.

  3. Set the Disable RMAN External Pruning parameter to a value of 0 to allow the deletion of the archive files when you use external RMAN scripts to clean up the backup pieces. For information on how to configure the parameter, see Media Management Configuration: Data Aging.

You can configure an Oracle RMAN retention policy for each database. When RMAN retention rules are in effect, RMAN uses the criteria to determine which backup jobs comprising are obsolete and no longer needed for recovery.

Note

  • When Commvault manages retention, each copy of the storage policy has its own retention settings that are honored by Data aging. These settings are applied to all copies.

  • When a RMAN-based delete operation is performed, it basically deletes all copies.

  • If a compliance lock (WORM COPY) is enabled on any one of the copy associated with a plan or a storage policy, RMAN deletion on that storage policy or plan is not supported.

If you want to use the CommCell Console data aging feature, execute the following RMAN command, which disables the RMAN retention policy.

CONFIGURE RETENTION POLICY TO NONE

Oracle Crosschecks and Deleting Backup Pieces

You can use the RMAN CROSSCHECK BACKUP command to synchronize the RMAN repository with the records that are on the file system or the disk.

The command marks as EXPIRED the backup pieces that have entries in the RMAN repository, but do not have physical backup files in the file system or the disk.

The DELETE EXPIRED BACKUP command deletes backup pieces that are marked EXPIRED.

You can use an automatic channel, or allocate the channel for maintenance.

WARNING: The software might delete backup pieces when you run this command.

Use the following code snippets as examples.

To use a maintenance channel:

ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt PARMS="BLKSIZE=524288,SBT_LIBRARY=/opt/commvault/Base/libobk.so,ENV=(CvClientName=<client_name>,CvInstanceName=Instance001)"; CROSSCHECK BACKUP; delete backuppiece <bkppiece>; delete expired backup;

To use an automatic channel:

CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS "SBT_LIBRARY=/opt/commvault/Base/libobk.so,ENV=(CvInstanceName=Instance001,CvClientName=<client name>)"; run { CROSSCHECK BACKUP; delete backuppiece <bkppiece>; delete expired backup; }

Report Aged Backups

You can use the RMAN REPORT OBSOLETE command to see the list of backups RMAN considers no longer needed for recovery.

Note: Before you run the command, you must allocate a channel for maintenance.

Use the following script as an example.

allocate channel for maintenance device type  sbt PARMS="SBT_LIBRARY=/opt/commvault/Base/libobk.so"; 
 run{
 Report OBSOLETE;
 }

Delete Aged Backups

You can use the RMAN DELETE OBSOLETE command to delete all backups associated with the specified retention policy that are no longer needed for recovery. RMAN frees the disk or tape space associated with the deleted backup.

Note: Before you run the command, you must allocate a channel for maintenance.

Use the following script as an example.

allocate channel for maintenance device type  sbt  PARMS="SBT_LIBRARY=/opt/commvault/Base/libobk.so"; 
 run{
 DELETE OBSOLETE;
 }

In the example, the backup pieces in the last two backup cycles are kept and the rest are deleted from both the primary and secondary copies.

Aged RMAN backup pieces are permanently deleted from all copies.

Data Aging for Oracle

Retention Rules for Oracle

Data Aging from the CommCell Console

Data Aging

Loading...