Oracle RMAN: Basic Operations for LIST, REPORT, and DELETE

English

Oracle Recovery Manager (RMAN) is a powerful standard tool for managing database backup and recovery. This article provides a detailed explanation of essential RMAN commands (LIST, REPORT, and DELETE) used in operational management and the roles each command plays. By correctly using these functions, you can accurately understand your backup status and efficiently manage storage capacity.

Conclusion: Shortest Procedure for RMAN Management

The standard flow for checking and cleaning up backup status in RMAN is as follows:

  • LIST: Check what backups currently exist.
  • REPORT: Analyze whether there are any missing or unnecessary backups based on the recovery policy.
  • DELETE: Physically and logically delete unnecessary backups based on the analysis results.

Background and Basics

RMAN manages backup information in the “control file” or a “recovery catalog.”

  • LIST: Displays recorded information as a simple “list.”
  • REPORT: Outputs “analysis results” compared against a retention policy (e.g., how many days of backups to keep).

Note for Beginners

It is easy to remember it this way: “LIST” is the task of checking the inventory, while “REPORT” is the task of diagnosing whether “recovery is possible under the current backup regime.”


RMAN Command Execution Procedures and Implementation

Below are examples and detailed descriptions of each command.

Prerequisites

  • Target OS: Common to Linux / Windows
  • Privileges: User with SYSDBA or SYSBACKUP privileges
  • Environment: In a CDB/PDB configuration, switch using set container as necessary, or execute from the root (CDB$ROOT).

1. LIST Command: Displaying Backup Information

This command is used to check the metadata of backups and copies that have already been taken.

1.1 Checking Backup Sets (LIST BACKUP)

Description: Lists information about backup sets and backup pieces for the database, control files, archived logs, etc. This helps identify when, which files, and where they were backed up.

# Display details of backup sets (completion time, size, device type, etc.)
RMAN> LIST BACKUP;

1.2 Checking Image Copies (LIST COPY)

Description: Displays information regarding image copies (replications as OS files) of data files, control files, and archived logs created with the BACKUP AS COPY command.

# Display information for files obtained as image copies
RMAN> LIST COPY;

1.3 Displaying Archived Logs by Range (LIST ARCHIVELOG)

Description: Searches for and displays archived logs that have been backed up or exist on disk. You can narrow down the check to a specific period.

# Display a list of archived logs generated in the past 1 day
RMAN> LIST ARCHIVELOG FROM TIME 'SYSDATE-1';
RMAN> LIST ARCHIVELOG FROM TIME 'SYSDATE-1';

using target database control file instead of recovery catalog
List of Archived Log Copies for database with db_unique_name V19
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - --------
1       1    13      A 25-03-03
        Name: /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_13_1153872185.ddf

2       1    14      A 25-03-03
        Name: /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_14_1153872185.dbf

3       1    15      A 25-03-03
        Name: /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_15_1153872185.dbf

4       1    16      A 25-03-03
        Name: /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_16_1153872185.dbf

5       1    17      A 25-03-03
        Name: /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_17_1153872185.dbf

6       1    18      A 25-03-03
        Name: /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_18_1153872185.dbf

2. REPORT Command: Analyzing Backup Status

These are analysis and diagnostic commands useful when you want to know “how things are currently doing.”

2.1 Identifying Missing Backups (REPORT NEED BACKUP)

Description: Identifies data files that require additional backups to satisfy the configured “retention policy.”

# Identify files that need backup according to the current retention policy
RMAN> REPORT NEED BACKUP;

# Check for files missing to guarantee a 7-day recovery window
RMAN> REPORT NEED BACKUP RECOVERY WINDOW OF 7 DAYS;

2.2 Identifying Unnecessary Backups (REPORT OBSOLETE)

Description: Lists backups that have exceeded the retention policy limit and are no longer needed for recovery (obsolete backups).

# List items judged as "OBSOLETE" after exceeding the retention period
RMAN> REPORT OBSOLETE;

2.3 Checking Database Configuration (REPORT SCHEMA)

