分析数据库CPU使用率高

[复制链接]
查看11 | 回复9 | 2010-10-8 09:28:52 | 显示全部楼层 |阅读模式
某个数据库平时CPU使用率在1%左右,最近使用率达到97%左右几乎100%,以下是vmstat top iostatat的指标。awr通过附件传上,忘大神帮忙分析分析。谢谢
[root@localhost ~]# vmstat -S M 2 20
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
rb swpd free buffcache si sobibo in cs us sy id wa st
172331105 201292700 8904000 293 6630
172331104 201292800 214 236 1352554 924310
162331103 201292800 122 174 1151345 912610
121331103 201292800 106 198 1190396 971210
101331103 20129290096 226 1290501 940410
71331102 20129290068 206 1184427 896410
161331102 20129300050 584 1314510 953210
181331105 20129300040 232 1213602 913510
142331106 20129300034 166 1124312 940510
111331106 20129300060 254 1223427 970200
161331 98 20129310054 224 1145370 941410
170331 97 20129310058 220 1369558 941500
222331100 20129310070 260 1197386 970210
91331100 20129310040 180 1069300 960310
192331100 211293100 116 212 1317487 961210
141331 99 211293200 150 292 1189444 950310
43331 99 211293200 196 258 1340573 961220
161331 94 211293300 238 158 1133392 901630
62331 93 211293300 222 328 1155523 883730
91331 90 211293400 526 432 1388730 834 1120
[root@localhost ~]# top
top - 08:27:45 up 966 days, 15:13,1 user,load average: 16.32, 16.78, 16.39
Tasks: 472 total,20 running, 368 sleeping, 0 stopped,84 zombie
Cpu(s): 29.1%us,2.3%sy,0.0%ni, 65.8%id,2.6%wa,0.0%hi,0.2%si,0.0%st
Mem:16403456k total, 16312776k used,90680k free,21624k buffers
Swap: 25599568k total, 339240k used, 25260328k free, 13247844k cached
PID USERPRNIVIRTRESSHR S %CPU %MEMTIME+COMMAND

27124 oracle16 0 3648m 2.4g 2.4g R 86 15.2 267:27.00 oracle

26948 oracle16 0 3648m 2.6g 2.6g R 79 16.6 305:01.48 oracle

27066 oracle16 0 3648m 2.5g 2.5g R 76 15.9 338:32.14 oracle

30862 oracle16 0 3644m 639m 635m R 674.0 188:24.17 oracle

784 oracle15 0 3644m 400m 396m R 662.536:02.78 oracle

30469 oracle16 0 3644m 700m 696m R 644.4 222:52.83 oracle

32508 oracle16 0 3644m 494m 490m R 493.190:14.67 oracle

26964 oracle16 0 3645m 2.1g 2.1g R 44 13.5 1:43.98 oracle

429 oracle16 0 3645m 448m 444m S 392.862:15.49 oracle

31920 oracle15 0 3645m 541m 537m S 373.4 124:03.45 oracle

3148 oracle25 0 3650m 3.1g 3.1g R 35 19.813704:51 oracle

32193 oracle15 0 3645m 585m 580m R 293.781:24.60 oracle

27157 oracle15 0 3645m 2.6g 2.6g S 27 16.5 2:20.41 oracle

1281 oracle16 0 3644m 324m 320m R 242.0 6:45.86 oracle

29038 oracle15 0 3645m 945m 940m R 205.9 299:56.57 oracle

29400 oracle16 0 3645m 858m 854m R 185.4 284:59.97 oracle

31304 oracle15 0 3644m 591m 587m R 153.7 159:00.24 oracle

26980 oracle17 0 3648m 2.0g 2.0g R 12 12.6 1:21.36 oracle

1379 oracle19 0 3645m 1.3g 1.3g R38.1 0:12.07 oracle

1441 root15 0 12980 1264712 R30.0 0:00.04 top

1 root15 0 10328484452 S00.0 7:21.03 init

2 rootRT-5 000 S00.0 0:31.81 migration/0

3 root3419 000 S00.0 0:01.88 ksoftirqd/0

4 rootRT-5 000 S00.0 0:00.03 watchdog/0

5 rootRT-5 000 S00.0 0:34.82 migration/1

6 root3419 000 S00.0 0:01.26 ksoftirqd/1

