从LINUX进程消耗CPU获得SQL

 --从LINUX进程消耗CPU获得SQL
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

 

 

这个脚本表个关系比较复杂,一时没记得到

你可能感兴趣的:(sql,c,linux,session,脚本)