Ben the DBA

How to list RMAN Backups

Description

In the article I'll show you how to query the status of the RMAN Backup with SQL and RMAN

Using SQL

To query the status of RMAN backups using SQL, follow these steps: Connect to your Oracle database using a SQL client. Run the following SQL query to retrieve detailed information about your RMAN backup jobs:


SET LINESIZE 200
SET PAGESIZE 50
COLUMN start_time FORMAT A15
COLUMN end_time FORMAT A15
COLUMN output_device_type FORMAT A10
COLUMN input_type FORMAT A20
COLUMN status FORMAT A10
COLUMN time_taken_display FORMAT A15
COLUMN input_bytes_display FORMAT A15
COLUMN output_bytes_display FORMAT A15

SELECT start_time,
end_time,
output_device_type,
input_type,
status,
time_taken_display, 
input_bytes_display,
output_bytes_display
FROM V$RMAN_BACKUP_JOB_DETAILS
WHERE input_type='DB FULL'
ORDER BY start_time DESC;

This query will display a comprehensive overview of your full database backup jobs, including start and end times, device type, input type, status, duration, and data size. Output:

Using RMAN

To query the status of RMAN backups using RMAN, follow these steps: Connect to RMAN:


rman target /

Run the following RMAN command to list all backups with detailed information:


LIST BACKUP;

Alternatively, you can use this command to get a summary view that is easier to read:


LIST BACKUP SUMMARY;

Output:

TOC

Description
Using SQL
Using RMAN