7 rootRT-5 000 S00.0 0:00.10 watchdog/1

8 rootRT-5 000 S00.0 0:16.53 migration/2

9 root3419 000 S00.0 0:00.82 ksoftirqd/2

10 rootRT-5 000 S00.0 0:00.12 watchdog/2

11 rootRT-5 000 S00.0 0:15.04 migration/3

12 root3419 000 S00.0 0:00.98 ksoftirqd/3

13 rootRT-5 000 S00.0 0:00.12 watchdog/3

14 rootRT-5 000 S00.0 0:14.55 migration/4

15 root3419 000 S00.0 0:00.85 ksoftirqd/4

16 rootRT-5 000 S00.0 0:00.10 watchdog/4

17 rootRT-5 000 S00.0 0:15.74 migration/5

18 root3419 000 S00.0 0:01.17 ksoftirqd/5

top - 08:27:48 up 966 days, 15:13,1 user,load average: 16.77, 16.87, 16.42
Tasks: 472 total,17 running, 371 sleeping, 0 stopped,84 zombie
Cpu(s): 87.3%us,8.2%sy,0.0%ni,2.9%id,1.6%wa,0.0%hi,0.1%si,0.0%st
Mem:16403456k total, 16318344k used,85112k free,21632k buffers
Swap: 25599568k total, 339240k used, 25260328k free, 13248452k cached
PID USERPRNIVIRTRESSHR S %CPU %MEMTIME+COMMAND

27124 oracle16 0 3648m 2.4g 2.4g S 72 15.2 267:29.36 oracle

26964 oracle15 0 3645m 2.1g 2.1g R 62 13.5 1:46.01 oracle

27066 oracle16 0 3648m 2.5g 2.5g R 48 15.9 338:33.70 oracle

27176 oracle16 0 3650m 2.9g 2.9g R 45 18.7 7:57.09 oracle

429 oracle16 0 3645m 448m 444m R 452.862:16.95 oracle

31920 oracle15 0 3645m 542m 537m S 393.4 124:04.72 oracle

30862 oracle15 0 3644m 640m 636m R 384.0 188:25.42 oracle

26980 oracle15 0 3648m 2.0g 2.0g R 38 12.6 1:22.60 oracle

29400 oracle15 0 3645m 858m 854m R 335.4 285:01.05 oracle

30469 oracle15 0 3644m 700m 696m S 324.4 222:53.87 oracle

31304 oracle15 0 3644m 591m 587m S 323.7 159:01.28 oracle

27157 oracle15 0 3646m 2.6g 2.6g R 31 16.6 2:21.42 oracle

1281 oracle15 0 3644m 324m 320m S 302.0 6:46.83 oracle

1379 oracle20 0 3645m 1.4g 1.3g R 308.6 0:13.04 oracle

30019 oracle15 0 3644m 766m 762m S 284.8 254:53.39 oracle

784 oracle15 0 3644m 400m 396m R 272.536:03.67 oracle

29038 oracle15 0 3645m 945m 940m R 265.9 299:57.41 oracle

32508 oracle16 0 3644m 494m 490m S 253.190:15.50 oracle

3148 oracle25 0 3650m 3.1g 3.1g R 25 19.813704:52 oracle

26948 oracle17 0 3648m 2.6g 2.6g R 23 16.6 305:02.23 oracle

32193 oracle15 0 3645m 585m 580m R 193.781:25.22 oracle

27020 oracle15 0 3647m 1.4g 1.4g S 149.1 0:16.95 oracle

27048 oracle16 0 3647m 2.4g 2.4g S5 15.4 3:45.85 oracle

1441 root15 0 12984 1368812 R00.0 0:00.05 top

15215 oracle16 0 3693m 3.2g 3.2g S0 20.635:54.45 oracle

15217 oracle16 0 3658m48m44m R00.3 129:15.98 oracle

1 root15 0 10328484452 S00.0 7:21.03 init

2 rootRT-5 000 S00.0 0:31.81 migration/0

3 root3419 000 S00.0 0:01.88 ksoftirqd/0

4 rootRT-5 000 S00.0 0:00.03 watchdog/0

5 rootRT-5 000 S00.0 0:34.82 migration/1

6 root3419 000 S00.0 0:01.26 ksoftirqd/1

