开发者

Oracle SQL trace with bind variables

开发者 https://www.devze.com 2023-01-05 13:14 出处:网络
How to aquire the full SQL statement with bind variables substituted from a trace file? When setting ALTER SESSION SET EVENTS \'10046 trace name context forever, level 4\';

How to aquire the full SQL statement with bind variables substituted from a trace file?

When setting

ALTER SESSION SET EVENTS '10046 trace name context forever, level 4';
ALTER SESSION SET sql_trace = true;

the resulting trace file contains the SQL query with bind variables and the resolution of the bind variables in a separate "BINDS" section. This is fine if there are a couple of bind variables. It's not very useful when I have 100+ bind variables.

Tkprof processes the trace file but does not support bind variables.

Is it possible to get the full SQL statements with the bind variables substituted so I can easily copy-paste and re-execute开发者_JS百科 it? Is there maybe a free tool that will process my trace file and output the full SQL statements?

I'd also appreciate a solution without SQL tracing using v$sql and friends instead.


You need to use Oracle trace analyzer instead of tkprof to extract actual values of bind variables. http://www.rampant-books.com/art_moore_oracle_trace_analyzer_trcanlzr_sql.htm

trace analyzer is going to replace eventually tkprof in future.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号