Have you ever whished you had more trace data in your Pro*C based project?
Probably yes, but you where scared by the large effort you would have to do to get useful data.
That is the time for post-processing or the introduction of some smart macros.
This is when sqlTrace comes to the rescue :-)
There is no need to change your *.pc files.
You just need to embed the postprocessor into your makefile and link to sqlTrace.o
Example run
[oracle@vbgeneric sqlTrace]$ ./sample scott/tiger
Connected to ORACLE
Enter enter number (0 to quit): 1
res=1
Enter enter number (0 to quit): 2
SQLCODE=1403
Enter enter number (0 to quit): 3
SQLCODE=1403
Enter enter number (0 to quit): 1x
ORA-01722: invalid number => oops, program terminates
=> First it will show the list of SQL-Statements taking more than 1% of the time
0.058487130 1 sample.pc:32
0.002066788 4 sample.pc:47 select 1 into :b0 from dual where 1=:b1
0.000885475 1 sample.pc:17
=> Than it will show the last 20 SQL-Statements and the SQL-Code
SQLCODE:00000 sample.pc:32
SQLCODE:00000 sample.pc:47 select 1 into :b0 from dual where 1=:b1
SQLCODE:01403 sample.pc:47 select 1 into :b0 from dual where 1=:b1
SQLCODE:01403 sample.pc:47 select 1 into :b0 from dual where 1=:b1
SQLCODE:-1722 sample.pc:47 select 1 into :b0 from dual where 1=:b1
SQLCODE:00000 sample.pc:17
Download the code: https://github.com/frankth/sqlTrace
No comments:
Post a Comment