7 rootRT-5 000 S00.0 0:00.10 watchdog/1

8 rootRT-5 000 S00.0 0:16.53 migration/2

9 root3419 000 S00.0 0:00.82 ksoftirqd/2

10 rootRT-5 000 S00.0 0:00.12 watchdog/2

11 rootRT-5 000 S00.0 0:15.04 migration/3

12 root3419 000 S00.0 0:00.98 ksoftirqd/3

top - 08:27:51 up 966 days, 15:13,1 user,load average: 16.77, 16.87, 16.42
Tasks: 472 total,19 running, 369 sleeping, 0 stopped,84 zombie
Cpu(s): 82.9%us, 11.3%sy,0.0%ni,4.1%id,1.6%wa,0.0%hi,0.2%si,0.0%st
Mem:16403456k total, 16325948k used,77508k free,21660k buffers
Swap: 25599568k total, 339240k used, 25260328k free, 13249504k cached
PID USERPRNIVIRTRESSHR S %CPU %MEMTIME+COMMAND

27157 oracle16 0 3646m 2.6g 2.6g R 69 16.8 2:23.53 oracle

27176 oracle15 0 3646m 2.9g 2.9g R 58 18.7 7:58.87 oracle

32193 oracle16 0 3645m 586m 580m R 573.781:26.98 oracle

26964 oracle15 0 3666m 2.1g 2.1g R 55 13.7 1:47.71 oracle

26980 oracle15 0 3645m 2.0g 2.0g R 54 12.6 1:24.27 oracle

27066 oracle16 0 3648m 2.5g 2.5g R 53 15.9 338:35.34 oracle

27020 oracle16 0 3647m 1.5g 1.5g R 539.5 0:18.58 oracle

31920 oracle15 0 3645m 542m 537m R 373.4 124:05.86 oracle

32508 oracle16 0 3644m 494m 490m R 353.190:16.56 oracle

30019 oracle15 0 3644m 766m 762m R 324.8 254:54.37 oracle

29400 oracle15 0 3645m 858m 854m S 305.4 285:01.98 oracle

784 oracle15 0 3644m 400m 396m S 302.536:04.59 oracle

1281 oracle15 0 3644m 324m 320m S 302.0 6:47.74 oracle

30862 oracle16 0 3644m 640m 636m R 284.0 188:26.28 oracle

29038 oracle15 0 3645m 945m 940m R 275.9 299:58.25 oracle

429 oracle15 0 3645m 448m 444m S 242.862:17.68 oracle

30469 oracle16 0 3644m 700m 696m R 194.4 222:54.44 oracle

26948 oracle16 0 3648m 2.6g 2.6g S 17 16.6 305:02.76 oracle

31304 oracle15 0 3644m 591m 587m R 133.7 159:01.69 oracle

3148 oracle25 0 3650m 3.1g 3.1g R 13 19.813704:52 oracle

1379 oracle21 0 3645m 1.4g 1.4g R 118.7 0:13.38 oracle

27048 oracle15 0 3647m 2.4g 2.4g R7 15.4 3:46.07 oracle

27124 oracle16 0 3648m 2.4g 2.4g R2 15.2 267:29.41 oracle

1441 root15 0 12984 1368812 R10.0 0:00.07 top

15217 oracle16 0 3658m48m44m S00.3 129:15.99 oracle

1 root15 0 10328484452 S00.0 7:21.03 init

2 rootRT-5 000 S00.0 0:31.81 migration/0

3 root3419 000 S00.0 0:01.88 ksoftirqd/0

4 rootRT-5 000 S00.0 0:00.03 watchdog/0

5 rootRT-5 000 S00.0 0:34.82 migration/1

6 root3419 000 S00.0 0:01.26 ksoftirqd/1

7 rootRT-5 000 S00.0 0:00.10 watchdog/1

8 rootRT-5 000 S00.0 0:16.53 migration/2

9 root3419 000 S00.0 0:00.82 ksoftirqd/2

10 rootRT-5 000 S00.0 0:00.12 watchdog/2

11 rootRT-5 000 S00.0 0:15.04 migration/3

12 root3419 000 S00.0 0:00.98 ksoftirqd/3

13 rootRT-5 000 S00.0 0:00.12 watchdog/3

