Friday, November 7, 2014

How to generate a trace file for a SQL query

How to generate a trace file for a SQL query

set time on;

set timing on;

ALTER SESSION SET TRACEFILE_IDENTIFIER = "MY_TRACE2_SESSION";

ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';

SET SERVEROUTPUT ON

SELECT  * from emp;

ALTER SESSION SET EVENTS '10046 trace name context off';

No comments: