------------检查CPU使用高的进程----------
select ss.sid,se.command,ss.value CPU ,se.username,se.program ,vp.SPID OS_Processes
from v$sesstat ss, v$session se,v$process vp where
ss.statistic# in
(select statistic#
from v$statname
where name = 'CPU used by this session')
and se.sid=ss.sid
And se.SID=vp.PID
and ss.sid>10
And ss.value >10000
order by ss.value desc
------------查询进程的sql语句----------
select s.sid, event, wait_time, w.seq#, q.sql_text
from v$session_wait w, v$session s, v$process p, v$sqlarea q
where s.paddr=p.addr and
s.sid=&p and
s.sql_address=q.address
---------------------
----查看占用CPU资源很高的ORACLE进程的SQL语句
select sql_text,spid,v$session.PROGRAM,process from
v$sqlarea,v$session,v$process
where v$sqlarea.ADDRESS=v$session.SQL_ADDRESS
and v$sqlarea.HASH_VALUE=v$session.SQL_HASH_VALUE
and v$session.PADDR=v$process.ADDR
and v$process.SPID in (14912)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/54212/viewspace-976935/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/54212/viewspace-976935/