Wednesday 23 November 2016

How to Query RMAN Session Status

Here is a query to V$SESSION_LONGOPS view that shows the status of RMAN sessions. It also calculates the percentage of the job that has been completed.

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;
Sample Output:
SID SERIAL# CONTEXT SOFAR TOTALWORK %_COMPLETE
--- ---------- ---------- ------ ---------- ----------
18 11 1 1995623 3083904 64.71
15 11 1 1863491 3599872 51.77
14 11 1 1936968 3339904 57.99
16 11 1 1843544 3083904 59.78

No comments:

Post a Comment