Oracle RMAN Report Obsolete Command Guide

Oracle RMAN Report Obsolete Command

The REPORT OBSOLETE command in Oracle Recovery Manager (RMAN) helps database administrators identify backup files that are no longer required for recovery operations. This command compares existing backups against your configured retention policy and marks outdated backups as obsolete.

Code

1report obsolete;

Purpose

The REPORT OBSOLETE command serves a critical function in database backup management by identifying backups that can be safely removed The command does not delete any files automatically; it only marks files as obsolete based on your retention policy. This allows administrators to review which backups are no longer necessary before performing cleanup operations.

Breakdown of Code

Command Structure

The basic command consists of two simple words:

1REPORT OBSOLETE

REPORT: This is the main RMAN command that generates reports about backup operations and database schema.

OBSOLETE: This keyword tells RMAN to check which backups are no longer needed based on the current retention policy.

How the Command Works

When you execute report obsolete, RMAN performs the following actions:

  1. Reads your current retention policy configuration
  2. Compares all existing backups against this policy
  3. Identifies backups that exceed the retention requirements
  4. Displays a list of obsolete backup files

The retention policy determines what RMAN considers obsolete [web:133]. By default, the retention policy is set to redundancy 1, which means RMAN keeps at least one backup copy.

Key Points

  • The command only identifies obsolete backups; it does not delete them
  • Obsolete means "not needed for recovery" while expired means "not found on disk"
  • You must have SYSDBA or SYSBACKUP privileges to run this command
  • The command works with both recovery catalog and control file metadata
  • Running crosscheck before report obsolete ensures accurate results

Understanding Retention Policies

Redundancy-Based Policy

This policy keeps a specific number of backup copies:

1CONFIGURE RETENTION POLICY TO REDUNDANCY 2;

This configuration tells RMAN to keep two backup copies of each file.

Recovery Window-Based Policy

This policy keeps backups for a specific number of days:

1CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;

This marks backups older than 15 days as obsolete.

Advanced Usage Examples

Testing Different Retention Policies

You can check which backups would be obsolete under different policies without changing your configuration:

1REPORT OBSOLETE RECOVERY WINDOW OF 3 DAYS;
2REPORT OBSOLETE REDUNDANCY 1;

Checking Specific Pluggable Databases

For multitenant databases, you can check obsolete backups for individual PDBs:

1REPORT OBSOLETE OF PLUGGABLE DATABASE my_pdb;

Workflow for Managing Obsolete Backups

Step 1: Connect to Target Database

Start RMAN and connect to your target database:

1rman target /

Step 2: Run Crosscheck

Update the repository status before reporting:

1CROSSCHECK BACKUP;

Step 3: Report Obsolete Backups

Identify which backups are obsolete:

1REPORT OBSOLETE;

Step 4: Review the Output

The command displays a report showing:

  • Type of backup (datafile copy, backup set)
  • Key identifier
  • Completion time
  • File location or handle

Sample output:

1RMAN retention policy will be applied to the command
2RMAN retention policy is set to redundancy 1
3Report of obsolete backups and copies
4Type                 Key    Completion Time    Filename/Handle
5-------------------- ------ ------------------ --------------------
6Datafile Copy        44     08-FEB-13          /backup/ora_df549738566_s70_s1
7Backup Set           26     08-FEB-13
8Backup Piece         26     08-FEB-13          /backup/ora_df549738682_s76_s1

Step 5: Delete Obsolete Backups

After reviewing, delete the obsolete backups to free space:

1DELETE OBSOLETE;

Important Insights

Storage Management

If your Fast Recovery Area (FRA) becomes full, RMAN automatically overwrites obsolete backups. This intelligent feature prevents storage issues from affecting database operations.

Obsolete vs Expired

Understanding the difference is essential for proper backup management:

  • Obsolete: Backups not needed to meet recovery goals based on retention policy
  • Expired: Backups that exist in the catalog but cannot be found on disk or tape

Best Practices

  1. Run regular reports: Check for obsolete backups weekly or monthly to manage storage
  2. Crosscheck first: Always run crosscheck before reporting to ensure accurate status
  3. Review before deleting: Verify the list of obsolete backups before deletion
  4. Configure appropriate retention: Set retention policies that match your recovery requirements
  5. Document your policy: Keep records of your retention policy decisions

When to Use This Command

Use REPORT OBSOLETE in these situations:

  • Before performing backup cleanup operations
  • When storage space is running low
  • During regular maintenance windows
  • After changing retention policies
  • When auditing your backup strategy

Common Scenarios

Scenario 1: Full Backup Disk

Your backup disk is full and you need to identify files for removal:

1CROSSCHECK BACKUP DEVICE TYPE DISK;
2REPORT OBSOLETE;
3DELETE OBSOLETE;

Scenario 2: Policy Change

After changing your retention policy, see which additional backups become obsolete:

1CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
2REPORT OBSOLETE;

Scenario 3: Compliance Check

Verify that your backups meet compliance requirements:

1REPORT OBSOLETE RECOVERY WINDOW OF 30 DAYS;

Troubleshooting

No Obsolete Backups Found

If the command returns no obsolete backups, possible reasons include:

  • Retention policy set to NONE
  • All backups are within the retention window
  • No backups exist in the repository

Error: Retention Policy Set to NONE

If retention policy is NONE, RMAN issues an error [web:133]. Configure a retention policy first:

1CONFIGURE RETENTION POLICY TO REDUNDANCY 1;

Performance Considerations

The REPORT OBSOLETE command reads metadata from the control file or recovery catalog. For large environments with many backups, this operation may take several minutes. Running the command during low-activity periods is recommended.

  • DELETE OBSOLETE: Removes obsolete backups identified by the report
  • LIST BACKUP: Shows all available backups
  • CROSSCHECK BACKUP: Verifies physical backup files match catalog records
  • CONFIGURE RETENTION POLICY: Sets the retention policy
  • REPORT NEED BACKUP: Shows files needing backup

References

Posts in this series