AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > Oracle

Oracle中捕获问题SQL解决CPU过渡消耗

51自学网 http://www.wanshiok.com

  4.检查数据库

  查询v$session_wait获取各进程等待事件

SQL> select sid,event,p1,p1text from v$session_wait;
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
124 latch free 1.6144E+10 address
1 pmon timer 300 duration
2 rdbms ipc message 300 timeout
3 rdbms ipc message 300 timeout
11 rdbms ipc message 30000 timeout
6 rdbms ipc message 180000 timeout
4 rdbms ipc message 300 timeout
134 rdbms ipc message 6000 timeout
147 rdbms ipc message 6000 timeout
275 rdbms ipc message 17995 timeout
274 rdbms ipc message 6000 timeout
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
118 rdbms ipc message 6000 timeout
7 buffer busy waits 17 file#
56 buffer busy waits 17 file#
161 buffer busy waits 17 file#
195 buffer busy waits 17 file#
311 buffer busy waits 17 file#
314 buffer busy waits 17 file#
205 buffer busy waits 17 file#
269 buffer busy waits 17 file#
200 buffer busy waits 17 file#
164 buffer busy waits 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------

140 buffer busy waits 17 file#
66 buffer busy waits 17 file#
10 db file sequential read 17 file#
18 db file sequential read 17 file#
54 db file sequential read 17 file#
49 db file sequential read 17 file#
48 db file sequential read 17 file#
46 db file sequential read 17 file#
45 db file sequential read 17 file#
35 db file sequential read 17 file#
30 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
29 db file sequential read 17 file#
22 db file sequential read 17 file#
178 db file sequential read 17 file#
175 db file sequential read 17 file#
171 db file sequential read 17 file#
123 db file sequential read 17 file#
121 db file sequential read 17 file#
120 db file sequential read 17 file#
117 db file sequential read 17 file#
114 db file sequential read 17 file#
113 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
111 db file sequential read 17 file#
107 db file sequential read 17 file#
80 db file sequential read 17 file#
222 db file sequential read 17 file#
218 db file sequential read 17 file#
216 db file sequential read 17 file#
213 db file sequential read 17 file#
199 db file sequential read 17 file#
198 db file sequential read 17 file#
194 db file sequential read 17 file#
192 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
188 db file sequential read 17 file#
249 db file sequential read 17 file#

242 db file sequential read 17 file#
239 db file sequential read 17 file#
236 db file sequential read 17 file#
235 db file sequential read 17 file#
234 db file sequential read 17 file#
233 db file sequential read 17 file#
230 db file sequential read 17 file#
227 db file sequential read 17 file#
336 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
333 db file sequential read 17 file#
331 db file sequential read 17 file#
329 db file sequential read 17 file#
327 db file sequential read 17 file#
325 db file sequential read 17 file#
324 db file sequential read 17 file#
320 db file sequential read 17 file#
318 db file sequential read 17 file#
317 db file sequential read 17 file#
316 db file sequential read 17 file#
313 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
305 db file sequential read 17 file#
303 db file sequential read 17 file#
301 db file sequential read 17 file#
293 db file sequential read 17 file#
290 db file sequential read 17 file#
288 db file sequential read 17 file#
287 db file sequential read 17 file#
273 db file sequential read 17 file#
271 db file sequential read 17 file#
257 db file sequential read 17 file#
256 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
254 db file sequential read 17 file#
252 db file sequential read 17 file#
159 db file sequential read 17 file#
153 db file sequential read 17 file#

146 db file sequential read 17 file#
142 db file sequential read 17 file#
135 db file sequential read 17 file#
133 db file sequential read 17 file#
132 db file sequential read 17 file#
126 db file sequential read 17 file#
79 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
77 db file sequential read 17 file#
72 db file sequential read 17 file#
70 db file sequential read 17 file#
69 db file sequential read 17 file#
67 db file sequential read 17 file#
63 db file sequential read 17 file#
55 db file sequential read 17 file#
102 db file sequential read 17 file#
96 db file sequential read 17 file#
95 db file sequential read 17 file#
91 db file sequential read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
81 db file sequential read 17 file#
15 db file sequential read 17 file#
19 db file scattered read 17 file#
50 db file scattered read 17 file#
285 db file scattered read 17 file#
279 db file scattered read 17 file#
255 db file scattered read 17 file#
243 db file scattered read 17 file#
196 db file scattered read 17 file#
187 db file scattered read 17 file#
170 db file scattered read 17 file#
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
162 db file scattered read 17 file#
138 db file scattered read 17 file#
110 db file scattered read 17 file#
108 db file scattered read 17 file#
92 db file scattered read 17 file#
330 db file scattered read 17 file#

310 db file scattered read 17 file#
302 db file scattered read 17 file#
299 db file scattered read 17 file#
89 db file scattered read 17 file#
5 smon timer 300 sleep time
SID EVENT P1 P1TEXT
---------- ------------------------------ ---------- ----------------------------------------------------------------
20 SQL*Net message to client 1952673792 driver id
103 SQL*Net message to client 1650815232 driver id
....
148 SQL*Net more data from client 1952673792 driver id
291 SQL*Net more data from client 1952673792 driver id
244 rows selected.

  发现存在大量db file scattered read及db file sequential read等待.显然全表扫描等操作成为系统最严重的性能影响因素.

 
 

上一篇:Oracle平台应用数据库系统的设计与开发  下一篇:Oracle与SQL Server在企业应用中的比较