Hello Friends, As in Oracle Application, there always need to tune programs , procedure and it is always difficult to make a perfect program, here i am trying to put a “How to” on tkprof and surely like to know if you find it useful.
How to Trace a Concurrent Request And Generate TKPROF File
Enable Tracing For The Concurrent Manager Program
-
Responsibility: System Administrator
-
Navigate: Concurrent > Program > Define
-
Query Concurrent Program
-
Select the Enable Trace Checkbox
Turn On Tracing
-
Responsibility: System Administrator
-
Navigate: Profiles > System
-
Query Profile Option Concurrent: Allow Debugging
-
Set profile to Yes
Run Concurrent Program With Tracing Turned On
-
Logon to the Responsibility that runs the Concurrent Program
-
In the Submit Request Screen click on Debug Options (B)
-
Select the Checkbox for SQL Trace
2. Find Trace File Name
Run the following SQL to find out the Raw trace name and location for the concurrent program. The SQL prompts the user for the request id
3. TKPROF Trace File
Once you have obtained the Raw trace file you need to format the file using TKPROF.
$tkprof raw_trace_file.trc output_file explain=apps/apps sort=(exeela,fchela) sys=no
raw_trace_file.trc: Name of trace file
output_file: tkprof out file
explain: This option provides the explain plan for the sql statements
sort: his provides the sort criteria in which all sql statements will be sorted. This will bring the bad sql at the top of the outputfile.
sys=no:Disables sql statements issued by user SYS
Another example: To get (TKPROF) sorted by longest running queries first and limits the results to the “Top 10″ long running queries
$ tkprof <filename.trc> <output_filename> sys=no explain=apps/<password> sort=’(prsela,exeela,fchela)’ print=10
Thanks – Shivmohan Purohit

RSS - Posts
Shiv on LinkedIn
Shivmohan on Oracle Community
Shivmohan on Orkut
6 responses so far ↓
Murali // October 1, 2008 at 1:31 am |
sir, It is fine but this script which you have given is to typical to under stand is there any another way to find the long running queries
Babu // November 8, 2008 at 6:07 am |
Hello,
Your sql query not running in 10g. Please doubel check this..
babu
santosh // March 11, 2009 at 1:32 am |
The script to be run in the unix to get the top 10 long running queries is
$ tkprof sys=no explain=apps/ sort sort=’(prsela,exeela,fchela)’
santosh // March 11, 2009 at 1:38 am |
hi babu
i have checked the query and it is wrk fine..
let me know the erro msg..
u might need to change the single codes….and then run it ..
it will wrk…
Harish // April 26, 2009 at 10:32 pm |
It is Helpful.
Regards,
Harish
satya // May 5, 2009 at 6:52 pm |
Sir
What u have given query is not running in10g.
could u explain brifly