如何获取trace中sql所绑定变量的值

来源:互联网 发布:java团队开发工具 编辑:程序博客网 时间:2024/04/27 21:45
QUESTION
=========
Enabled 10046 trace level 4 and created trace files,But how to find bind variables's value
eos (end of section)


ANSWER
=======
Here is an example:

Sample PL/SQL code:

declare
vcount number := 88;
vcount2 char(5) := 'meme' ;
begin
insert into taba values (vcount, vcount2);
end;

The resulting trace output:

PARSING IN CURSOR #2 len=36 dep=1 uid=0 oct=2 lid=0 tim=0 hv=540755502
ad='40106
c6c'
INSERT INTO TABA VALUES ( :b1,:b2 )
END OF STMT
PARSE #2:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=0
BINDS #2:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=03
bfp=20080d30 bln=22 avl=02 flg=05
value=88
bind 1: dty=96 mxl=32(05) mal=00 scl=00 pre=00 oacflg=03
bfp=20080d1c bln=05 avl=05 flg=05
value="meme "
EXEC #2:c=0,e=0,p=0,cr=2,cu=3,mis=0,r=1,dep=1,og=4,tim=0
EXEC #1:c=0,e=0,p=0,cr=2,cu=3,mis=0,r=1,dep=0,og=4,tim=0
XCTEND rlbk=0, rd_only=0

:b1's value is bind 0, value=88
:b2's value is bind 1,value "meme"
原创粉丝点击