Wednesday 10 February 2016

RMAN backup-Percentage of backup complete, from how many hours the backup is running-how many minutes left to backup complete-Complete backup information in one go

RMAN backup-Percentage of backup complete? from how many hours the backup is running?how many minutes left to backup complete? Above are the common questions we are habituated to here from application team, and we obviously can answer these question s but how...by checking the log..by calculating comparing on current backupfile size with previous backup size etc...which is a time consuming job. Is there any easier way to fetch this information. Yes you know it's there...you can calculate it from sqlplus by querying the Oracle views. Here is a single small query to get all these answers in a single go.Complete backup information in one go-


SET LINESIZE 1000

SELECT SID,SERIAL#,OPNAME,
ROUND(SOFAR/TOTALWORK*100,2) AS PCT_COMPLETE,
TO_CHAR(START_TIME, 'DD-MON-YY HH24:MI) START_TIME,
(SYSDATE-START_TIME)*24 HOURS_RUNNING,
((SYSDATE-START_TIME)*24*60)/(SOFAR/TOTALWORK)-(SYSDATE-START_TIME)*24*60 MINUTES_LEFT,
TO_CHAR((SYSDATE-START_TIME)/(SOFAR/TOTALWORK)+START_TIME,'DD-MON-YY HH24:MI') EST_COMP_TIME 
FROM V$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%AGGREGATE%
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK;

Now you have the complete required information handy.Hope this helps.