---top CPU Session
set linesize 200
column inst_id format 999
column sid format 9999
column "OS PID" format a12
column module format a45
column APP_USER_NAME format a15
column username format a12
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid as "OS PID",
s.username,s.client_identifier APP_USER_NAME,
s.module,
st.value / 100 as "CPU sec"
FROM gv$sesstat st, gv$statname sn, gv$session s, gv$process p
WHERE st.inst_id = sn.inst_id and sn.inst_id = s.inst_id and s.inst_id = p.inst_id
and sn.name = 'CPU used by this session' -- CPU
AND st.statistic# = sn.statistic# AND st.sid = s.sid AND s.paddr = p.addr AND s.last_call_et < 1800 -- active within last 1/2 hour
AND s.logon_time > (SYSDATE - 240/1440) -- sessions logged on within 4 hours
AND st.value / 100 > 10
ORDER BY st.value ;
exit;
topcpu.sql
未经允许不得转载:徐万新之路 » topcpu.sql
相关推荐
Oracle Linux 8上 Oracle ASM 共享盘命名方案 —— multipath 与 udev 两种实现
Oracle 26ai: How to install Oracle 26ai GI (HAS) using Native ASM
Oracle 26ai RAC 图形界面安装指南(VirtualBox + OL 8.10)
Vmware Workstation 2026下Oracle Linux 8.10 虚拟机网卡命名对齐方案(ebsdb1 / ebsdb2)
华为笔记本 HarmonyOS 使用铠大师虚拟机安装 Win11 系统实战教程
EBS 12.1.3 INV接口管理器
sysaux中HEATMAP 对象较大
生产库AWR手工清理及 SYSAUX 表空间收缩

徐万新之路