top - 08:27:54 up 966 days, 15:13,1 user,load average: 16.47, 16.80, 16.40
Tasks: 472 total,24 running, 364 sleeping, 0 stopped,84 zombie
Cpu(s): 83.1%us, 13.7%sy,0.0%ni,1.9%id,1.2%wa,0.0%hi,0.1%si,0.0%st
Mem:16403456k total, 16335988k used,67468k free,21664k buffers
Swap: 25599568k total, 339240k used, 25260328k free, 13250280k cached
PID USERPRNIVIRTRESSHR S %CPU %MEMTIME+COMMAND

26980 oracle16 0 3645m 2.0g 2.0g R 59 12.6 1:26.11 oracle

27020 oracle16 0 3647m 1.5g 1.5g R 589.6 0:20.38 oracle

27176 oracle16 0 3646m 2.9g 2.9g R 57 18.7 8:00.62 oracle

26948 oracle15 0 3648m 2.6g 2.6g R 53 16.6 305:04.41 oracle

27066 oracle15 0 3648m 2.5g 2.5g R 53 15.9 338:36.98 oracle

26964 oracle15 0 3674m 2.1g 2.1g R 50 13.7 1:49.25 oracle

27124 oracle15 0 3648m 2.4g 2.4g R 43 15.2 267:30.74 oracle

27157 oracle15 0 3646m 2.6g 2.6g R 36 16.8 2:24.63 oracle

30019 oracle16 0 3644m 766m 762m S 304.8 254:55.31 oracle

1281 oracle15 0 3644m 324m 320m R 292.0 6:48.63 oracle

784 oracle15 0 3644m 400m 396m R 272.536:05.44 oracle

30862 oracle15 0 3644m 640m 636m R 274.0 188:27.13 oracle

29400 oracle15 0 3645m 858m 854m R 275.4 285:02.82 oracle

29038 oracle15 0 3645m 945m 940m R 265.9 299:59.05 oracle

32193 oracle15 0 3645m 586m 580m S 253.781:27.76 oracle

3148 oracle25 0 3650m 3.1g 3.1g R 25 19.813704:53 oracle

31920 oracle15 0 3645m 542m 537m R 253.4 124:06.62 oracle

429 oracle15 0 3645m 448m 444m R 242.862:18.43 oracle

30469 oracle15 0 3644m 700m 696m R 244.4 222:55.18 oracle

32508 oracle15 0 3644m 494m 490m R 243.190:17.29 oracle

1379 oracle18 0 3645m 1.4g 1.4g R 208.9 0:13.99 oracle

31304 oracle15 0 3644m 591m 587m S 183.7 159:02.25 oracle

27048 oracle15 0 3647m 2.4g 2.4g R 11 15.4 3:46.42 oracle

15229 oracle15 0 3644m 308m 305m S11.9 1:10.08 oracle

1441 root15 0 12984 1368812 R10.0 0:00.09 top

1 root15 0 10328484452 S00.0 7:21.03 init

2 rootRT-5 000 S00.0 0:31.81 migration/0

3 root3419 000 S00.0 0:01.88 ksoftirqd/0

4 rootRT-5 000 S00.0 0:00.03 watchdog/0

5 rootRT-5 000 S00.0 0:34.82 migration/1

6 root3419 000 S00.0 0:01.26 ksoftirqd/1

7 rootRT-5 000 S00.0 0:00.10 watchdog/1

8 rootRT-5 000 S00.0 0:16.53 migration/2

9 root3419 000 S00.0 0:00.82 ksoftirqd/2

10 rootRT-5 000 S00.0 0:00.12 watchdog/2

11 rootRT-5 000 S00.0 0:15.04 migration/3

12 root3419 000 S00.0 0:00.98 ksoftirqd/3

13 rootRT-5 000 S00.0 0:00.12 watchdog/3

14 rootRT-5 000 S00.0 0:14.55 migration/4

[root@localhost ~]# iostat 2 20
Linux 2.6.18-92.el5xen (localhost.localdomain)06/17/2016
avg-cpu:%user %nice %system %iowait%steal %idle

29.060.002.522.570.00 65.85
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
117.30 14245.66 641.24 1189759038965 53554726053
avg-cpu:%user %nice %system %iowait%steal %idle

