LIST BACKUPSET OF DATABASE: Oracle RMAN Command Guide

LIST BACKUPSET OF DATABASE: Oracle RMAN Command Guide

Purpose

The LIST BACKUPSET OF DATABASE command in Oracle Recovery Manager (RMAN) displays detailed information about all backup sets that contain database datafiles. This command helps database administrators verify backup existence, check backup status, find backup keys for restore operations, and audit backup history for compliance and recovery planning.

Command

1LIST BACKUPSET OF DATABASE;

Breakdown of Code

Command Structure

The command combines three key components to query the RMAN repository:

LIST: The primary RMAN command that queries and displays backup metadata from the repository stored in either the control file or recovery catalog

BACKUPSET: Specifies that you want to see backup set information rather than image copies or other backup types

OF DATABASE: Filters the output to show only backup sets containing database datafiles, excluding archived logs, individual tablespace backups, control files, or SPFILE backups

How to Execute

To run this command, follow these steps:

  1. Connect to RMAN using the target database:
1rman target /
  1. Execute the command at the RMAN prompt:
1RMAN> LIST BACKUPSET OF DATABASE;

The command queries the RMAN metadata repository and displays all registered backup sets for database datafiles.

Key Points

Repository Requirements

  • RMAN must be connected to a target database
  • The target database must be mounted or open if no recovery catalog exists
  • Backup metadata is stored in either the control file or a separate recovery catalog database

Output Information

The command displays several important columns:

  • BS Key: Unique identifier for each backup set in the RMAN repository
  • Type: Backup type (Full, Incremental Level 0, Level 1, or Archive Log)
  • LV: Backup level indicator where 0 = incremental level 0, 1 = incremental level 1, A = archive logs, F = full backup
  • Status: Current status such as AVAILABLE, EXPIRED, or UNAVAILABLE
  • Device Type: Storage device (DISK or SBT_TAPE)
  • Completion Time: When the backup finished
  • Size: Total size of the backup set
  • Tag: User-defined or system-generated label

Backup Status Codes

Understanding status indicators is critical for backup management:

  • A (Available): Backup is ready for restore operations
  • X (Expired): Backup has expired according to retention policy
  • U (Unavailable): Backup exists in repository but files are not accessible

Insights and Explanations

When to Use This Command

Database administrators should use LIST BACKUPSET OF DATABASE in these situations:

  • Verify backup existence: Confirm that database backups completed successfully and are registered in RMAN
  • Find backup keys: Identify the key number needed for restore or delete operations
  • Check backup status: Determine if backups are available or have expired
  • Audit backup history: Review backup details for compliance reporting
  • Troubleshoot recovery: Locate specific backup pieces needed for database restore operations

Understanding Backup Set Keys

The backup set key (BS Key) is a unique identifier that RMAN assigns to each backup set. If RMAN is connected to a recovery catalog, the key is unique across all registered databases. This key is essential when performing operations on specific backups, such as crosschecking, validating, or deleting backup sets.

The LIST BACKUPSET OF DATABASE command is specific compared to other RMAN list commands:

  • LIST BACKUP; shows all backups including database, archived logs, control files, and SPFILEs
  • LIST BACKUP OF DATABASE; displays database backups but includes all backup types (sets and copies)
  • LIST BACKUPSET; shows all backup sets including archived logs and control files
  • LIST BACKUPSET OF DATABASE; specifically shows only backup sets containing database datafiles

Best Practices

Follow these recommendations when working with backup sets:

  1. Regular verification: Run this command regularly to verify that backups are completing successfully
  2. Status monitoring: Check for EXPIRED or UNAVAILABLE backups that may need attention
  3. Retention policy: Understand your backup retention policy to interpret status codes correctly
  4. Recovery catalog: Consider using a recovery catalog for longer backup history storage beyond control file retention
  5. Documentation: Record backup set keys for critical backups in your recovery documentation

Default Output Behavior

By default, LIST BACKUPSET uses the "BY BACKUP" format, which organizes output by backup sets first, then shows the contents of each backup set including pieces and files. The command displays verbose output with detailed descriptions unless you specify the SUMMARY keyword.

Recovery Catalog Benefits

Using a recovery catalog instead of only the control file provides advantages:

  • Stores RMAN metadata for longer time periods than the control file
  • Enables database recovery when the control file is lost
  • Allows recovery to a time older than what the control file retains
  • Provides centralized backup reporting across multiple databases

To perform similar backup listing operations, consider these RMAN commands:

 1-- List all backup sets including archives and control files
 2RMAN> LIST BACKUPSET;
 3
 4-- List a specific backup set by key
 5RMAN> LIST BACKUPSET 1234;
 6
 7-- List backup set summary view
 8RMAN> LIST BACKUPSET SUMMARY;
 9
10-- List all database backups (sets and copies)
11RMAN> LIST BACKUP OF DATABASE;
12
13-- List backups for specific datafile
14RMAN> LIST BACKUP OF DATAFILE 1;
15
16-- List backups for specific tablespace
17RMAN> LIST BACKUP OF TABLESPACE USERS;
18
19-- List all archived log backups
20RMAN> LIST BACKUP OF ARCHIVELOG ALL;

References

Posts in this series