Wednesday, June 9, 2010

TKPROF Utility



1) TKPROF is an utility and a unix command to format Raw trace file which is huge in size. It essentially formats a trace file into a more readable format for performance analysis.

2) Trace files are placed by Oracle in user_dump_dest directory as specified in the init.ora
Use below query to find the location of trace files
select value from v$parameter
where name = 'user_dump_dest';


3) Use the following Unix command on the server:
TKPROF tracefile exportfile [explain=username/password] [table= …] [print= ] [insert= ] [sys= ] [record=..] [sort= ]

Eg- tkprof ora_12345.trc output.txt explain=scott/tiger sort=(prsela,exeela,fchela)
Here Sort is on elapsed parse time, elapsed executed time and elapsed fetch-time.

2 comments:

  1. getting an error tkprof not found
    what is the reason?

    ReplyDelete
  2. You need to set your environment properly like below

    export ORACLE_HOME=/user/oracle/product/102
    export PATH=$ORACLE_HOME/bin:$PATH
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

    ReplyDelete

Note: Only a member of this blog may post a comment.