Tuesday, September 2, 2014

How to Monitor RMAN Job Progress

Problem
You have a long-running RMAN job, and you wonder how much longer it will take to complete.



Solution
To monitor the progress of an RMAN backup or restore, use V$SESSION_LONGOPS view:
COLUMN sid FORM 99999
COLUMN serial# FORM 99999
COLUMN opname FORM A35
COLUMN sofar FORM 999999999
COLUMN pct_complete FORM 99.99 HEAD "% Comp."

SELECT sid, serial#, sofar, totalwork, opname,
round(sofar/totalwork*100,2) AS pct_complete
FROM v$session_longops
WHERE opname LIKE 'RMAN%'
AND opname NOT LIKE '%aggregate%'
AND totalwork != 0
AND sofar <> totalwork;

  SID SERIAL#      SOFAR  TOTALWORK OPNAME                              % Comp.
------ ------- ---------- ---------- ----------------------------------- -------
 1010      23     874234  3072256 RMAN: full datafile backup            28.46


You can also use V$SESSION_LONGOPS to estimate when a job will complete for an RMAN backup or restore operation, because the total amount of work, the time the job began, and the amount of work left are known values.
SET LINES 200
COLUMN opname FORM A35
COLUMN pct_complete FORM 99.99 HEAD "% Comp."
COLUMN start_time FORM A15 HEAD "Start|Time"
COLUMN hours_running FORM 9999.99 HEAD "Hours|Running"
COLUMN minutes_left FORM 999999 HEAD "Minutes|Left"
COLUMN est_comp_time FORM A15 HEAD "Est. Comp.|Time"

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%'
AND opname NOT LIKE '%aggregate%'
AND totalwork != 0
AND sofar <> totalwork;
                                                Start              Hours Minutes Est. Comp.
  SID SERIAL# OPNAME                              % Comp. Time             Running    Left Time
------ ------- ----------------------------------- ------- --------------- -------- ------- ---------------
 1010      23 RMAN: full datafile backup       46.31 02-sep-14 15:05      .07       5 02-sep-14 15:14


For more information see:


I hope this helps.

Please feel free to leave your questions or suggest improvements to this section.

No comments:

Post a Comment