Oracle Database – find sessions consuming lot of CPU

   Oracle Database – use below query to find the sessions using a lot of CPU

col program form a30 heading „Program“
col CPUMins form 99990 heading „CPU in Mins“
select rownum as rank, a.*
from (
SELECT v.sid, program, v.value / (100 * 60) CPUMins
FROM v$statname s , v$sesstat v, v$session sess
WHERE s.name = ‚CPU used by this session‘
and sess.sid = v.sid
and v.statistic#=s.statistic#
and v.value>0
ORDER BY v.value DESC) a
where rownum < 11;

Leave a Reply

You must be logged in to post a comment.