Description: Displays the current file configuration within the database (tablespace names, filenames, sizes, etc.).

# List current data file placement information
RMAN> REPORT SCHEMA;

3. DELETE Command: Deleting Unnecessary Backups

This command is used to physically delete unnecessary files and remove them from the management information.

3.1 Deleting Obsolete Backups (DELETE OBSOLETE)

Description: Actually deletes the backup files judged as “obsolete” by REPORT OBSOLETE.

-- Delete unnecessary backups based on the recovery policy (requires confirmation)
RMAN> DELETE OBSOLETE;

Example Execution Result:

RMAN> DELETE OBSOLETE;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           1      25-03-03
  Backup Piece       1      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/013je945_1_1_1
Archive Log          1      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_12_1153872185.dbf
Backup Set           2      25-03-03
  Backup Piece       2      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-2957249400-20250303-00
Archive Log          2      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_13_1153872185.dbf
Archive Log          3      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_14_1153872185.dbf
Archive Log          4      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_15_1153872185.dbf
Archive Log          5      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_16_1153872185.dbf
Archive Log          6      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_17_1153872185.dbf
Archive Log          7      25-03-03           /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_18_1153872185.dbf

Do you want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/013je945_1_1_1 RECID=1 STAMP=1194796165
deleted archived log
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_12_1153872185.dbf RECID=1 STAMP=1194796918
deleted backup piece
backup piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-2957249400-20250303-00 RECID=2 STAMP=1194796190
deleted archived log
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_13_1153872185.dbf RECID=2 STAMP=1194796927
deleted archived log
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_14_1153872185.dbf RECID=3 STAMP=1194796930
deleted archived log
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_15_1153872185.dbf RECID=4 STAMP=1194796933
deleted archived log
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_16_1153872185.dbf RECID=5 STAMP=1194796936
deleted archived log
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_17_1153872185.dbf RECID=6 STAMP=1194796939
deleted archived log
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_18_1153872185.dbf RECID=7 STAMP=1194796942
Deleted 9 objects

3.2 Deletion Without Confirmation (NOPROMPT)

Description: Executes deletion while omitting the confirmation message (YES/NO). This option is essential when automating with shell scripts or batch processing.

# Immediately delete obsolete backups without a confirmation prompt
RMAN> DELETE NOPROMPT OBSOLETE;

Troubleshooting: Common ORA Errors

Error CodeCauseAction
ORA-19606Attempted to delete a file protected by the retention policy.Confirm if the target is truly unnecessary; if so, remove the KEEP attribute or use the FORCE option.
ORA-19633Mismatch between management info in the control file and the physical file status.Execute CROSSCHECK, change the status of missing physical files to EXPIRED, then execute DELETE EXPIRED.

Operational Precautions

  • Risk: The DELETE command removes physical files. To prevent accidental operations, it is highly recommended to always run REPORT OBSOLETE first to visually confirm the targets for deletion.
  • Recovery: Files deleted by RMAN generally cannot be recovered. Restoring from storage-side snapshots or external backups is required.
  • Read-only First: Develop the habit of checking the current “snapshot” with LIST or REPORT before making operational changes.

FAQ: Frequently Asked Questions

Q: What is the difference between DELETE OBSOLETE and DELETE EXPIRED?

A: OBSOLETE refers to items that are no longer needed according to the policy. EXPIRED refers to management information where the physical file could not be found as a result of a CROSSCHECK.

Q: How do I change the retention policy?

A: Use the CONFIGURE RETENTION POLICY TO... command.

Q: Can I delete only a specific backup set?

A: Yes, you can perform a specific deletion with DELETE BACKUPSET <key_number>;.


Summary

  • LIST directly checks the backup inventory.
  • REPORT performs “analysis/diagnosis” against the retention policy.
  • DELETE removes unnecessary backups to secure capacity.
  • Use the NOPROMPT option for automation.

This article is explained for Oracle Database 19c (screens and default values may differ for other versions).

[reference]
Oracle Database Backup and Recovery Reference, 19c

コメント

Copied title and URL