Thursday, March 24, 2016

Important Queries For RMAN

Important Queries For RMAN

To Display the backup details of the database (Full, Incremental & Archive log backup), when the DB is not connect with the recover catalog.  (Work in Mount stage)

select session_key,input_type,status,to_char(start_time,'yyyy-mm-dd hh24:mi') start_time,to_char(end_time,'yyyy-mm-dd hh24:mi') end_time,output_bytes_display,time_taken_display from v$rman_backup_job_details order by session_key asc;

To see Backed Up Archive Logs in the database (Work in Mount stage):

select recid,set_stamp,sequence#,first_change#,next_change# from  v$backup_redolog;

This script will report on all backups – full, incremental and archivelog backups:

col STATUS format a9
col hrs format 999.99
select 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_DETAILS order by session_key;

This script will give you RMAN backup status along with start and stop timing.

SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK, ROUND (SOFAR/TOTALWORK*100, 2) "% COMPLETE" FROM V$SESSION_LONGOPS WHERE OPNAME LIKE 'RMAN%' AND OPNAME NOT LIKE '%aggregate%' AND TOTALWORK! = 0 AND SOFAR <> TOTALWORK



No comments:

Post a Comment