×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Oracle
Posted by: Maykel Vink
Added: Sep 28, 2012 10:01 AM
Modified: Oct 23, 2012 9:03 AM
Views: 29
  1. SELECT
  2.   s.sid,
  3.   l.opname,
  4.   TO_CHAR(TO_DATE(ROUND((100-DECODE(l.totalwork, 0, 0, ROUND(100 * l.sofar/l.totalwork, 2)))*
  5.   DECODE (l.totalwork, 0, 0, ROUND(l.elapsed_seconds/(100 * l.sofar/l.totalwork), 2)),0),'SSSSS'),
  6.   'hh24:mi:ss') AS hours_to_go,
  7.   l.target,
  8.   l.sofar,
  9.   l.totalwork,
  10.   DECODE(l.totalwork, 0, 0, ROUND(100 * l.sofar/l.totalwork, 2)) AS percent,
  11.   l.units,
  12.   l.elapsed_seconds,
  13.   ROUND(l.elapsed_seconds/3600,2) AS elapsed_hours,
  14.   l.message
  15. FROM
  16.   v$session_longops l,
  17.   v$session s
  18. WHERE
  19.   l.sid          = s.sid
  20. AND l.totalwork <> l.sofar
  21. ORDER BY
  22.   l.start_time DESC