close

--  Display Session CPU Usage

select s.username as "Oracle User",
       s.osuser as "OS User",
       i.consistent_gets as "Consistent Gets",
       i.physical_reads as "Physical Reads",
       s.status as "Status",
       s.sid "SID",s.serial# as "Serial#",
       s.machine as "Machine",
       s.program as "Program",
       to_char(logon_time, 'YYYY/MM/DD HH24:MI:SS') as "Logon Time",
       w.seconds_in_wait as "Idle Time",
       P.SPID as "SPID",
       name as "Stat CPU",
       value
from v$session s,v$sess_io i,v$session_wait w,v$process p,v$statname n,v$sesstat t
where s.sid = i.sid
and s.sid = w.sid (+)
and s.username is not null
and 'SQL*Net message from client' = w.event(+)
and s.paddr = p.addr
and n.statistic# = t.statistic#
and n.name like '%cpu%'
and t.sid = s.sid
order by i.consistent_gets desc,i.physical_reads desc;


[Reference]:
http://www.oracle.com/technology/oramag/code/tips2005/112805.html
 Jony Safi
, DBA at Videotron Ltee, in Montreal, Quebec,Canada

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 DanBrother 的頭像
    DanBrother

    DanBrother的部落格

    DanBrother 發表在 痞客邦 留言(0) 人氣()