92.050.005.140.840.001.97
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
32.5499.52 371.29208776
avg-cpu:%user %nice %system %iowait%steal %idle

79.540.00 11.107.110.062.18
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
95.50 700.00 772.00 1400 1544
avg-cpu:%user %nice %system %iowait%steal %idle

75.140.009.497.750.007.62
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
78.50 824.00 376.00 1648752
avg-cpu:%user %nice %system %iowait%steal %idle

84.100.008.970.930.006.00
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
36.14 118.81 388.12240784
avg-cpu:%user %nice %system %iowait%steal %idle

87.250.005.750.930.006.06
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
20.3063.37 340.59128688
avg-cpu:%user %nice %system %iowait%steal %idle

91.840.003.170.450.004.53
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
19.5598.18 301.82216664
avg-cpu:%user %nice %system %iowait%steal %idle

86.720.007.451.180.004.66
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
35.15 166.34 641.58336 1296
avg-cpu:%user %nice %system %iowait%steal %idle

92.390.002.741.370.003.49
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
39.30 318.41 350.25640704
avg-cpu:%user %nice %system %iowait%steal %idle

90.430.006.150.620.002.80
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
24.8899.50 330.35200664
avg-cpu:%user %nice %system %iowait%steal %idle

94.210.002.811.460.001.52
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
32.88 223.42 353.15496784
avg-cpu:%user %nice %system %iowait%steal %idle

88.630.006.151.430.003.79
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
25.37 143.28 318.41288640
avg-cpu:%user %nice %system %iowait%steal %idle

86.140.006.462.950.004.45
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
66.00 664.00 368.00 1328736
avg-cpu:%user %nice %system %iowait%steal %idle

85.980.005.892.610.005.52
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
75.12 577.11 561.19 1160 1128
avg-cpu:%user %nice %system %iowait%steal %idle

85.070.008.771.120.005.04
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
26.37 107.46 338.31216680
avg-cpu:%user %nice %system %iowait%steal %idle

92.160.004.450.620.002.76
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
44.59 136.94 634.23304 1408
avg-cpu:%user %nice %system %iowait%steal %idle

91.130.005.950.800.002.12
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
34.4073.391016.51160 2216
avg-cpu:%user %nice %system %iowait%steal %idle

87.150.006.491.170.005.19
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
33.66 245.54 526.73496 1064
avg-cpu:%user %nice %system %iowait%steal %idle

88.240.008.971.210.061.52
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
48.79 231.88 529.47480 1096
avg-cpu:%user %nice %system %iowait%steal %idle

89.030.005.111.290.004.56
Device:
tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
sda
32.18 126.73 439.60256888


回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
shared pool 太小造成软解析,及各命中率太低,redo log 所在的磁盘写性能太差,导致严重的log file sync
回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
yezhizi_weixb 发表于 2016-6-17 09:17
shared pool 太小造成软解析,及各命中率太低,redo log 所在的磁盘写性能太差,导致严重的log file sync

这些从指标上能看出一些,主要是分析什么问题导致CPU和IO问题的。
回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
parse time elapsed 长,
Executes:
88.73
很低,
Hard parses:
54.21

--这样大量的语句是非绑定变量,
而且共享池设置很小.
Physical reads:
7,211.09
也相对较高.
回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
Service Name
DB Time (s)
DB CPU (s)
Physical Reads
Logical Reads
SYS$USERS
51,984.10
24,082.60
25,858,451
51,701,206
很奇怪是这个服务 使用资源多,而不是应用.
回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
难道你们系统使用sys用户应用吗?

回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
看看排前 的sql语句 优化他们.
回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
event
10298 trace name context forever, level 32
$ oerr ora 10298
10298, 00000, "ksfd i/o tracing"
// *Cause:
// *Action: If this event is set then ksfd module generates tracing
//
for each i/o request
--不需要 去掉它 .
回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
lfree 发表于 2016-6-17 09:34
看看排前 的sql语句 优化他们.

嗯,我疑惑的是这一年多了 CPU使用在1%左右,为啥会突然爆满。
回复

使用道具 举报

千问 | 2010-10-8 09:28:52 | 显示全部楼层
lfree 发表于 2016-6-17 09:32
难道你们系统使用sys用户应用吗?

那需要问下负责应用的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行