select s.sid,s.value "CPU Used" from v$sesstat s,v$statname n where s.statistic#=n.statistic# and n.name='CPU used by this session' and s.value>0 order by 2 desc; 能知道哪个sid最消耗资源 前提,timed_statistics=true 然后从v$sqlarea能找到这个sql在干什么 /************ select s.sid,b.serial#,s.value "CPU Used" ,b.username from v$sesstat s,v$statname n ,v$session b where s.statistic#=n.statistic# and n.name='CPU used by this session' and s.value>0 and s.sid=b.sid order by 2 desc /
from v$sesstat s,v$statname n
where s.statistic#=n.statistic# and n.name='CPU used by this session'
and s.value>0
order by 2 desc; 能知道哪个sid最消耗资源 前提,timed_statistics=true 然后从v$sqlarea能找到这个sql在干什么
/************
select s.sid,b.serial#,s.value "CPU Used" ,b.username
from v$sesstat s,v$statname n ,v$session b
where s.statistic#=n.statistic# and n.name='CPU used by this session'
and s.value>0
and s.sid=b.sid
order by 2 desc
/
************/
用 OCI 的性能可以高点~