Oracle CPU使用率过高问题处理

1.下载Process Explorer

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

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

\

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

5. 查询sql_id

sql 复制代码
select sql_id from v$session  
  where paddr in(  
    select addr from v$process  
    where spid in('16796','11972','9812','11652','5484')  
 )  

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

sql 复制代码
select * from v$sqlarea where sql_id in(sql_id1,sql_id2,sql_id3...);  

7.查询sid和serial#

sql 复制代码
SELECT sid,serial#,sql_id from v$session where sql_id in(sql_id1,sql_id2,sql_id3...) 

8.杀掉进程

sql 复制代码
alter system kill session 'sid,serial#';  

或批量杀进程

sql 复制代码
SELECT 'alter system kill session '''||sid||','||serial#||''';' from v$session where sql_id in(sql_id);  

9.分析SQL进行优化

相关推荐
悄悄敲敲敲20 小时前
MySQL表的约束
数据库·mysql
鼠爷ねずみ20 小时前
SpringCloud前后端整体开发流程-以及技术总结文章实时更新中
java·数据库·后端·spring·spring cloud
九皇叔叔21 小时前
MySQL 数据库 Read View 详解
数据库·mysql·mvcc·read view
Elastic 中国社区官方博客1 天前
Elasticsearch:圣诞晚餐 BBQ - 图像识别
大数据·数据库·elasticsearch·搜索引擎·ai·全文检索
cui_win1 天前
Prometheus实战教程 - Redis 监控
数据库·redis·prometheus
JIngJaneIL1 天前
基于java + vue个人博客系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot
TG:@yunlaoda360 云老大1 天前
华为云国际站代理商备份策略设置过程中遇到问题如何解决?
服务器·数据库·华为云
SelectDB1 天前
Doris Catalog 已上线!性能提升 200x,全面优于 JDBC Catalog,跨集群查询迈入高性能分析时代
数据库·数据分析·apache
TAEHENGV1 天前
进度跟踪模块 Cordova 与 OpenHarmony 混合开发实战
android·javascript·数据库
神秘面具男031 天前
MySQL 从基础到实践
数据库·mysql