SELECT * 时程序停止响应

[复制链接]
查看11 | 回复4 | 2011-11-1 16:26:29 | 显示全部楼层 |阅读模式
ORACLE 11gR2 Windows 2008
开发人员写了一个程序,想对一张表增加字段(分区表,大约150个字段,100W行数据,约600MB)。在程序里执行select * 时,程序就会停止响应死掉,如果select字段就没问题。Toad、PL\SQL等执行select * 也没有问题。
特意trace session了一下,摘要如下。本人新转行DBA,经验不足,请各位不甚赐教。




3316.txt(295.4 KB, 下载次数: 3)2012-5-14 11:06 上传点击文件名下载附件
trace


可疑的地方:
SQL ID: 0j2wcbr7801z4
Plan Hash: 805622734
select *
from
EIR_DETAILwhere CERTIFICATE_NO='ZFFSA5922-F36A983' and status>0and
Final_Pickup_Seq='1123'

call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse50.00 0.00
0
0
0 0
Execute50.00 0.00
0
0
0 0
Fetch21.21 1.23 119408 123143
0 2
------- -------------- ---------- ---------- ---------- --------------------
total 121.21 1.23 119408 123143
0 2
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 100
Elapsed times include waiting on following events:
Event waited on
Times Max. WaitTotal Waited
---------------------------------------- Waited----------------------
SQL*Net message to client
70.00
0.00
SQL*Net more data to client
230.00
0.00
SQL*Net message from client
7 7200.0215955.23
reliable message
10.00
0.00
enq: KO - fast object checkpoint
10.00
0.00
********************************************************************************

TRACE最后的结论:
********************************************************************************
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse2750.39 0.38
0
1
0 0
Execute2750.10 0.16
2 54206
33
Fetch2472.15 2.20 120247 145060 17 338
------- -------------- ---------- ---------- ---------- --------------------
total7972.65 2.75 120249 145115223 371
Misses in library cache during parse: 13
Misses in library cache during execute: 3
Elapsed times include waiting on following events:
Event waited on
Times Max. WaitTotal Waited
---------------------------------------- Waited----------------------
SQL*Net message to client
6510.00
0.00
SQL*Net message from client
651 7200.0218656.27
Disk file operations I/O
60.00
0.00
SQL*Net more data to client
500.00
0.00
SQL*Net more data from client
130.00
0.00
log file sync
450.00
0.01
reliable message
10.00
0.00
enq: KO - fast object checkpoint
10.00
0.00
direct path write temp
150.00
0.00
asynch descriptor resize
50.00
0.00
direct path read temp
440.00
0.01
db file sequential read
50.04
0.05

OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpuelapsed diskquerycurrentrows
------- -------------- ---------- ---------- ---------- --------------------
Parse1060.00 0.00
0
0
0 0
Execute1060.04 0.04
0 48 62
30
Fetch4280.03 0.03
0381
0 388
------- -------------- ---------- ---------- ---------- --------------------
total6400.07 0.08
0429 62 418
Misses in library cache during parse: 0
Elapsed times include waiting on following events:
Event waited on
Times Max. WaitTotal Waited
---------------------------------------- Waited----------------------
Disk file operations I/O
80.00
0.00
284userSQL statements in session.
97internal SQL statements in session.
381SQL statements in session.
********************************************************************************
Trace file: e:\app\Administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_3316.trc
Trace file compatibility: 11.1.0.7
Sort options: default
9sessions in tracefile.
1247userSQL statements in trace file.
499internal SQL statements in trace file.
381SQL statements in trace file.
151unique SQL statements in trace file.
6414lines in trace file.
434886elapsed seconds in trace file.


回复

使用道具 举报

千问 | 2011-11-1 16:26:29 | 显示全部楼层
顶上去
回复

使用道具 举报

千问 | 2011-11-1 16:26:29 | 显示全部楼层

是增加字段后有问题还是还没有增加字段?
回复

使用道具 举报

千问 | 2011-11-1 16:26:29 | 显示全部楼层
ahdong2007 发表于 2012-5-14 12:21
是增加字段后有问题还是还没有增加字段?

是增加字段前,做select测试的时候,发现有问题,暂时没敢在生产环境增加
目前的问题跟字段都没有关系,是特定情况下select发现问题
回复

使用道具 举报

千问 | 2011-11-1 16:26:29 | 显示全部楼层
皮皮少爷 发表于 2012-5-14 12:55
是增加字段前,做select测试的时候,发现有问题,暂时没敢在生产环境增加
目前的问题跟字段都没有关系 ...

不响应的时候,查一下等待事件
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行