Oracle RMAN List Backup of Database Command

Oracle RMAN List Backup of Database Command

Purpose

The LIST BACKUP OF DATABASE command is an Oracle Recovery Manager (RMAN) command that displays the database backups recorded in the RMAN repository. This command helps database administrators verify backup availability, review backup history, and plan recovery operations by providing detailed information about all datafile backups for the target database.

Code

1list backup of database;

Breakdown of Code

The command consists of three main components that work together to query the RMAN repository:

  • LIST: The primary RMAN command that queries and displays backup metadata from the repository
  • BACKUP: Lists backup sets (with their backup pieces) and proxy copies. Image copies are listed by LIST COPY instead
  • OF DATABASE: Restricts the list to backups of the entire database's data files. Archived log backups need OF ARCHIVELOG, and the current control file and server parameter file have their own OF CONTROLFILE and OF SPFILE options

How It Works

When you execute this command at the RMAN prompt, it connects to the RMAN repository and retrieves all backup records for database datafiles. The repository can be stored either in the target database control file or in a separate recovery catalog database. By default the output is verbose and multiline: for each backup set it shows the backup set key, the type (Full or Incr), the level, the size, the device type and the completion time, followed by detail on its backup pieces. Add SUMMARY for one line per backup.

Key Points

  • Repository requirement: RMAN must be connected to a target database, and if no recovery catalog exists, the target database must be mounted or open
  • Scope specificity: The command lists backup sets that hold data files. If such a backup set also holds the control file or server parameter file, the verbose output shows Control File Included or SPFILE Included rows for it
  • Backup verification: The summary output includes a status column showing whether backups are available (A), unavailable (U), or expired (X)
  • Level information: Level 0 and level 1 are both incremental levels. A full (non-incremental) backup shows Full in the verbose Type column and F in the summary LV column, not level 0
  • Multitenant: In a container database (CDB), DATABASE means the whole CDB, so the command lists backups of the whole CDB

Output Information

With the SUMMARY option (LIST BACKUP OF DATABASE SUMMARY;), each backup gets one line with these columns:

  • Key: A unique key identifying the backup set
  • TY: Type of backup (B for backup set, P for proxy copy)
  • LV: For incremental backups, the incremental level (0 or 1); F for backup sets holding full data file backups; A for backup sets holding archived redo log files
  • S: Status indicating availability (A), unavailability (U), or expiration (X)
  • Device Type: The device the backup was written to, such as DISK or SBT_TAPE
  • Completion Time: When the backup finished

The verbose output also shows the Size of each backup set and, in the LV column, NULL for non-incremental backups or 0 or 1 for incremental ones.

Common Use Cases

Database administrators use this command for several important tasks:

  • Verifying that scheduled database backups completed successfully
  • Planning restore operations by identifying available backup sets
  • Auditing backup retention policies and identifying expired backups
  • Troubleshooting backup issues by reviewing historical backup records
  • Documenting backup coverage before performing major database changes

RMAN provides several variations of the LIST command for different purposes:

  • LIST BACKUP; - Shows all backups including database, archived logs, and control files
  • LIST BACKUP OF DATAFILE n; - Displays backups for a specific datafile number
  • LIST BACKUP OF TABLESPACE tablespace_name; - Shows backups for a specific tablespace
  • LIST BACKUP OF ARCHIVELOG ALL; - Lists all archived log backups
  • LIST BACKUP SUMMARY; - Provides a condensed summary view of all backups

Best Practices

When working with this command, database administrators should follow these guidelines:

  • Run this command regularly to verify backup availability before performing maintenance
  • Use the SUMMARY option (LIST BACKUP OF DATABASE SUMMARY;) for quick status checks without detailed output
  • Combine with time filters like COMPLETED AFTER 'SYSDATE-7' to focus on recent backups
  • Document backup keys from the output when planning specific restore operations
  • Verify that backup status shows 'A' (available) for backups you plan to use for recovery

Insights

Unlike viewing backup files directly in the operating system, this command shows what the RMAN repository records. The two can differ. A backup piece deleted with an operating system utility still shows as available until a CROSSCHECK marks it expired. Backup pieces copied to a new location, or copies made outside RMAN, are not in the repository until you register them with the CATALOG command.

The command also helps identify backup coverage gaps that could impact recovery objectives. By reviewing the completion times and backup levels, administrators can ensure that full and incremental backup schedules align with business requirements for recovery point objectives (RPO) and recovery time objectives (RTO).

References

Posts in this series