数据库服务器某一进程CPU使用高如何诊断
平台:Linux
命令:top
#top
top - 19:32:56 up 42 min, 2 users, load average: 2.42, 1.36, 1.08
Tasks: 136 total, 2 running, 134 sleeping, 0 stopped, 0 zombie
Cpu(s): 7.5% us, 90.8% sy, 0.0% ni, 0.0% id, 0.0% wa, 1.6% hi, 0.0% si
Mem: 401028k total, 376760k used, 24268k free, 1320k buffers
Swap: 1534196k total, 131008k used, 1403188k free, 164492k cached
PID USER PR NI %CPU TIME+ %MEM VIRT RES SHR S COMMAND
30289 oracle 25 0 69.5 1:01.50 1.7 20052 6636 4968 R sqlplus ----CPU使用率高
29878 root 16 0 15.7 1:09.35 0.6 7952 2340 1844 S sshd
10014 root 16 0 1.0 0:00.93 0.6 7516 2248 1788 S sshd
510 oracle 16 0 0.7 0:00.09 0.3 2956 1048 784 R top
6309 root 15 0 0.7 0:09.47 1.2 29044 4768 2156 S X
4674 root 0 -20 0.3 0:01.76 0.0 0 0 0 S o2hb-220EAAF039
5280 root 16 0 0.3 0:03.60 0.5 5644 2148 1028 S hald
6700 oracle 10 -5 0.3 0:22.68 2.2 166m 9016 3884 S ocssd.bin
8112 oracle 15 0 0.3 0:01.71 3.1 182m 12m 9.9m S oracle
8116 oracle 15 0 0.3 0:06.68 3.5 183m 13m 10m S oracle
8118 oracle 15 0 0.3 0:05.73 3.7 191m 14m 9.9m S oracle
8120 oracle 15 0 0.3 0:05.86 4.0 191m 15m 10m S oracle
8851 oracle 16 0 0.3 0:01.27 3.2 301m 12m 10m S oracle
8868 oracle 15 0 0.3 0:11.08 5.1 306m 19m 18m S oracle
8872 oracle 15 0 0.3 0:16.50 5.8 311m 22m 15m S oracle
8890 oracle 16 0 0.3 0:03.66 5.3 303m 20m 18m S oracle
10957 oracle 16 0 0.3 0:00.71 6.9 302m 26m 24m S oracle
30296 oracle 15 0 0.3 0:02.23 10.7 311m 41m 31m S oracle
select a.sid,a.SERIAL#, PADDR,SADDR,a.username,s.sql_text from v$session a,v$sqltext s where a.sql_address=s.address and a.sql_hash_value=s.hash_value and PADDR =(select addr from v$process where spid=30289) order by piece;
--根据操作系统的进程号30289查看相应的SID,SQL_text等
SID SERIAL# PADDR SADDR USERNAME SQL_TEXT
---------- ---------- -------- -------- -------------------- ------------------------------------------------------------
124 109 2CE21348 2CEE2594 SYS select * from dba_objects order by object_name
可以在中确定该 SQL执行了多久,是否有异常,如果执行了1两个小时都没完成,可以认为是有异常。
数据库服务器某一进程CPU使用高如何诊断
本文2024-09-22 20:22:30发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-113221.html