查詢UNIX/LINUX 下的佔用CPU資源的SQL語句

zhengbao_jun發表於2011-06-28

select /*+ ORDERED */ sql_text
from v$sqltext a
where (a.hash_value,a.ADDRESS) in
(
select decode(sql_hash_value,0,PREV_HASH_VALUE,sql_hash_value),
       decode(sql_hash_value,0,PREV_SQL_ADDR,SQL_ADDRESS)
from v$session b
where b.paddr = (
select addr from v$process c
where c.spid = '&pid'
)
)
order by piece asc

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/235507/viewspace-700893/,如需轉載,請註明出處,否則將追究法律責任。

相關文章