Skip to content

Instantly share code, notes, and snippets.

@joseporiol
Created January 21, 2014 10:20
Show Gist options
  • Save joseporiol/8537577 to your computer and use it in GitHub Desktop.
Save joseporiol/8537577 to your computer and use it in GitHub Desktop.
Long query progress on database
SELECT a.sid,
a.serial#,
b.username,
opname OPERATION,
target OBJECT,
TRUNC (elapsed_seconds, 5) "ET (s)",
TO_CHAR (start_time, 'HH24:MI:SS') start_time,
ROUND ( (sofar / totalwork) * 100, 2) "COMPLETE (%)"
FROM v$session_longops a, v$session b
WHERE a.sid = b.sid
AND b.username NOT IN ('SYS', 'SYSTEM')
AND totalwork > 0
ORDER BY elapsed_seconds;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment