当前位置:Gxlcms > 数据库问题 > 性能优化-查询最耗CPU的SESSION与SQL

性能优化-查询最耗CPU的SESSION与SQL

时间:2021-07-01 10:21:17 帮助过:2人阅读

in (‘24566‘));

 

select s.SID,

       s.serial#,

       s.username,

       s.osuser,

       s.machine,

       s.program,

       s.process,

       to_char(s.logon_time, ‘yyyy/mm/dd hh24:mi:ss‘) logon,

       p.spid

  from v$session s,v$process p

 where 1=1

 and s.PADDR=p.ADDR

 and s.SID=‘1050‘

;

 

          

select sql_text,a.SQL_ID

from v$sqltext  a

where a.HASH_VALUE=(select sql_hash_value

from v$session b

where b.SID=‘634‘)

 order by piece ASC;

 

select * from v$sqlarea q

where q.SQL_ID=‘akf0uyy10kgn9‘

;

 

 

 

---------------------

select *

  from (select q.SQL_ID,q.SQL_TEXT, q.SQL_FULLTEXT,s.SID,s.SERIAL#

          from v$sqlarea q,v$session s

          where q.SQL_ID=s.SQL_ID

          and LAST_ACTIVE_TIME>=to_date(‘2016-05-03 08:00:00‘,‘YYYY-MM-DD HH24:MI:SS‘)

          AND INSTR(PARSING_SCHEMA_NAME,‘SYS‘) <=0

         order by cpu_time desc)

 where rownum <= 15

 order by rownum asc;

 

 

 alter system kill session ‘634,40971‘;

性能优化-查询最耗CPU的SESSION与SQL

标签:

人气教程排行