- Oracle-Developer.com -

 

Navigation: Discussion Forums (Get expert advice)  |  Publications  |  Scripts  |  About Us  | Links
 


Oracle Developer > Scripts > Generate tkprof in Oracle 10g
 

Tkprof is a very useful diagnostic tool provided by Oracle to analyze trace files.  After enabling the trace, you can generate a report summarizing the trace contents by using the tkprof utility.  Here is one example of how to use it.

In SQL Plus:
SQL> ALTER SESSION SET EVENTS '10046 trace name context forever, level 8'; -- 8 includes waits and 12 includes waits and binds
SQL> <execute your script>
SQL> ALTER SESSION SET EVENTS '10046 trace name context off';

On the Operating System:
cd <user_dump_dest> (find by select value from v$parameter where name = 'user_dump_dest')

tkprof <SID_ora_sessionId.trc> SID_ora_sessionId.prf waits=yes*
(other options explain=user/pass table=plan_table aggregate=no sys=no)

vi SID_ora_sessionId.prf
 

* If you encounter an error with using one of the options, check your Oracle tkprof client.  For example, in RAC environments I have seen the following error:

orcl> tkprof orcl_ora_19338.trc orcl_ora_19338.prf waits=yes
LRM-00101: unknown parameter name 'waits'
error during command line parsing, cannot continue.

This error was a result of having a 10g RAC database with the 8i tkprof utility from the Linux box. 



 

 

 

 

Sponsored by Varun Jain, Inc. Oracle Applications and Database Consulting

Copyright ©2007 Oracle-Developer.com