首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

怎么找到占用CPU极高的线程执行的SQL语句

2012-08-31 
如何找到占用CPU极高的线程执行的SQL语句其实只是一条语句,步步递进Select addr from v$process c where c

如何找到占用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')));

热点排行