Trace a concurrent request and generate TKPROF file

on Monday, March 16, 2009

Steps to 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

Query to 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

SELECT
'Request id: 'request_id
,'Trace id: 'oracle_Process_id
,'Trace Flag: 'req.enable_trace
,'Trace Name: 'dest.value'/'lower(dbnm.value) '_ora_' oracle_process_id '.trc'
,'Prog. Name: 'prog.user_concurrent_program_name
,'File Name: 'execname.execution_file_name execname.subroutine_name
,'Status : 'decode(phase_code,'R','Running') '-'decode(status_code,'R','Normal')
,'SID Serial: 'ses.sid',' ses.serial#
, 'Module : 'ses.module
FROM
fnd_concurrent_requests req
,v$session ses
,v$process proc
,v$parameter dest
,v$parameter dbnm
,fnd_concurrent_programs_vl prog
,fnd_executables execname
WHERE
req.request_id = &request and
req.oracle_process_id=proc.spid(+) and
proc.addr = ses.paddr(+) and
dest.name='user_dump_dest' and
dbnm.name='db_name' and
req.concurrent_program_id = prog.concurrent_program_id and req.program_application_id = prog.application_id and
prog.application_id = execname.application_id and prog.executable_id=execname.executable_id

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.prf 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: This provides the sort criteria in which all sql statements will be sorted and would 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 sys=no explain=apps/ sort=’(prsela,exeela,fchela)’ print=10

Deleting a Scheduled Request

on

There is no standard functionality to delete any saved schedule.
The saved schedules are being stored in the table fnd_conc_release_classes_vl

SELECT
,release_class_id
,application_id
,release_class_name schedule_name
,description
,class_type schedule_type
FROM
fnd_conc_release_classes_vl
WHERE
owner_req_id is null and
enabled_flag != ‘N’ and
nvl(start_date_active,sysdate) <= sysdate and nvl(end_date_active, sysdate) >= sysdate
order by release_class_name

If you want to delete any saved schedule then you can perform any of the following:
Delete the row from the table FND_CONC_RELEASE_CLASSES_VL for the saved schedule.
OR
It will be better to update the ENABLED_FLAG = ‘N’ for the saved schedule instead of deleting the row
from the table FND_CONC_RELEASE_CLASSES_VL.