Wednesday, November 24, 2010

10046 trace , tkprof

Tracing sql using 10046 event




# set trace 10046 event and trace sql
connect to user using sqlplus
alter session set tracefile_identifier = e10046_literal_test3;
alter session set events '10046 trace name context forever, level 12';
run sql
alter session set events '10046 trace name context off';
exit from sqlplus


Generate report from the trace using tkprof

use tkprof from unix prompt
Generate tkprof output the 10046 trace files using following syntax (change the file name, username & password):
tkprof sys=no explain=/

sort options for tkprof

  • sort=exeqry,fchqry,prsqry
  • sort=exeela,exeqry,fchela,fchqry,prsela,prsqry
  • sort=exeela,fchela,prsela

Hope this helps. Regards Rupam