`

如何找到占用CPU极高的线程执行的SQL语句

 
阅读更多
其实只是一条语句,步步递进

Select addr from v$process c where c.spid='30154';

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 = '30154'));

select 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='30154')));
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics