Wednesday, March 28, 2012

How to query RMAN backups from recovery catalog

If you use EM grid or db control for checking backups everyday, you don't have to query the recovery catalog database. However, grid control gives stupid errors from time to time and you have to manually query the backup status from the recovery catalog database. Here is the query which has results like EM backup reports view:


  SELECT db_name,
         status,
         input_type,
         start_time,
         end_time,
         output_device_type,
         input_bytes_display,
         output_bytes_display,
         time_taken_display
    FROM RC_RMAN_BACKUP_JOB_DETAILS
   WHERE start_time > SYSDATE - 7
ORDER BY NVL (end_time, '01-JAN-1900') DESC



another detailed view:





  SELECT b.name,
         a.handle,
         ROUND (bytes / 1024 / 1024) size_mb,
         tag,
         start_time,
         completion_time,
         elapsed_seconds,
         compressed,
         device_type
    FROM rc_backup_piece a, rc_database b
   WHERE a.db_id = b.dbid AND a.start_time > SYSDATE - 7
ORDER BY start_time DESC






2 comments:

Note: Only a member of this blog may post a comment.