Skip to content

Instantly share code, notes, and snippets.

@joseporiol
Created January 21, 2014 10:20
Show Gist options
  • Save joseporiol/8537573 to your computer and use it in GitHub Desktop.
Save joseporiol/8537573 to your computer and use it in GitHub Desktop.
CPU usage of the user
SELECT ss.username, se.SID, VALUE / 100 cpu_usage_seconds
FROM v$session ss, v$sesstat se, v$statname sn
WHERE se.STATISTIC# = sn.STATISTIC#
AND NAME LIKE '%CPU used by this session%'
AND se.SID = ss.SID
AND ss.status = 'ACTIVE'
AND ss.username IS NOT NULL
ORDER BY VALUE DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment