In TIP 48 , I explained on how to make more sense of trace which is generated by event 10046.
One of our reader asked a question on how to identify data type of bind variable, As the result I dedicated this post to answer.
For finding more information about bind variable, user should be able to locate BINDS keyword in trace file.
This part is something like this :
BINDS #2:
bind 0: dty=1 mxl=32(30) mal=00 scl=00 pre=00 oacflg=13 oacfl2=1 size=32 offset=0
bfp=030a79ec bln=32 avl=01 flg=05
value="A"
dty determines bind variable type and value shows bind variable value at the time of execution.
Different values can be assigned to dty which presents different data type.
Typical dty value is :
1 VARCHAR2 or NVARCHAR2
2 NUMBER
8 LONG
11 ROWID
12 DATE
23 RAW
24 LONG RAW
96 CHAR
112 CLOB or NCLOB
113 BLOB
114 BFILE
To demosnstrate, I ran some queries.
------ Query #1 : Number Bind variable
SQL> alter session set statistics_level=ALL;
Session altered.
SQL> alter session set max_dump_file_size=UNLIMITED;
Session altered.
SQL> alter session set events '10046 trace name context forever, level 12';
Session altered.
SQL> variable b number;
SQL> declare
2 cnt number;
3 begin
4 :b:=1;
5 select count(*) into cnt from dba_objects where object_id=:b;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> alter session set events '10046 trace name context off';
Session altered.
Checking trace file ......
PARSING IN CURSOR #2 len=52 dep=1 uid=0 oct=3 lid=0 tim=2797155817 hv=1220784193 ad='130a9d4c'
SELECT count(*) from dba_objects where object_id=:b1
END OF STMT
PARSE #2:c=15625,e=24270,p=0,cr=5,cu=0,mis=1,r=0,dep=1,og=0,tim=2797155809
BINDS #2:
bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=13 oacfl2=1 size=24 offset=0
bfp=030a7b2c bln=22 avl=02 flg=05
value=1
EXEC #2:c=0,e=2062,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=2797159524
FETCH #2:c=0,e=37,p=0,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=2797159885
------ Query #2 : Varhchar2 Bind variable
SQL> alter session set events '10046 trace name context forever, level 12';
Session altered.
SQL> variable b varchar2(30);
SQL> declare
2 cnt number;
3 begin
4 :b:='A';
5 select count(*) into cnt from dba_objects where object_name=:b;
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> alter session set events '10046 trace name context off';
Checking trace file .....
PARSING IN CURSOR #2 len=54 dep=1 uid=0 oct=3 lid=0 tim=3007778755 hv=2029951970 ad='12ff2c80'
SELECT count(*) from dba_objects where object_name=:b1
END OF STMT
PARSE #2:c=15625,e=12991,p=0,cr=2,cu=0,mis=1,r=0,dep=1,og=0,tim=3007778748
BINDS #2:
bind 0: dty=1 mxl=32(30) mal=00 scl=00 pre=00 oacflg=13 oacfl2=1 size=32 offset=0
bfp=030a79ec bln=32 avl=01 flg=05
value="A"
EXEC #2:c=0,e=2167,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=3007782524
WAIT #2: nam='db file sequential read' ela= 9458 p1=1 p2=89 p3=1
WAIT #2: nam='db file sequential read' ela= 6606 p1=1 p2=26791 p3=1
21 comments:
It was very Helpful. Thanx for the TIP.
Very helpful! i was searching for a simple list describing the common values for the bind variables in a trace file, thanks!
Thank you, it is short and sweet!
How do I get the value if data type is RAW (23).
I am seeing different value than expected for the raw datatypes..
Eg:-
oacdty=23 mxl=32(16) mxlc=00 mal=00 scl=00 pre=00
oacflg=13 fl2=202001 frm=00 csi=00 siz=32 off=0
kxsbbbfp=989d09e8 bln=32 avl=16 flg=09
value=00000000989D09E8
Expected RAW value for the this var is:- A913A99B5FFC7217595E2D5009663225
Very helpful! i was searching for a simple list describing the common values for the bind variables in a trace file, thanks!
Weblogic Server 12cR2 Training
Really An Informative Blog, Posting Articles With Great Content And Quality, Urgent Care Services Provided By US.Thanks for Sharing.Keep on Updating.A Complete Blog I Say! Thanks For Updating.
This Blog is very helpful and useful, came to know that I should be strong in my basics and this blog helps me to improve it, US Medical Residency in Chicago Services Provided by Us. Thanks For Posting.
Really A great informative blog post this blog provides only valuable information on Mulesoft Certification Training .Thanks For Sharing.
Really Thanks For Posting and Sharing such an useful Information.....
Vizag Real Estate
Very Nice Article keep it up...! Thanks for sharing this amazing information with us...! keep sharing
I feel happy about and learning more about this topic. keep sharing your information regularly for my future reference. This content creates new hope and inspiration within me. Thanks for sharing an article like this. the information which you have provided is better than another blog.
IELTS Coaching in Dwarka mor
Bosch Fridge Repair in Noida
Godrej Fridge Repair in Noida
whirlpool Fridge Repair in Noida
videocon Fridge Repair in Noida
Samsung Fridge Repair in Noida
Lg Fridge Repair in Noida
Haier Fridge Repair in Noida
Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
If you are looking for any python Related information please visit our website Python Training In Bangalore page!
It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me. oracle training in chennai
Jio Lottery Winner 2020 is great Indian Game. Must Join it.
It has been basically extraordinarily liberal with you to give straightforwardly what precisely numerous people would've promoted for an eBook to wind up making some money for their end, principally given that you could have attempted it in the occasion you needed. Keep sharing
Oracle DBA Training in Bangalore
very good institute in bangalore with 100% placement
Oracle reviews in bangalore
Infycle Technologies, the No.1 software training institute in Chennai offers the No.1 Big Data Hadoop Training in Chennai | Infycle Technologies for students, freshers, and tech professionals. Infycle also offers other professional courses such as DevOps, Artificial Intelligence, Cyber Security, Python, Oracle, Java, Power BI, Selenium Testing, Digital Marketing, Data Science, etc., which will be trained with 200% practical classes. After the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7502633633 to get more info and a free demo.
Hi, I am John Smith I am Web Developer, It is an amazing blog thanks for the sharing the blog. Frantic infotech provide the Hardware App Development such as an information about software development for costumer service. Frantic infotech also provide the wearable app development. Theve delopment of advanced web applications is Orient Software’s specialty and we will successfully fulfill all your web application development requirements, from small-sized to wider-ranged projects.
Thank for very nice this sharing.
Thank you very nice sharing.
Post a Comment