Skip to content

Instantly share code, notes, and snippets.

@andrempo
Created April 27, 2015 13:32
Show Gist options
  • Select an option

  • Save andrempo/f5c0a8fafc5dc2318cdd to your computer and use it in GitHub Desktop.

Select an option

Save andrempo/f5c0a8fafc5dc2318cdd to your computer and use it in GitHub Desktop.
Oracle CPU Usage Per Session
SELECT se.username, se.osuser, ss.sid, ROUND (value/100) "CPU Usage"
FROM v$session se, v$sesstat ss, v$statname st
WHERE ss.statistic# = st.statistic#
AND name LIKE '%CPU used by this session%'
AND se.sid = ss.SID
AND se.username IS NOT NULL
AND ROUND (value/100) > 0
ORDER BY value DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment