Monday, April 20, 2009

Get CPU Usage by Session

SELECT NVL(ss.USERNAME,'ORACLE PROC') UserName,
se.SID,
VALUE CPUUsage
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
ORDER BY VALUE DESC

No comments:

Post a Comment