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:
- Reads your current retention policy configuration
- Compares all existing backups against this policy
- Identifies backups that exceed the retention requirements
- 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 DBIDhas been run - Run
CROSSCHECKfirst 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
- Run regular reports: Check for obsolete backups on a fixed schedule to manage storage
- Crosscheck first: Run a crosscheck before reporting so the repository reflects files deleted outside RMAN
- Review before deleting: Verify the list of obsolete backups before deletion
- Configure appropriate retention: Set retention policies that match your recovery requirements
- 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;
Related Commands
DELETE OBSOLETE: Removes obsolete backups identified by the reportLIST BACKUP: Shows all available backupsCROSSCHECK BACKUP: Verifies physical backup files match catalog recordsCONFIGURE RETENTION POLICY: Sets the retention policyREPORT NEED BACKUP: Shows files needing backup
References
- Reporting on RMAN Operations - Oracle Help Center - Official Oracle documentation covering RMAN reporting commands including detailed syntax and examples for the REPORT OBSOLETE command
- RMAN Expired vs Obsolete Backups - DBA Genesis Support - Clear explanation of the difference between expired and obsolete backups with practical DBA actions
- REPORT - Oracle Database Backup and Recovery Reference 23 - What REPORT OBSOLETE lists, its connection prerequisites, and the error when the retention policy is NONE
- CONFIGURE - Oracle Database Backup and Recovery Reference 23 - REDUNDANCY and RECOVERY WINDOW policies, the REDUNDANCY 1 default, and automatic deletion of obsolete files in the fast recovery area
- RMAN Backup Concepts - Oracle Database Backup and Recovery User's Guide 19 - How a recovery window decides which backups are obsolete, and obsolete versus expired
- Maintaining RMAN Backups and the Repository - Oracle Database Backup and Recovery User's Guide 19 - What a crosscheck updates and how expired records are removed
Posts in this series
- How to Create Oracle RMAN Recovery Catalog Step by Step
- How to Register an Oracle Database with RMAN Catalog
- Oracle RMAN Unregister Database from Recovery Catalog
- Oracle RMAN Reset Database After RESETLOGS Recovery
- Oracle RMAN CROSSCHECK BACKUP Command Explained
- Oracle RMAN Resync Catalog Command Guide
- Oracle RMAN: Delete Backup Pieces with Manual Channel
- Oracle RMAN Database Backup Commands Guide
- Oracle RMAN Database Restore and Recovery Guide
- Delete Archive Log Older Than 5 Days in Oracle RMAN
- Oracle RMAN Crosscheck Archivelog - Fix RMAN-06059 Error
- Oracle RMAN List Backupset Command Guide
- Oracle RMAN List Backup of Database Command
- List Backup of Archivelog All: Oracle RMAN Command Guide
- Oracle RMAN Report Obsolete Command Guide
- Oracle RMAN Report Obsolete Redundancy Command Guide
- Oracle RMAN Delete Obsolete - Remove Unneeded Backups
- Oracle RMAN RESTORE DATABASE VALIDATE Backup Check
- Oracle RMAN REPORT SCHEMA Command: Display Database Files
- Oracle RMAN Delete Expired Backup: Repository Cleanup
- LIST BACKUPSET OF DATABASE: Oracle RMAN Command Guide
- Oracle RMAN Delete Obsolete Backups with Maintenance Channel
- Find Oracle Archive Logs Older Than N Days with find -mtime
- Audit RMAN Backup Job History with V$RMAN_BACKUP_JOB_DETAILS