Useful RMAN Queries
Query for Currently running RMAN backups like Full, Incremental & Archivelog backups
col STATUS format a9col hrs format 999.99select SESSION_KEY, INPUT_TYPE, STATUS,to_char(START_TIME,'mm/dd/yy hh24:mi') start_time,to_char(END_TIME,'mm/dd/yy hh24:mi') end_time,elapsed_seconds/3600 hrs from V$RMAN_BACKUP_JOB_DETAILSorder by session_key;
Query for RMAN Total pending and completed work
SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,ROUND (SOFAR/TOTALWORK*100, 2) "% COMPLETE"FROM V$SESSION_LONGOPSWHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%'AND TOTALWORK! = 0 AND SOFAR <> TOTALWORK;
Query to show the progress size in MB of RMAN backup/recovery
select to_char(start_time, 'dd-mon-yyyy@hh24:mi:ss') "Date",status,operation,mbytes_processedfrom v$rman_status vswhere start_time > sysdate -1order by start_time;
Query to check historical RMAN Backup Status
set linesize 500 pagesize 2000col Hours format 9999.99col STATUS format a10select SESSION_KEY, INPUT_TYPE, STATUS,to_char(START_TIME,'mm-dd-yyyy hh24:mi:ss') as RMAN_Bkup_start_time,to_char(END_TIME,'mm-dd-yyyy hh24:mi:ss') as RMAN_Bkup_end_time,elapsed_seconds/3600 Hours from V$RMAN_BACKUP_JOB_DETAILSorder by session_key;
Query to check historical RMAN backup with size
set pages 2000 lines 200COL STATUS FORMAT a9COL hrs FORMAT 999.99select INPUT_TYPE,STATUS,TO_CHAR(START_TIME,'mm/dd/yy hh24:mi') start_time,TO_CHAR(END_TIME,'mm/dd/yy hh24:mi') end_time,ELAPSED_SECONDS/3600 hrs,INPUT_BYTES/1024/1024/1024 SUM_BYTES_BACKED_IN_GB,OUTPUT_BYTES/1024/1024/1024 SUM_BACKUP_PIECES_IN_GB,OUTPUT_DEVICE_TYPEFROM V$RMAN_BACKUP_JOB_DETAILSorder by SESSION_KEY;
Post a Comment
Post a Comment