Top cpu consuming sessions - Oracle Database Script. 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;
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;