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 lists the backups that the policy no longer needs.

Code

1report obsolete;

Purpose

The REPORT OBSOLETE command identifies backups that can be removed because the retention policy no longer needs them. The command does not delete any files; it only lists them. 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. By default, the retention policy is set to REDUNDANCY 1, which means RMAN retains one full or level 0 backup of each data file and control file (CONFIGURE reference).

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"
  • To report on a whole multitenant container database, connect to the root as a common user with the SYSDBA or SYSBACKUP privilege
  • RMAN must be connected to a target database, or to a recovery catalog after SET DBID has been run
  • Run CROSSCHECK first when files may have been removed outside RMAN; a crosscheck updates repository records that no longer match the files on disk

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 retain two full or level 0 backups of each data file and control file. If more exist, RMAN marks the extra, older ones as obsolete.

Recovery Window-Based Policy

This policy keeps backups for a specific number of days:

1CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 15 DAYS;

This does not make every backup older than 15 days obsolete. For each data file, RMAN keeps the most recent backup that is older than the point of recoverability (15 days ago), so you can still recover to any time in the window. Only backups older than that one are obsolete (About Backup Retention Policies).

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

When space is needed in the Fast Recovery Area (FRA), RMAN automatically deletes obsolete backup sets and copies stored there. It does not delete obsolete files outside the FRA; for those you must run DELETE OBSOLETE yourself.

Obsolete vs Expired

  • Obsolete: Backups not needed for recovery under the retention policy
  • Expired: Backups that a crosscheck could not find on disk or tape

Best Practices

  1. Run regular reports: Check for obsolete backups on a fixed schedule to manage storage
  2. Crosscheck first: Run a crosscheck before reporting so the repository reflects files deleted outside RMAN
  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

See which backups would be obsolete under a 30-day window, without changing the configured policy:

1REPORT OBSOLETE RECOVERY WINDOW OF 30 DAYS;

Troubleshooting

No Obsolete Backups Found

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

  • All backups are within the retention window
  • No backups exist in the repository

Error: Retention Policy Set to NONE

If the retention policy is NONE, RMAN does not consider any backups obsolete, so it issues an error when you run REPORT OBSOLETE with no other options (REPORT reference). Configure a retention policy first, or name a policy in the command:

1CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
  • 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