SQL Trace and TKPROF

TKPROF stands for transient kernel profiler.Enabling SQL TRACETo be able to use TKPROF, you must first enable sql trace. This can be done for either the instance or the session. If you want to change it for the entire instance, set sql_trace=true into theinit.ora file and restart the instance. However, usually, you’ll want to turn on sql trace for a particular session only. This can be done like so:

alter session set sql_trace=true;

or, from another session with a

sys.dbms_system.set_sql_trace_in_session(session's id,serial number, true)

Timed StatisticsYou can have Oracle include timing information into the sqltrace files as well. Either set the timed_statistics parameter to true or issue an

alter system set timed_statistics=true;

or

alter session set timed_statistics=true;

Finding the SQL trace fileThe trace files will be written into the directory pointed to by the parameter user_dump_dest. You can query for the value with select value from v$parameter where name = ‘user_dump_dest’.See find the trace file to see where the tk prof file goes.Format of the trace fileSee this link.Maximum size of the trace fileThe init parameter max_dump_file_size allows to set the maximum size of the trace files. Valid values for this parameter are: unlimited, a number followed by a K or a M or a number. If the value is a number only, it indicates how many OS Blocks the file can grow to. K or M set the file’s maximum size in kilo or mega bytes.Using tkprof

Follow the following links:

 

Follow

Get every new post delivered to your Inbox

Join other followers: