Dec
25
2009
How to find CPU usage for a session
select nvl(ss.USERNAME,’ORACLE PROC’) username,
se.SID,
VALUE cpu_usage
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
where
•Username – Name of the user
•SID – Session id
•CPU Usage – CPU centiseconds used by this session (divide by 100 to get real CPU seconds)
