Tuesday, November 27, 2012

Enable PLSQL Trace with bindings

Sql commands to enable/disable trace in Oracle plsql session.


ALTER SESSION SET sql_trace = true;

ALTER SESSION SET tracefile_identifier = 'pm_test1trace';

--enable trace with bindings and wait
ALTER SESSION set events '10046 trace name context forever, level 12';

--set of plsql blocks to be traced
select * from cz_devl_projects where name like 'PM 10';

ALTER SESSION SET sql_trace = false;

select * from v$parameter where name like '%user%dest%';