- 最后登录
- 2014-3-6
- 在线时间
- 36 小时
- 威望
- 0
- 金钱
- 109
- 注册时间
- 2012-6-12
- 阅读权限
- 10
- 帖子
- 45
- 精华
- 0
- 积分
- 0
- UID
- 494
|
14#
发表于 2013-6-19 09:37:34
低调小马哥 发表于 2013-6-18 21:24
我觉得可能不是bug,10046跟踪一下吧,看看绑定变量sql语句的时间都花在什么地方了 ...
绑定变量的10046 trace
*** 2013-06-19 09:27:52.774
*** ACTION NAME:() 2013-06-19 09:27:52.774
*** MODULE NAME:(SQL*Plus) 2013-06-19 09:27:52.774
*** SERVICE NAME:(cslcq) 2013-06-19 09:27:52.774
*** SESSION ID:(150.16) 2013-06-19 09:27:52.774
WAIT #2: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339458274193442
*** 2013-06-19 09:28:07.252
WAIT #2: nam='SQL*Net message from client' ela= 14139148 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339458288332910
=====================
PARSING IN CURSOR #1 len=267 dep=0 uid=58 oct=3 lid=58 tim=1339458288333705 hv=13638860 ad='5c45f330'
select count(*) from SITE_DAILY_REPORT A,
(SELECT DISTINCT DRAW_ID FROM DRAWID_SEQ
WHERE GAME_ID like DECODE(:v1,'All','%',:v2)
) D where A.DRAW_ID=D.DRAW_ID and A.REPORT_DATE BETWEEN TO_DATE(:v4,'yyyy-mm-dd') AND TO_DATE(:v5 || ' 23:59:59','yyyy-mm-dd hh24:mi:ss')
END OF STMT
PARSE #1:c=0,e=611,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=1339458288333702
BINDS #1:
kkscoacd
Bind#0
oacdty=01 mxl=32(20) mxlc=00 mal=00 scl=00 pre=00
oacflg=03 fl2=1000000 frm=01 csi=852 siz=128 off=0
kxsbbbfp=2af6504ebf40 bln=32 avl=03 flg=05
value="All"
Bind#1
oacdty=01 mxl=32(20) mxlc=00 mal=00 scl=00 pre=00
oacflg=03 fl2=1000000 frm=01 csi=852 siz=0 off=32
kxsbbbfp=2af6504ebf60 bln=32 avl=03 flg=01
value="All"
Bind#2
oacdty=01 mxl=32(20) mxlc=00 mal=00 scl=00 pre=00
oacflg=03 fl2=1000000 frm=01 csi=852 siz=0 off=64
kxsbbbfp=2af6504ebf80 bln=32 avl=10 flg=01
value="2011-05-01"
Bind#3
oacdty=01 mxl=32(20) mxlc=00 mal=00 scl=00 pre=00
oacflg=03 fl2=1000000 frm=01 csi=852 siz=0 off=96
kxsbbbfp=2af6504ebfa0 bln=32 avl=10 flg=01
value="2011-05-01"
EXEC #1:c=7999,e=7337,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=1339458288341119
WAIT #1: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339458288341167
FETCH #1:c=1184819,e=1156963,p=0,cr=2525,cu=0,mis=0,r=1,dep=0,og=1,tim=1339458289498159
WAIT #1: nam='SQL*Net message from client' ela= 413 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339458289499291
FETCH #1:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1339458289499336
WAIT #1: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339458289499355
*** 2013-06-19 09:28:27.943
WAIT #1: nam='SQL*Net message from client' ela= 19039499 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339458308538875
STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='SORT AGGREGATE (cr=2525 pr=0 pw=0 time=1157076 us)'
STAT #1 id=2 cnt=7515 pid=1 pos=1 obj=0 op='HASH JOIN (cr=2525 pr=0 pw=0 time=4073660 us)'
STAT #1 id=3 cnt=142793 pid=2 pos=1 obj=0 op='VIEW (cr=374 pr=0 pw=0 time=168307 us)'
STAT #1 id=4 cnt=142793 pid=3 pos=1 obj=0 op='HASH UNIQUE (cr=374 pr=0 pw=0 time=168305 us)'
STAT #1 id=5 cnt=142800 pid=4 pos=1 obj=0 op='FILTER (cr=374 pr=0 pw=0 time=142923 us)'
STAT #1 id=6 cnt=142800 pid=5 pos=1 obj=180005 op='MAT_VIEW ACCESS FULL DRAWID_SEQ (cr=374 pr=0 pw=0 time=107 us)'
STAT #1 id=7 cnt=17261 pid=2 pos=2 obj=0 op='PARTITION RANGE ITERATOR PARTITION: KEY KEY (cr=2151 pr=0 pw=0 time=535415 us)'
STAT #1 id=8 cnt=17261 pid=7 pos=1 obj=117887 op='INDEX FAST FULL SCAN PK_SITE_DAILY_REPORT PARTITION: KEY KEY (cr=2151 pr=0 pw=0 time=518104 us)'
=====================
PARSING IN CURSOR #2 len=55 dep=0 uid=58 oct=42 lid=58 tim=1339458308539284 hv=2217940283 ad='0'
alter session set events '10046 trace name context off'
END OF STMT
PARSE #2:c=0,e=47,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1339458308539281
EXEC #2:c=0,e=64,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1339458308539388
非绑定变量的trace
WAIT #2: nam='SQL*Net message to client' ela= 2 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339457838993623
WAIT #2: nam='SQL*Net message from client' ela= 4051658 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339457843045564
=====================
PARSING IN CURSOR #1 len=290 dep=0 uid=58 oct=3 lid=58 tim=1339457843050011 hv=3939726461 ad='5db4e858'
select count(*) from SITE_DAILY_REPORT A, (SELECT DISTINCT DRAW_ID FROM DRAWID_SEQ WHERE GAME_ID like DECODE('All','All','%','All') ) D where A.DRAW_ID=D.DRAW_ID and A.REPORT_DATE BETWEEN TO_DATE('2011-05-01','yyyy-mm-dd') AND TO_DATE('2011-05-01' || ' 23:59:59','yyyy-mm-dd hh24:mi:ss')
END OF STMT
PARSE #1:c=4000,e=4290,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=1339457843050003
BINDS #1:
EXEC #1:c=0,e=120,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1339457843050198
WAIT #1: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339457843050250
FETCH #1:c=290955,e=339862,p=0,cr=2525,cu=0,mis=0,r=1,dep=0,og=1,tim=1339457843390142
WAIT #1: nam='SQL*Net message from client' ela= 400 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339457843391457
FETCH #1:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1339457843391518
WAIT #1: nam='SQL*Net message to client' ela= 1 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339457843391538
*** 2013-06-19 09:21:01.852
WAIT #1: nam='SQL*Net message from client' ela= 29511409 driver id=1413697536 #bytes=1 p3=0 obj#=-1 tim=1339457872902989
STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='SORT AGGREGATE (cr=2525 pr=0 pw=0 time=339917 us)'
STAT #1 id=2 cnt=7515 pid=1 pos=1 obj=0 op='HASH JOIN (cr=2525 pr=0 pw=0 time=521667 us)'
STAT #1 id=3 cnt=142793 pid=2 pos=1 obj=0 op='VIEW (cr=374 pr=0 pw=0 time=144593 us)'
STAT #1 id=4 cnt=142793 pid=3 pos=1 obj=0 op='HASH UNIQUE (cr=374 pr=0 pw=0 time=144591 us)'
STAT #1 id=5 cnt=142800 pid=4 pos=1 obj=180005 op='MAT_VIEW ACCESS FULL DRAWID_SEQ (cr=374 pr=0 pw=0 time=85 us)'
STAT #1 id=6 cnt=17261 pid=2 pos=2 obj=0 op='PARTITION RANGE SINGLE PARTITION: 90 90 (cr=2151 pr=0 pw=0 time=34598 us)'
STAT #1 id=7 cnt=17261 pid=6 pos=1 obj=117887 op='INDEX FAST FULL SCAN PK_SITE_DAILY_REPORT PARTITION: 90 90 (cr=2151 pr=0 pw=0 time=34589 us)'
=====================
PARSING IN CURSOR #2 len=55 dep=0 uid=58 oct=42 lid=58 tim=1339457872903627 hv=2217940283 ad='0'
alter session set events '10046 trace name context off'
END OF STMT
PARSE #2:c=0,e=36,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1339457872903625
EXEC #2:c=0,e=83,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=1339457872903749
从trace 文件看,就是在fetch的时候, 绑定变量时间较大,cpu时间明显较大。
|
|