SQL Trace & TKPROF

Generating a Trace File

Enable writing a trace file to the udump directory:

Current Session

ALTER SESSION SET sql_trace = TRUE;
or
execute dbms_session.set_sql_trace(true);

Different Session

execute dbms_system.set_sql_trace_in_session(sid, serial#, sql_trace);
e.g.
execute dbms_system.set_sql_trace_in_session(114, 4667, TRUE);

Tracing Options

See http://www.psoug.org/reference/trace_tkprof.html  for detailed list of tracing options.

Formatting the output with TKPROF

on a command prompt

TKPROF inputfile outputfile [OPTIONS]
e.g.
tkprof mydb_ora_11915.trc /tmp/tkprof1.txt SYS=NO

TKPROF Options

For a full list of options see Oracle9i Database Performance Tuning Guide and Reference, Section 10 Using SQL Trace and TKPROF 

     
Comments (0)