Oracle CPU使用率过高问题处理

.下载Process Explorer

2.打开Process Explorer,查看CPU使用情况最高的进程

3.双击该进程,查看详情

\

4.    获取cpu使用最好的线程tid

5.    查询sql_id

  1. select sql_id from v$session  
  2.   where paddr in(  
  3.     select addr from v$process  
  4.     where spid in('16796','11972','9812','11652','5484')  
  5.  )  

6.根据5中的sql_id查询具体执行占用CPU过高的sql语句

  1. select * from v$sqlarea where sql_id in(sql_id1,sql_id2,sql_id3...);  

7.查询sid和serial#

  1. SELECT sid,serial#,sql_id from v$session where sql_id in(sql_id1,sql_id2,sql_id3...)  

8.杀掉进程

  1. alter system kill session 'sid,serial#';  

或批量杀进程

  1. SELECT 'alter system kill session '''||sid||','||serial#||''';' from v$session where sql_id in(sql_id);  

 

9.分析SQL进行优化

posted on 2019-11-21 16:39  woxiangbo  阅读(676)  评论(0编辑  收藏  举报