Concurrent Mangar Scripts
Concurrent Mangar Scripts
Concurrent Mangar Scripts
SCHEDULED REQUESTS
SET LINE 130 PAGESIZE 1000
COLUMN request_id FORMAT 999999999
COLUMN conc_prog_name FORMAT A47
COLUMN requestor FORMAT A18
COLUMN phase_code FORMAT A10 head 'Phase Code'
COLUMN status_code FORMAT A10 head 'Status Code'
COLUMN req_start_dt FORMAT A20 head 'Requested Start Date'
SELECT fcr.request_id
, SUBSTR(DECODE(fcp.user_concurrent_program_name, 'Report Set'
,fcp.user_concurrent_program_name || ' ' || fcr.description, fcp.user_concurrent_program_name),1,47) conc_prog_name
, fu.user_name requestor
, DECODE(fcr.phase_code, 'R'
,'Running', 'P'
,DECODE(fcr.hold_flag, 'Y'
,'Inactive', 'Pending'), 'C'
,'Completed', fcr.phase_code) phase_code
, DECODE(fcr.status_code, 'E'
,'Error', 'C'
,'Normal', 'X'
,'Terminated', 'Q'
,DECODE(fcr.hold_flag, 'Y'
,'On Hold', DECODE(SIGN(fcr.requested_start_date-SYSDATE),1
,'Scheduled','Standby')), 'D'
,'Cancelled', 'G'
,'Warning', 'R'
,'Normal', 'W'
,'Paused', 'T'
,'Terminating', 'R'
,'Normal', 'W'
,'Paused', 'T'
,'Terminating', 'I'
,'Scheduled', fcr.status_code) status_code
, TO_CHAR(fcr.requested_start_date,'DD-MON-YYYY Hh24:MI:SS') req_start_dt
FROM apps.fnd_user fu
, apps.fnd_concurrent_programs_vl fcp
, apps.fnd_concurrent_requests fcr
WHERE fcp.concurrent_program_id = fcr.concurrent_program_id
AND fcr.status_code IN ('Q', 'I')
AND fcr.phase_code = 'P'
AND fcr.requested_by = fu.user_id
ORDER BY 1
/
MV refresh
SELECT (process_end_time-process_start_time)*86400, cycle_start_time
FROM MARS.mars_batch_process_log
WHERE process_name='REFRESH MARS_BALANCES_GL_MV VIEW'
and trunc(cycle_start_time) >= trunc(sysdate-1)
ORDER BY log_seq DESC;
select release_name from apps.fnd_product_groups;
query$IAS_ORACLE_HOME/Apache/Apache/bin/httpd -version
$ORACLE_HOME/bin/rwrun | grep Release
Log in as Application user, set environment variable and run below query
grep jinit_ver_comma $CONTEXT_FILE
A. Log in as Application user, set environment variable and run below query
grep plugin $CONTEXT_FILE.
adident Header
or
strings | grep Header
*.pld are source code of *.pll which are inturn source of *.plx. *.pll is in $AU_TOP/resource and to find its version check
IGSAU012.pll:
or
$ORACLE_HOME/bin/oidldapd -version
Application Server
Oracle Application Server 10g Rel 3 (10.1.3.X)
Version=10.1.3.0.0
or
Set ORACLE_HOME
cd $ORACLE_HOME/j2ee/home
Oracle Portal
Database Component
To find database version
select * from v$version;
or
All component version in database
$ORACLE_HOME/OPatch/opatch lsinventory -detail
Unix Operating System
WHERE
trunc(d.last_update_date) = trunc(sysdate)
and d.user_name='SYSADMIN'
substr(f.user_name,1,10)||'~'||substr(d.last_update_date,1,10);
This is to list the Apps User who are assigned a particular responsibility
select a.user_name,b.responsibility_name
from
where
a.user_id = c.user_id
and
c.RESPONSIBILITY_ID = b.RESPONSIBILITY_ID
and
(c.END_DATE is null
or
group by a.USER_NAME,b.RESPONSIBILITY_NAME;
Users Connected through application (To get the list of users connected.)
SELECT user_name username,
description name,
FROM apps.fnd_user a,
FROM apps.icx_sessions
GROUP BY last_updated_by) b
AND last_connect>SYSDATE-3/12
ORDER BY 4 DESC
FROM apps.fnd_application fa
frt.responsibility_id, frt.responsibility_name
SELECT DISTINCT a.responsibility_name, c.user_menu_name
FROM apps.fnd_responsibility_tl a,
apps.fnd_responsibility b,
apps.fnd_menus_tl c,
apps.fnd_menus d,
apps.fnd_application_tl e,
apps.fnd_application f
WHERE a.responsibility_id(+) = b.responsibility_id
AND a.responsibility_id = ‘20538’
AND b.menu_id = c.menu_id
AND b.menu_id = d.menu_id
AND e.application_id = f.application_id
AND f.application_id = b.application_id
AND a.LANGUAGE = 'US';
SELECT c.prompt, c.description
FROM apps.fnd_menus_tl a, fnd_menu_entries_tl c
SELECT UNIQUE u.user_id, SUBSTR (u.user_name, 1, 30) user_name,
SUBSTR (r.responsibility_name, 1, 60) responsiblity,
SUBSTR (a.application_name, 1, 50) application
FROM fnd_user u,
fnd_user_resp_groups g,
fnd_application_tl a,
fnd_responsibility_tl r
WHERE g.user_id(+) = u.user_id
AND g.responsibility_application_id = a.application_id
AND a.application_id = r.application_id
AND g.responsibility_id = r.responsibility_id
ORDER BY SUBSTR (user_name, 1, 30),
SUBSTR (a.application_name, 1, 50),
SUBSTR (r.responsibility_name, 1, 60);
SELECT responsibility_name responsibility, request_group_name, frg.description
FROM fnd_request_groups frg, fnd_responsibility_vl frv
WHERE frv.request_group_id = frg.request_group_id
ORDER BY responsibility_name
SELECT t.user_profile_option_name, profile_option_value, v.creation_date,
v.last_update_date,
v.creation_date - v.last_update_date "Change Date",
(SELECT UNIQUE user_name
FROM fnd_user
WHERE user_id = v.created_by) "Created By",
(SELECT user_name
FROM fnd_user
FROM fnd_profile_options o,
fnd_profile_option_values v,
fnd_profile_options_tl t
WHERE o.profile_option_id = v.profile_option_id
AND o.application_id = v.application_id
AND start_date_active <= SYSDATE
AND NVL (end_date_active, SYSDATE) >= SYSDATE
AND o.profile_option_name = t.profile_option_name
AND level_id = 10001
AND t.LANGUAGE IN (SELECT language_code
FROM fnd_languages
WHERE installed_flag = 'B'
UNION
SELECT nls_language
FROM fnd_languages
WHERE installed_flag = 'B')
ORDER BY user_profile_option_name;
ffcr.description, ffcr.rule_type, ffcr.enabled, ffcr.trigger_event,
ffcr.trigger_object, ffcr.condition, ffcr.fire_in_enter_query,
(SELECT user_name
FROM fnd_user fu
WHERE fu.user_id = ffcr.created_by) "Created By "
FROM fnd_form_custom_rules ffcr, fnd_form_functions_vl ffft
WHERE ffcr.ID = ffft.function_id
ORDER BY 1;
SELECT a.application_name,
DECODE (b.status, 'I', 'Installed', 'S', 'Shared', 'N/A') status,
patch_level
FROM apps.fnd_application_vl a, apps.fnd_product_installations b
WHERE a.application_id = b.application_id;
SELECT function_id, user_function_name, creation_date, description
FROM applsys.fnd_form_functions_tl
order by order by user_function_name;
SELECT responsibility_name , frg.request_group_name,
fcpv.user_concurrent_program_name, fcpv.description
FROM fnd_request_groups frg,
fnd_request_group_units frgu,
fnd_concurrent_programs_vl fcpv,
fnd_responsibility_vl frv
WHERE frgu.request_unit_type = 'P'
AND frgu.request_group_id = frg.request_group_id
AND frgu.request_unit_id = fcpv.concurrent_program_id
AND frv.request_group_id = frg.request_group_id
ORDER BY responsibility_name;
SELECT fa.application_short_name, fcpv.user_concurrent_program_name,
description,
DECODE (fcpv.execution_method_code,
'Q', 'SQL*Plus',
'H', 'Host',
'L', 'SQL*Loader',
'A', 'Spawned',
'P', 'Oracle Reports',
'S', 'Immediate',
fcpv.execution_method_code
) exe_method,
output_file_type, program_type, printer_name, minimum_width,
minimum_length, concurrent_program_name, concurrent_program_id
FROM fnd_concurrent_programs_vl fcpv, fnd_application fa
WHERE fcpv.application_id = fa.application_id
ORDER BY description
SELECT fa.application_short_name,
DECODE (fcpv.execution_method_code,
'Q', 'SQL*Plus',
'H', 'Host',
'L', 'SQL*Loader',
'A', 'Spawned',
'P', 'Oracle Reports',
'S', 'Immediate',
fcpv.execution_method_code
) exe_method,
COUNT (concurrent_program_id) COUNT
FROM fnd_concurrent_programs_vl fcpv, fnd_application fa
WHERE fcpv.application_id = fa.application_id
GROUP BY fa.application_short_name, fcpv.execution_method_code
ORDER BY 1;
To calculate request time
SELECT f.request_id , pt.user_concurrent_program_name user_concurrent_program_name
, f.actual_start_date actual_start_date
, f.actual_completion_date actual_completion_date,
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600)/60)
round((((f.actual_completion_date-f.actual_start_date)*24*60*60) -
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600 -
(floor((((f.actual_completion_date-f.actual_start_date)*24*60*60) -
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600)/60)*60) ))
, DECODE(p.concurrent_program_name,'ALECDC',p.concurrent_program_name||'['||
f.description||']',p.concurrent_program_name) concurrent_program_name
, decode(f.phase_code,'R','Running','C','Complete',f.phase_code) Phase
, f.status_code
FROM apps.fnd_concurrent_programs p
, apps.fnd_concurrent_programs_tl pt
, apps.fnd_concurrent_requests f
WHERE f.concurrent_program_id = p.concurrent_program_id
and f.program_application_id = p.application_id
and f.concurrent_program_id = pt.concurrent_program_id
and f.program_application_id = pt.application_id
AND pt.language = USERENV('Lang')
and f.actual_start_date is not null
ORDER by f.actual_completion_date-f.actual_start_date desc;
Check responsibility assigned to a specific USER
FROM fnd_user u,
fnd_user_resp_groups g,
fnd_application_tl a,
fnd_responsibility_tl r
WHERE g.user_id(+) = u.user_id
FROM applsys.ad_applied_patches
We can use the below query to find the Manager name for a Concurrent Program
SELECT fcqc.INCLUDE_FLAG,
fcqc.QUEUE_APPLICATION_ID,
fcq.USER_CONCURRENT_QUEUE_NAME,
fcp.CONCURRENT_PROGRAM_NAME
FROM APPLSYS.FND_CONCURRENT_QUEUE_CONTENT fcqc,
APPLSYS.FND_CONCURRENT_PROGRAMS fcp,
APPS.FND_CONCURRENT_QUEUES_VL fcq
WHERE type_id = fcp.concurrent_program_id
AND fcp.concurrent_program_name = '&PROGRAM_SHORT_NAME'
AND fcq.concurrent_queue_id = fcqc.concurrent_queue_id;
-- end of requests.sql
-- end of requests_N.sql
-- end of requests_T.sql
4) SQL to find application_id
SELECT P.APPLICATION_ID,
decode(P.STATUS, 'I', 'Yes', 'S', 'Shared', 'N', 'No', P.status) inst_status,
A.APPLICATION_SHORT_NAME
FROM FND_PRODUCT_INSTALLATIONS P, FND_APPLICATION A
WHERE A.APPLICATION_ID=P.APPLICATION_ID;
5) requests_NT.sql - Find request run during a specific Request Name DURING a
specific time period - Edit times below
-- this is very valuable when you have performance degrades over time for specific
requests.
-- REQUIRED VALUES
-- 1. ENTER THE NAME when prompted - Suggest using % like Launch%Plan% for
finding Launch Supply Chain Plan
---- NOTE: This IS CASE SENSiTiVe
-- 2. Enter the start_time and end_time when prompted
-- 2.1 Date format example for start_time 01-JAN-2012 00:00:00
-- 2.2 Date format example for end_time 31-JAN-2012 23:59:00
-- The example above will find all requests for Launch%Plan% that launched for 31 day
range 01-JAN-12 to 31-JAN-12
-- end of requests_NT.sql
6) Find TMP log files when log is not written by the request process
-- When requests use this TMP file process, then this can help determine cause of
failure
-- REQUIRED VALUES
-- Enter request ID that failed to provide a log file to get location of TMP file created while
the request is running
select
c.value || '/' || p.plsql_log
from fnd_concurrent_processes P,
fnd_concurrent_requests R,
fnd_env_context C
where R.controlling_manager=P.concurrent_process_id
and P.concurrent_process_id=C.concurrent_process_id
and c.variable_name='APPLPTMP'
and r.request_id = &error_request_id
-- end requests_TMP.sql
7) requests_RAC.sql
-- Includes node information to know which RAC DB Node processed a request - refer to
Note 279156.1
-- REQUIRED VALUE - Enter the Request ID that launched the Request set being
investigated
SELECT
/*+ ORDERED USE_NL(x fcr fcp fcptl)*/
SUBSTR(fcr.request_id,1,10) "Request ID"
, SUBSTR(parent_request_id,1,10) "Parent ID"
, SUBSTR(fcptl.user_concurrent_program_name,1,40) "Program Name"
, FCPRC.NODE_NAME "DB Node" -- this is node that processed the request
, FCR.OUTFILE_NODE_NAME "Output file Node" -- this is the node where the
output files were processed
, fcr.phase_code
, fcr.status_code
, SUBSTR(TO_CHAR(fcr.actual_start_date,'DD-MON HH24:MI:SS'),1,16) "Start
Time"
, SUBSTR(TO_CHAR(fcr.actual_completion_date, 'DD-MON HH24:MI:SS'),1,16)
"End Time"
, TO_CHAR((fcr.actual_completion_date - fcr.actual_start_date)*1440,'9999.00')
"Elapsed"
, SUBSTR(fcr.oracle_process_id,1,10) "Trace ID"
, FCR.COMPLETION_TEXT
, 'cp ' || FCR.LOGFILE_NAME || ' .' LOGFILE
, 'cp ' || FCR.OUTFILE_NAME || ' .' OUTFILE
, 'cp ' || FEC.value || '/' || FCPRC.PLSQL_LOG || ' .' TMPLOG
, FCR.ARGUMENT_TEXT "Parameters"
FROM
(SELECT
/*+ index (fcr1 fnd_concurrent_requests_n3) */
fcr1.request_id
FROM
apps.fnd_concurrent_requests fcr1
WHERE
1 =1
START WITH fcr1.request_id =
(SELECT -- walk up the request family tree to the root
MIN(fcr2.request_id) root
FROM
apps.fnd_concurrent_requests fcr2
CONNECT BY fcr2.request_id = prior fcr2.parent_request_id
start with FCR2.REQUEST_ID = &Request_ID
-- amp child_request_id
) -- decending from the root, select all of the requests in the family
CONNECT BY PRIOR fcr1.request_id = fcr1.parent_request_id
)x
, apps.fnd_concurrent_requests fcr
, apps.fnd_concurrent_programs fcp
, APPS.FND_CONCURRENT_PROGRAMS_TL FCPTL
, APPS.FND_ENV_CONTEXT FEC
, APPS.FND_CONCURRENT_PROCESSES FCPRC
WHERE
fcr.request_id = x.request_id
AND fcr.concurrent_program_id = fcp.concurrent_program_id
AND fcr.program_application_id = fcp.application_id
AND fcp.application_id = fcptl.application_id
AND fcp.concurrent_program_id = fcptl.concurrent_program_id
and FCPTL.LANGUAGE = 'US'
and FEC.VARIABLE_NAME = 'APPLPTMP'
and FCR.CONTROLLING_MANAGER = FCPRC.CONCURRENT_PROCESS_ID
and FCPRC.CONCURRENT_PROCESS_ID = FEC.CONCURRENT_PROCESS_ID
ORDER BY
1;
-- END requests_RAC.sql
8) requests_HANG.sql
-- To find current running SQL text for a request with performance/hanging issues - refer
to Note 186472.1
-- prints all requests currently running for a request set or can be used for any single
running request
-- note that if no SQL is returned, then the process may be working in RAM Memory -
examples are MRP or ASCP Memory Based Planner process
-- REQUIRED VALUE - Enter the Request ID that launched the Request set being
investigated
select
request_id,
to_char(sid) sid
, to_char(serial#) serial#
, vq.sql_id SQLID
, vs.machine
, sql_text
, vs.process
from
apps.fnd_concurrent_requests fcr,
v$session vs,
v$sqltext vq
where
vs.process = fcr.os_process_id
and vs.sql_address = vq.address
and fcr.status_code = 'R'
and fcr.phase_code = 'R'
and request_id in
(select fcr.request_id
from (select /*+ index (fcr1 FND_CONCURRENT_REQUESTS_N3) */
fcr1.request_id
from fnd_concurrent_requests fcr1
where 1=1
start with fcr1.request_id = &request_id
connect by prior fcr1.request_id = fcr1.parent_request_id) x,
fnd_concurrent_requests fcr,
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcptl
where fcr.request_id = x.request_id
and fcr.concurrent_program_id = fcp.concurrent_program_id
and fcr.program_application_id = fcp.application_id
and fcp.application_id = fcptl.application_id
and fcp.concurrent_program_id = fcptl.concurrent_program_id
and fcptl.language = 'US')
order by request_id, serial#, piece;
-- END requests_HANG.sql
9) Longops_check.sql
-- Good for monitoring long running SQL session where single SQL ID is taking time OR
finding long running SQL on system
-- OR --
-- SQL process is known to take extensive time and want to monitor and get
calculated/potential time to complete
SELECT inst_id,
sid,
serial#,
sql_id,
opname,
target,
sofar,
totalwork,
start_time,
last_update_time,
ROUND(time_remaining /60,2) "REMAIN MINS",
ROUND(elapsed_seconds/60,2) "ELAPSED MINS",
ROUND((time_remaining+elapsed_seconds)/60,2) "TOTAL MINS",
ROUND(SOFAR /TOTALWORK*100,2) "%_COMPLETE",
MESSAGE
FROM gv$session_longops
WHERE OPNAME NOT LIKE 'RMAN%'
AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <>TOTALWORK
AND TIME_REMAINING > 0;
-- END Longops_check.sql
10) requests_orig.sql
-- REQUIRED VALUE - Enter the Request ID that launched the Request set being
investigated
Query to find the Parent and Child Concurrent Request with Run Details and Timings
Query:
SELECT
fcr.request_id "Child Request ID",
PARENT_REQUEST_ID "Parent Request ID",
fcptl.user_concurrent_program_name"Parent Program Name",
fcr.phase_code,
fcr.status_code,
to_char(fcr.actual_start_date,'DD-MON-YYYY HH24:MI:SS') "Start Time",
round((fcr.actual_completion_date - fcr.actual_start_date)*1440,2) "Elapsed Mins"
FROM (SELECT
fcr1.request_id
FROM apps.fnd_concurrent_requests fcr1
WHERE 1=1
START WITH fcr1.request_id = &Parent_request_id
CONNECT BY PRIOR fcr1.request_id = fcr1.parent_request_id) x,
apps.fnd_concurrent_requests fcr,
apps.fnd_concurrent_programs fcp,
apps.fnd_concurrent_programs_tl fcptl
WHERE fcr.request_id = x.request_id
AND fcr.concurrent_program_id = fcp.concurrent_program_id
AND fcr.program_application_id = fcp.application_id
AND fcp.application_id = fcptl.application_id
AND fcp.concurrent_program_id = fcptl.concurrent_program_id
AND fcptl.language = 'US'
ORDER BY 1;
Query to find Data Definition, Template File Name of a Concurrent Program in Oracle Apps
Query to find which all schema password will be changed when using ALLORACLE mode in
FNDCPASS
select * from fnd_oracle_userid where read_only_flag='A';
Query to find Total Concurrent Request Submitted on a Daily Basis
select trunc(request_date) "Date",count(1) "Total Request Completed" from
fnd_concurrent_requests where phase_code='C' group by trunc(request_date) order by 1
desc;
Query to find the Top Concurrent Job/Requests generating Big Output Files
SELECT
distinct fcr.request_id,
user_concurrent_program_name,
responsibility_name,
request_date,
argument_text,
request_id,
phase_code,
status_code,
logfile_name,
outfile_name,
output_file_type,
hold_flag,
user_name,
fcr.ofile_size,
fcp.creation_date
FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs_tl fcp,
fnd_responsibility_tl fr,
fnd_user fu
WHERE
fcr.CONCURRENT_PROGRAM_ID = fcp.concurrent_program_id
and fcr.responsibility_id = fr.responsibility_id
and fcr.requested_by = fu.user_id
and Phase_code='C'
and fcp.language='US'
and fcr.ofile_size is NOT NULL
ORDER BY fcr.ofile_size desc;
Query to find if we are connected to Run or Patch Database Edition on EBS12.2
SQL> select ad_zd.get_edition_type from dual;
Query to find full Access Details for Users in EBS/Oracle App
SELECT
distinct fu.user_name "User_Name",
fu.end_date "User_End_Date",
frt.responsibility_name "Responsibility_Name",
fat.application_name "Application_Name",
furg.start_date "Responsibility_Start_Date",
furg.end_date "Responsibility_End_Date",
fu.last_update_date "Last Updated Date",
(SELECT user_name
FROM fnd_user
WHERE user_id = fu.last_updated_by) "Last Update By"
FROM
fnd_user_resp_groups_direct furg,
applsys.fnd_user fu,
applsys.fnd_responsibility_tl frt,
applsys.fnd_responsibility fr,
applsys.fnd_application_tl fat,
applsys.fnd_application fa
WHERE
furg.user_id = fu.user_id
AND
furg.responsibility_id = frt.responsibility_id
AND
fr.responsibility_id = frt.responsibility_id
AND
fa.application_id = fat.application_id
AND
fr.application_id = fat.application_id
and fat.language='US'
and frt.language='US'
ORDER BY 1;
Concurrent Manager Scripts
Oracle supplies several useful scripts, (located in $FND_TOP/sql directory), for monitoring the
concurrent managers:
afcmstat.sql Displays all the defined managers, their maximum capacity, pids, and their status.
Displays the status of ICM and PMON method in effect, the ICM’s log file, and
afimchk.sql
determines if the concurrent manger monitor is running.
Displays the concurrent manager and the name of its log file that processed a
afcmcreq.sql
request.
afrqwait.sql Displays the requests that are pending, held, and scheduled.
Displays of summary of concurrent request execution time and status since a
afrqstat.sql
particular date.
Displays the operating system process id of the FNDLIBR process based on a
afqpmrid.sql
concurrent request id. The process id can then be used with the ORADEBUG utility.
Displays the process id, terminal, and process id that may be causing locks that the
ICM and CRM are waiting to get. You should run this script if there are long delays
afimlock.sql
when submitting jobs, or if you suspect the ICM is in a gridlock with another oracle
process.
Script’s to find concurrent request
###HISTORY OF CONCURRENT REQUEST – SCRIPT (PROGRAM WISE) ###
set pagesize 200
set linesize 200
col “Who submitted” for a25
col “Status” for a10
col “Parameters” for a20
col USER_CONCURRENT_PROGRAM_NAME for a42
SELECT distinct t.user_concurrent_program_name,
r.REQUEST_ID,
to_char(r.ACTUAL_START_DATE,’dd-mm-yy hh24:mi:ss’) “Started at”,
to_char(r.ACTUAL_COMPLETION_DATE,’dd-mm-yy hh24:mi:ss’) “Completed at”,
decode(r.PHASE_CODE,’C’,’Completed’,’I’,’Inactive’,’P ‘,’Pending’,’R’,’Running’,’NA’)
phasecode,
decode(r.STATUS_CODE, ‘A’,’Waiting’, ‘B’,’Resuming’, ‘C’,’Normal’, ‘D’,’Cancelled’,
‘E’,’Error’, ‘F’,’Scheduled’, ‘G’,’Warning’, ‘H’,’On Hold’, ‘I’,’Normal’, ‘M’,
‘No Manager’, ‘Q’,’Standby’, ‘R’,’Normal’, ‘S’,’Suspended’, ‘T’,’Terminating’,
‘U’,’Disabled’, ‘W’,’Paused’, ‘X’,’Terminated’, ‘Z’,’Waiting’) “Status”,r.argument_text
“Parameters”,substr(u.description,1,25) “Who
submitted”,round(((nvl(v.actual_completion_date,sysdate)-
v.actual_start_date)*24*60)) Etime
FROM
apps.fnd_concurrent_requests r ,
apps.fnd_concurrent_programs p ,
apps.fnd_concurrent_programs_tl t,
apps.fnd_user u, apps.fnd_conc_req_summary_v v
WHERE
r.CONCURRENT_PROGRAM_ID = p.CONCURRENT_PROGRAM_ID
AND r.actual_start_date >= (sysdate-30)
–AND r.requested_by=22378
AND r.PROGRAM_APPLICATION_ID = p.APPLICATION_ID
AND t.concurrent_program_id=r.concurrent_program_id
AND r.REQUESTED_BY=u.user_id
AND v.request_id=r.request_id
–AND r.request_id =’2260046′ in (‘13829387′,’13850423’)
and t.user_concurrent_program_name like ‘%%’
order by to_char(r.ACTUAL_COMPLETION_DATE,’dd-mm-yy hh24:mi:ss’);
FROM fnd_concurrent_requests
d.sid as Oracle_SID,
d.serial#,
d.osuser,
d.process,
c.SPID as OS_Process_ID
FROM apps.fnd_concurrent_requests a,
apps.fnd_concurrent_processes b,
gv$process c,
gv$session d
fnd_concurrent_queues_vl b, fnd_concurrent_requests c
set num 10
‘E’, ‘Error’ , ‘G’, ‘Warning’, ‘H’,’On Hold’ , ‘T’, ‘Terminating’, ‘M’, ‘No Manager’ , ‘X’,
‘Terminated’, ‘C’, ‘Normal’, status_code) status_code, to_char(actual_start_date,’dd-mon-
yy:hh24:mi:ss’) Start_Date, to_char(actual_completion_date,’dd-mon-yy:hh24:mi:ss’),
completion_text FROM apps.fnd_conc_req_summary_v WHERE request_id = ‘&req_id’
ORDER BY 6 DESC;
###To find the sql query for a given concurrent request sid###
select sid,sql_text from gv$session ses, gv$sqlarea sql where
SELECT sum.request_id,req.PARENT_REQUEST_ID,sum.user_concurrent_program_name,
DECODE(sum.phase_code,’C’,’Completed’,sum.phase_code) phase_code,
DECODE(sum.status_code,’D’, ‘Cancelled’ ,
‘E’, ‘Error’ , ‘G’, ‘Warning’, ‘H’,’On Hold’ , ‘T’, ‘Terminating’, ‘M’, ‘No Manager’ , ‘X’,
‘Terminated’, ‘C’, ‘Normal’, sum.status_code) status_code, sum.actual_start_date,
sum.actual_completion_date, sum.completion_text FROM
apps.fnd_conc_req_summary_v sum, apps.fnd_concurrent_requests req where
req.request_id=sum.request_id and req.PARENT_REQUEST_ID =
‘&parent_concurrent_request_id’;
update fnd_concurrent_requests
set status_code=’D’, phase_code=’C’
where request_id=&req_id;
–by program_id
update fnd_concurrent_requests
where CONCURRENT_PROGRAM_ID=&prg_id;
,a.phase_code,a.status_code
, actual_start_date
, actual_completion_date
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_concurrent_programs_tl ctl
ORDER BY 5 DESC;
### Find out Concurrent Program which enable with trace###
col User_Program_Name for a40
SUBSTR(A.USER_CONCURRENT_PROGRAM_NAME,1,40) “User_Program_Name”,
SUBSTR(B.USER_NAME,1,15) “Last_Updated_By”,
SUBSTR(B.DESCRIPTION,1,25) DESCRIPTION
WHERE A.ENABLE_TRACE=’Y’
AND A.LAST_UPDATED_BY=B.USER_ID;
decode(status_code,’A’,’Waiting’,’B’,’Resuming’,’C’,’Normal’,’D’,’Cancelled’,’E’,’Error’,’F’,
‘Scheduled’,’G’,’Warning’,’H’,’On Hold’,’I’,’Normal’,’M’,’No
Manager’,’Q’,’Standby’,’R’,’Normal’,’S’,
‘Suspended’,’T’,’Terminating’,’U’,’Disabled’,’W’,’Paused’,’X’,’Terminated’,’Z’,’Waiting’) “
fnd_concurrent_worker_requests
and requested_start_date<=sysdate
group by
user_CONCURRENT_PROGRAM_NAME,
concurrent_queue_name,priority,phase_code,status_code
###Lists the Manager Names with the No. of Requests in Pending/Running ###
col “USER_CONCURRENT_QUEUE_NAME” format a40;
SELECT a.USER_CONCURRENT_QUEUE_NAME,a.MAX_PROCESSES,
sum(decode(b.PHASE_CODE,’P’,decode(b.STATUS_CODE,’Q’,1,0),0)) Pending_Standby,
sum(decode(b.PHASE_CODE,’P’,decode(b.STATUS_CODE,’I’,1,0),0)) Pending_Normal,
sum(decode(b.PHASE_CODE,’R’,decode(b.STATUS_CODE,’R’,1,0),0)) Running_Normal
AND b.Requested_Start_Date<=SYSDATE
GROUP BY a.USER_CONCURRENT_QUEUE_NAME,a.MAX_PROCESSES;
DECLARE
running_count NUMBER := 0;
pending_count NUMBER := 0;
crm_pend_count NUMBER := 0;
–get the list of all conc managers and max worker and running workers
CURSOR conc_que IS
SELECT concurrent_queue_id,
concurrent_queue_name,
user_concurrent_queue_name,
max_processes,
running_processes
FROM apps.fnd_concurrent_queues_vl
BEGIN
DBMS_OUTPUT.PUT_LINE(‘==================================================
==================================================’);
DBMS_OUTPUT.PUT_LINE(‘==================================================
==================================================’);
FOR i IN conc_que
LOOP
–for each manager get the number of pending and running requests in each queue
FROM fnd_concurrent_worker_requests
WHERE
–for each manager get the list of requests pending due to conflicts in each manager
INTO crm_pend_count
FROM apps.fnd_concurrent_worker_requests a
WHERE concurrent_queue_id = 4
AND exists (
SELECT ‘x’
FROM apps.fnd_concurrent_worker_requests b
WHERE a.request_id=b.request_id
DBMS_OUTPUT.PUT_LINE(
rpad(i.concurrent_queue_id,8,’_’)||
rpad(i.concurrent_queue_name,15, ‘ ‘)||
rpad(i.user_concurrent_queue_name,40,’ ‘)||
rpad(i.max_processes,6,’ ‘)||
rpad(i.running_processes,6,’ ‘)||
rpad(running_count,10,’ ‘)||
rpad(pending_count,10,’ ‘)||
rpad(crm_pend_count,10,’ ‘));
–
DBMS_OUTPUT.PUT_LINE(‘————————————————————————————
—————-‘);
END LOOP;
DBMS_OUTPUT.PUT_LINE(‘==================================================
==================================================’);
END;
set verify on
set echo on
Analyzer.sql
----------------------------------------------------------------------------------------
--
-- analyzereq.sql
--
--
--
--
-- $Log: analyzereq.sql,v $
--
--
--
--
--
-- Initial revision
--
--
--
----------------------------------------------------------------------------------------
set serveroutput on
prompt
DECLARE
c_status fnd_lookups.meaning%TYPE;
BEGIN
INTO c_status
FROM fnd_lookups
return rtrim(c_status);
END get_status;
c_phase fnd_lookups.meaning%TYPE;
BEGIN
INTO c_phase
FROM fnd_lookups
return rtrim(c_phase);
END get_phase;
cd_id in number,
decode(control_code,
'T','N', -- Abort
'X','N', -- Aborted
'D','N', -- Deactivate
'E','N', -- Deactivated
'Y') active
from fnd_concurrent_worker_requests
and not((queue_application_id = 0)
run_alone_flag varchar2(1);
begin
mgr_defined := FALSE;
mgr_active := FALSE;
mgr_workshift := FALSE;
mgr_running := FALSE;
mgr_defined := TRUE;
mgr_active := TRUE;
mgr_workshift := TRUE;
end if;
mgr_running := TRUE;
end if;
end if;
end loop;
else
select runalone_flag
into run_alone_flag
from fnd_conflicts_domain d
end if;
run_alone := TRUE;
else
run_alone := FALSE;
end if;
end manager_check;
'D', fl.meaning,
'E', fl.meaning,
'N', fl.meaning,
'R', fl.meaning,
'T', fl.meaning,
'U', fl.meaning,
'V', fl.meaning,
'X', fl.meaning,
NULL, 'Running',
BEGIN
end loop;
END print_mgrs;
reqinfo fnd_concurrent_requests%ROWTYPE;
proginfo fnd_concurrent_programs_vl%ROWTYPE;
c_status fnd_lookups.meaning%TYPE;
m_buf fnd_lookups.meaning%TYPE;
conc_prog_name fnd_concurrent_programs.concurrent_program_name%TYPE;
exe_method_code fnd_concurrent_programs_vl.execution_method_code%TYPE;
conc_app_name fnd_application_vl.application_name%TYPE;
tmp_id number(15);
tmp_status fnd_concurrent_requests.status_code%TYPE;
tmp_date date;
conc_app_id fnd_concurrent_requests.program_application_id%TYPE;
conc_id fnd_concurrent_requests.concurrent_program_id%TYPE;
conc_cd_id fnd_concurrent_requests.cd_id%TYPE;
v_enabled_flag fnd_concurrent_programs.enabled_flag%TYPE;
conflict_domain fnd_conflicts_domain.user_cd_name%TYPE;
parent_id number(15);
resp_name varchar2(100);
rclass_name fnd_concurrent_request_class.request_class_name%TYPE;
exe_file_name fnd_executables.execution_file_name%TYPE;
c_user fnd_user.user_name%TYPE;
last_user fnd_user.user_name%TYPE;
fcd_phase varchar2(48);
fcd_status varchar2(48);
traid fnd_concurrent_requests.program_application_id%TYPE;
trcpid fnd_concurrent_requests.concurrent_program_id%TYPE;
icount number;
ireqid fnd_concurrent_requests.request_id%TYPE;
pcode fnd_concurrent_requests.phase_code%TYPE;
scode fnd_concurrent_requests.status_code%TYPE;
live_child boolean;
mgr_defined boolean;
mgr_active boolean;
mgr_workshift boolean;
mgr_running boolean;
run_alone boolean;
mgrname fnd_concurrent_queues_vl.user_concurrent_queue_name%TYPE;
filename varchar2(255);
qcf fnd_concurrent_programs.queue_control_flag%TYPE;
REQ_NOTFOUND exception;
CURSOR c_wait IS
FROM fnd_concurrent_requests
CURSOR c_inc IS
FROM fnd_concurrent_program_serial
CURSOR c_ireqs IS
FROM fnd_concurrent_requests
phase_code, status_code
FROM fnd_concurrent_requests
BEGIN
BEGIN
SELECT *
INTO reqinfo
FROM fnd_concurrent_requests
EXCEPTION
raise REQ_NOTFOUND;
END;
DBMS_OUTPUT.PUT_LINE(sep);
-- Program information
DBMS_OUTPUT.PUT_LINE('Program information:');
SELECT fvl.*
INTO proginfo
INTO conc_app_name
DBMS_OUTPUT.PUT_LINE('Application: '||conc_app_name);
INTO m_buf
FROM fnd_lookups
INTO exe_file_name
FROM fnd_executables
into rclass_name
from fnd_concurrent_request_class
end if;
end if;
end if;
DBMS_OUTPUT.PUT_LINE(sep);
DBMS_OUTPUT.PUT_LINE('
');
DBMS_OUTPUT.PUT_LINE(sep);
-- Submission information
DBMS_OUTPUT.PUT_LINE('Submission information:');
begin
exception
begin
exception
end;
SELECT responsibility_name
INTO resp_name
FROM fnd_responsibility_vl
c_status := get_status(reqinfo.status_code);
DBMS_OUTPUT.PUT_LINE(sep);
DBMS_OUTPUT.PUT_LINE('
');
DBMS_OUTPUT.PUT_LINE(sep);
-- Analysis
DBMS_OUTPUT.PUT_LINE('Analysis:');
-- Completed Requests
-------------------------------------------------------------------------------------------------------------
nvl(to_char(reqinfo.actual_completion_date, 'DD-MON-RR
HH24:MI:SS'),
'-- NO COMPLETION
DATE --'));
BEGIN
SELECT user_concurrent_queue_name
INTO mgrname
FROM fnd_concurrent_queues_vl
SELECT queue_control_flag
INTO qcf
FROM fnd_concurrent_programs
ELSE
END IF;
END;
INTO filename
FROM dual;
INTO filename
FROM dual;
-------------------------------------------------------------------------------------------------------------
nvl(to_char(reqinfo.actual_start_date, 'DD-MON-RR
HH24:MI:SS'),
BEGIN
SELECT user_concurrent_queue_name
INTO mgrname
FROM fnd_concurrent_queues_vl
EXCEPTION
null;
END;
INTO filename
FROM dual;
INTO filename
FROM dual;
END IF;
END LOOP;
-- Paused, check and see if it is a request set, and if its children are running
INTO conc_prog_name
FROM fnd_concurrent_programs
END IF;
IF instr(conc_prog_name, 'RSSUB') > 0 THEN
END IF;
live_child := FALSE;
live_child := TRUE;
END IF;
END LOOP;
END IF;
END IF;
-- Pending Requests
-------------------------------------------------------------------------------------------------------------
SELECT queue_control_flag
INTO qcf
FROM fnd_concurrent_programs
GOTO diagnose;
END IF;
-- why is it pending?
-- could be scheduled
GOTO diagnose;
END IF;
-- could be on hold
GOTO diagnose;
END IF;
-- could be disabled
GOTO diagnose;
END IF;
-- check queue_method_code
-- unconstrained requests
FROM fnd_conc_req_summary_v
IF parent_id = -1 THEN
ELSE
END IF;
ELSE
END IF;
-- constrained requests
INTO parent_id
FROM fnd_conc_req_summary_v
IF parent_id = -1 THEN
END IF;
ELSE
END IF;
-- incompatible programs
FROM fnd_concurrent_requests
icount := 0;
traid := progs.to_run_application_id;
trcpid := progs.to_run_concurrent_program_id;
OPEN c_ireqs;
LOOP
icount := icount + 1;
END LOOP;
CLOSE c_ireqs;
END LOOP;
IF icount = 0 THEN
END IF;
END IF;
-- single threaded
reqlimit := true;
END IF;
-- request limit
reqlimit := true;
END IF;
END LOOP;
END IF;
ELSE
DBMS_OUTPUT.PUT_LINE('** This request will not be run. You may need to apply patch
739644.');
GOTO diagnose;
END IF;
DBMS_OUTPUT.PUT_LINE(sep);
begin
exception
end;
DBMS_OUTPUT.PUT_LINE('There are one or more managers defined that can run this
request, but none of them are currently active');
print_mgrs(p_req_id);
print_mgrs(p_req_id);
ELSE
print_mgrs(p_req_id);
END IF;
ELSE
END IF;
<<diagnose>>
DBMS_OUTPUT.PUT_LINE(sep);
EXCEPTION
BEGIN
analyze_request(req_id);
END;
prompt
exit
spool off
Script Provides the Count of Requests Completed and Canceled
REM
####################################################################
#####
REM ## Purpose: Script provides the count of requests completed and
canceled.
REM ## Filename: request_count_completedcancelled.sql
REM ## Certified for Application releases 11.5 through 12.x
REM ## Document: <nnnnnn.1>
REM ## Usage: sqlplus apps/<appspwd>
@request_count_completedcancelled.sql
REM ## Output: request_count_completedcancelled.lst
REM ##
REM
####################################################################
#####
set pages 10000
set lines 180
set verify off
break on report
compute sum of Executions on report
set pages 10000
set lines 180
set verify off
column program_name format a50
column request_id format 99999999 heading 'REQUEST'
column st_dt format date
spool completedcancelledrequestcount.lst
select
p.user_concurrent_program_name Program_name,
to_date(r.actual_start_date,'DD-MON-YYYY') Date_of_exec,
count(r.request_id) Executions,
avg((nvl(r.actual_completion_date,sysdate) -
r.actual_start_date) * 24 * 60) Avg_run_time,
min((nvl(r.actual_completion_date,sysdate) -
r.actual_start_date) * 24 * 60) Min_run_time,
max((nvl(r.actual_completion_date,sysdate) -
r.actual_start_date) * 24 * 60) Max_run_time
from
apps.fnd_concurrent_requests r,
apps.fnd_concurrent_processes c,
apps.fnd_concurrent_queues q,
apps.fnd_concurrent_programs_vl p
where
p.concurrent_program_id = r.concurrent_program_id
and p.application_id = r.program_application_id
and c.concurrent_process_id = r.controlling_manager
and q.concurrent_queue_id = c.concurrent_queue_id
and p.application_id = '&appl_id'
and r.status_code = 'D'
and r.phase_code = 'C'
and to_char(r.actual_start_date,'DD-MON-YYYY')='&begin_date'
group by
p.user_concurrent_program_name,to_date(r.actual_start_date,'DD-MON-
YYYY')
order by to_date(r.actual_start_date,'DD-MON-YYYY') asc
/
spool off
Elapsed Time History for All Requests Run for a Given Time Period
REM
REM
REM Elapsed time history for all requests run for a given time
period.
REM
REM To help assign requests that always run fast to one queue, and
slow requests to a slow queue
REM
REM
rem set timing off
rem set heading off
set verify off
rem set show off
rem set echo off
set feedback off
set pagesize 500
set linesize 250
column elapsed format 999.99 heading 'TOTAL|HOURS';
column average format 99.99 heading 'AVG|HOURS';
column max format 99.99 heading 'MAX|HOURS';
column min format 99.99 heading 'MIN|HOURS';
column waited format 99999.99 heading '#WAITED|HOURS';
column avewait format 9999.99 heading 'AVG|WAIT';
column program format a20 heading 'PROGRAM';
column description format a55;
column cnt format 999,999 heading '#TIMES|RUN';
column app format a6 heading 'APP';
break on report
compute sum of cnt on report
compute sum of elapsed on report
compute sum of waited on report
column stddev format 999.99 heading 'RUN|STDDEV';
column wstddev format 999.99 heading 'WAIT|STDDEV'
column type format a15 heading 'TYPE'
column priority format 999 heading 'PRI'
column concurrent_queue_name format a14 heading 'Concurrent Mgr'
trunc
select
f.application_short_name app,
substr(p.user_concurrent_program_name,1,55) description,
substr(p.concurrent_program_name,1,20) program,
r.priority,
count(*) cnt,
sum(actual_completion_date - actual_start_date) * 24 elapsed,
avg(actual_completion_date - actual_start_date) * 24 average,
max(actual_completion_date - actual_start_date) * 24 max,
min(actual_completion_date - actual_start_date) * 24 min,
stddev(actual_completion_date - actual_start_date) * 24 stddev,
stddev(actual_start_date -
greatest(r.requested_start_date,r.request_date)) * 24 wstddev,
sum(actual_start_date -
greatest(r.requested_start_date,r.request_date)) * 24 waited,
avg(actual_start_date -
greatest(r.requested_start_date,r.request_date)) * 24 avewait,
c.request_class_name type
from apps.fnd_concurrent_request_class c,
apps.fnd_application f,
apps.fnd_concurrent_programs_vl p,
apps.fnd_concurrent_requests r
where r.program_application_id = p.application_id
and r.concurrent_program_id = p.concurrent_program_id
and r.status_code in ('C','G') -- maybe 'E' also
and r.phase_code = 'C'
and actual_completion_date between to_date('&&begindate') and
to_date('$$enddate')
and p.application_id = f.application_id
and r.program_application_id = f.application_id
and r.request_class_application_id = c.application_id(+)
and r.concurrent_request_class_id = c.request_class_id(+)
group by
c.request_class_name,
f.application_short_name,
p.concurrent_program_name,
p.user_concurrent_program_name,
r.priority
/
clear breaks
Select for Providing Frequency/Volume Analysis Program Name, Queue Name, and Count by
Program Name and Date Range
REM select statement to pull Program Name, Queue Name, and Count
by program name and date range for frequency/volume analysis
REM
Request Volume Per Day Select which can be Modified with Additions to the Where Clause
REM Request Volume Per Day Select which can be modified with
additions to the where clause
REM
undefine start_date
undefine end_date
select
p.user_concurrent_program_name program_name,
count(r.request_id),
avg((nvl(r.actual_completion_date,sysdate) -
r.actual_start_date) * 24 * 60) avg_run_time,
min((nvl(r.actual_completion_date,sysdate) -
r.actual_start_date) * 24 * 60) min_run_time,
max((nvl(r.actual_completion_date,sysdate) -
r.actual_start_date) * 24 * 60) max_run_time
from
apps.fnd_concurrent_requests r,
apps.fnd_concurrent_processes c,
apps.fnd_concurrent_queues q,
apps.fnd_concurrent_programs_vl p
where
p.concurrent_program_id = r.concurrent_program_id
and p.application_id = r.program_application_id
and c.concurrent_process_id = r.controlling_manager
and q.concurrent_queue_id = c.concurrent_queue_id
and p.application_id >= &&ApplicationId
and r.actual_start_date >= sysdate-31
and r.status_code = 'C'
and r.phase_code in ('C')
and (nvl(r.actual_completion_date,r.actual_start_date) -
r.actual_start_date) * 24 * 60 > 30
and p.user_concurrent_program_name not like 'Gather%Statistics%'
and (
(nvl(r.actual_completion_date,r.actual_start_date) -
r.actual_start_date) * 24 > 16
or
(r.actual_start_date-trunc(r.actual_start_date)) * 24 between
9 and 17
or
(r.actual_completion_date-trunc(r.actual_completion_date)) *
24 between 9 and 17
)
group by p.user_concurrent_program_name
/
Select Providing Request ID's for Requests that are Currently Running
alter session set nls_date_format='dd-mon-yy hh24:mi:ss';
SEt linesize 200
set pagesize 2000
col "Secondswait" format 9999 wrap heading 'SWait' print
col "WaitEvent" format a12 wrap heading 'Waiting|On Event' print
col "Session Wait" format a12 wrap heading 'file#|block#|
id(Reason)' print
Column Manager Format A12 trunc heading 'Manager|Queue' print
col "ServerClient" format a7 heading 'Server|Client' print
col "SidSerialSQLHash" format a10 heading 'Sid|Serial#|SQLHash'
print
col "DBPhaseStatusCODEUser" format a10 heading 'UserName|CP
PhSCode|Db Status' print
col Request_id Format a10 heading 'RequestID|PriorityID|ParentID'
print wrap
col "RequestStartDate" Format a10 heading 'ReqStart|Minutes' print
column concurrent_program_name format a25 heading 'CCM Short|Name'
noprint
column user_concurrent_program_name format a20 wrap heading
'Concurrent|Program Name' print
column ARGUMENT_TEXT format a15 heading 'CCM Arguments' print
column "SQLHASH" format 9999999999 heading 'SQL|HASH' print
column CONCURRENT_QUEUE_ID format 99999 heading 'CCM |Queue ID'
print
column QUEUE_DESCRIPTION format a20 heading 'CCM |Queue Name'
noprint
select
w.seconds_in_wait "Secondswait",
w.event "waitEvent",
w.p1||chr(10)||w.p2||chr(10)||w.p3 "Session Wait",
p.spid||chr(10)||s.process "ServerClient",
s.sid||chr(10)||s.serial#||chr(10)||s.sql_hash_value
"SidSerialSQLHash",
u.user_name||chr(10)||PHASE_CODE||' '||STATUS_CODE||chr(10)||
s.status "DBPhaseStatusCODEUser",
Request_id||chr(10)||priority_request_id||chr(10)||
Parent_request_id "Request_id",
concurrent_program_name,
user_concurrent_program_name,
requested_start_Date||chr(10)||round((sysdate-
requested_start_date)*1440, 2)||'M' "RequestStartDate",
ARGUMENT_TEXT,
CONCURRENT_QUEUE_ID,
QUEUE_DESCRIPTION
FROM
FND_CONCURRENT_WORKER_REQUESTS,
fnd_user u,
v$session s,
v$process p,
v$session_wait w
WHERE
-- nvl(request_type, 'X') != 'S' and
-- (request_id = &&request_id)
(Phase_Code='R')
and hold_flag != 'Y'
and Requested_Start_Date <= SYSDATE
AND ('' IS NULL OR ('' = 'B' AND PHASE_CODE = 'R' AND STATUS_CODE IN
('I', 'Q')))
and '1' in (0,1,4)
and requested_by=u.user_id
and s.paddr=p.addr
and s.sid=w.sid
and oracle_process_id = p.spid
and oracle_session_id = s.audsid
order by requested_start_date
;
--and request_id=&&request_id;
For example the following unix process id was consuming high CPU 25807.
2. Attach to the process using ORADEBUG.
I. Using the Oracle process identifier:
Unix process pid: 25807, image: oracle
Oracle pid: 8, Unix process pid: 25807, image: oracle
3. Turn on SQL Trace for the session and the trace file name as follows:
Statement processed.
4. Turn off the SQL trace for the session.
This listed the sql which was consuming CPU.
Query to check the setting of the ICM in the Concurrent Manager environment
from apps.fnd_env_context
UNION ALL
UNION ALL
from apps.fnd_profile_options p,
apps.fnd_profile_option_values v
UNION ALL
Query to check the details for all the enabled Concurrent Manager
fcq.concurrent_queue_name, fcq.user_concurrent_queue_name
"Service",
fcq.max_processes "Target",
sleep_seconds
set pages 0
from apps.fnd_concurrent_queue_content c,
apps.fnd_concurrent_queues_vl q,
UNION ALL
from apps.fnd_concurrent_queue_content c,
apps.fnd_concurrent_queues_vl q,
apps.fnd_application_vl a, apps.fnd_lookups l1
UNION ALL
from apps.fnd_concurrent_queue_content c,
apps.fnd_concurrent_queues_vl q,
apps.fnd_concurrent_complex_rules x,
UNION ALL
from apps.fnd_concurrent_queue_content c,
apps.fnd_concurrent_queues_vl q,
apps.fnd_concurrent_request_class r,
UNION ALL
select q.application_id,
q.concurrent_queue_name,q.user_concurrent_queue_name
"Manager", l1.meaning "Action", l2.meaning "Type",
o.oracle_username "Object"
from apps.fnd_concurrent_queue_content c,
apps.fnd_concurrent_queues_vl q, apps.fnd_oracle_userid o,
UNION ALL
select q.application_id,
q.concurrent_queue_name,q.user_concurrent_queue_name
"Manager", l1.meaning "Action", l2.meaning "Type", u.user_name
"Object"
from apps.fnd_concurrent_queue_content c,
apps.fnd_concurrent_queues_vl q, apps.FND_OAM_FNDUSER_VL u,
UNION ALL
select q.application_id,
q.concurrent_queue_name,q.user_concurrent_queue_name
"Manager", l1.meaning "Action", l2.meaning "Type",
to_char(c.type_id) "Object"
from apps.fnd_concurrent_queue_content c,
apps.fnd_concurrent_queues_vl q,
select fcq.application_id,
fcq.concurrent_queue_name,
fcq.user_concurrent_queue_name,
ftp.application_id,
ftp.concurrent_time_period_name,
fa.application_short_name,
ftp.description,
fcqs.min_processes,
fcqs.max_processes,
fcqs.sleep_seconds,
fcqs.service_parameters
apps.fnd_concurrent_queue_size fcqs,
apps.fnd_concurrent_time_periods ftp,
apps.fnd_application fa
and fcqs.concurrent_time_period_id =
ftp.concurrent_time_period_id
SELECT fpo.profile_option_name,
fpo.profile_option_id,
fpov.profile_option_value,
fpov.level_id,
fa.application_short_name,
fpo.user_profile_option_name,
fpo.sql_validation,
fpo.description
apps.FND_PROFILE_OPTION_VALUES fpov,
apps.fnd_application fa
where fpo.application_id = 0
or fpo.profile_option_name in ('EDITOR_CHAR',
'FNDCPVWR_FONT_SIZE', 'MAX_PAGE_LENGTH', 'APPLWRK'))
a.application_name srvc_app_name,
a.application_short_name srvc_app_short_name,
q.concurrent_queue_name service_short_name,
from gv$session
)
)
q.max_processes target_processes,
(select count(*)
) actual_processes,
apps.fnd_cp_services s
UNION
a.application_name srvc_app_name,
a.application_short_name srvc_app_short_name,
q.concurrent_queue_name srvc_short_name,
q.max_processes target_processes,
0 actual_processes,
from apps.fnd_concurrent_processes p
spool crrunning.lst
decode(fcrv.phase_code,'P','Pending','R','Running','I','Inacti
ve','Completed')PHASE,
'Z','Waiting',fcrv.status_code)STATUS,
substr(fcrv.program,1,25)PROGRAM,
substr(fcrv.requestor,1,9)REQUESTOR,
to_char(fcrv.actual_start_date,'MM/DD/RR HH24:MI')START_TIME,
round(((sysdate - fcrv.actual_start_date)*1440),2)RUN_TIME,
substr(fcr.oracle_process_id,1,7)OSPID,
vs.sid SID
--substr(fcr.os_process_id,1,7)OS_PID
apps.fnd_concurrent_requests fcr,
v$session vs,
v$process vp
set lines 80
set pages 22
'Trace Name:
'||dest.value||'/'||lower(dbnm.value)||'_ora_'||
oracle_process_id||'.trc',
'Status : '||decode(phase_code,'R','Running')
||'-'||decode(status_code,'R','Normal'),
apps.fnd_executables execname
and req.oracle_process_id=proc.spid(+)
and dest.name='user_dump_dest'
and dbnm.name='db_name'
and prog.executable_id=execname.executable_id;
fcr.argument_text,
DECODE(fcr.phase_code
,'X', 'Terminated'
,'E', 'Error'
,'C','Completed'
,'P','Pending'
,'R','Running'
,phase_code) "Phase",
DECODE(fcr.status_code
,'X','Terminated'
,'C','Normal'
,'D','Cancelled'
,'E','Error'
,'G','Warning'
,'Q','Scheduled'
,'R','Normal'
,'W','Paused'
--fcr.phase_code,
--fcr.status_code,
fcr.request_date,
fcr.actual_start_date,
fcr.actual_completion_date,
(fcr.actual_completion_date - fcr.actual_start_date)*1440
"Elapsed"
fcr1.request_id
WHERE 1=1
fnd_concurrent_requests fcr,
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcptl
ORDER BY 1
p.PID,
p.SERIAL#,
p.USERNAME p_user,
p.SPID,
s.program,
s.command,
s.sid,
s.serial#,
s.username,
s.process,
s.machine,
s.action,
s.module
apps.FND_CONC_REQ_SUMMARY_V fv,
gv$session s,
gv$process p
;
To find all the things in detail from the particular request id/
query to find concurrent request details/how to check
concurrent request status from backend/ query to find
concurrent program run time
--
select r.REQUEST_ID
,u.user_name
,r.PRIORITY
,decode(r.HOLD_FLAG,'N','"NOT on hold"','Y','"ON
HOLD"',r.HOLD_FLAG) Hold_flag
, p.application_short_name
,f.user_concurrent_program_name,f.concurrent_program_name,e.EX
ECUTABLE_NAME,e.EXECUTION_FILE_NAME,
e.EXECUTION_METHOD_CODE,e.EXECUTION_FILE_PATH
, v.RESPONSIBILITY_name
, r.REQUEST_CLASS_APPLICATION_ID
, q.request_class_name
, r.PARENT_REQUEST_ID
,to_char(r.REQUESTED_START_DATE,'DD-MON-YYYY HH:MI')
requested_start_date
,to_char(r.ACTUAL_START_DATE,'DD-MON-YYYY HH:MI')
actual_start_date
,decode(r.ACTUAL_COMPLETION_DATE,null,'"Still
Running"',to_char(r.ACTUAL_COMPLETION_DATE,'DD-MON-YYYY
HH:MI')) actual_completion_date
,to_char(decode(r.ACTUAL_COMPLETION_DATE,null,SYSDATE,r.ACTUAL
_COMPLETION_DATE)-
decode(r.ACTUAL_START_DATE,null,SYSDATE,r.ACTUAL_START_DATE),'
MI') "Time Running"
,r.CPU_SECONDS
,r.LOGICAL_IOS
,r.PHYSICAL_IOS
,r.ORACLE_PROCESS_ID
,r.ORACLE_SESSION_ID
,r.OS_PROCESS_ID
,r.CD_ID
,r.ARGUMENT_TEXT Parameters
,r.LOGFILE_NAME
from fnd_concurrent_requests r
, fnd_user u
, fnd_application p
, fnd_concurrent_programs_vl f
,fnd_EXECUTABLEs e
, fnd_responsibility_vl v
, fnd_concurrent_request_class q
and f.EXECUTABLE_ID=e.EXECUTABLE_ID
select request_id,
b.user_concurrent_queue_name
from apps.fnd_concurrent_worker_requests a,
apps.fnd_concurrent_queues_vl b
order by
request_id, b.user_concurrent_queue_name
From Fnd_Concurrent_Queues Q,
Fnd_Concurrent_requests R,
Fnd_Concurrent_Processes P
Where
Queue_Application_ID = Q.Application_ID )
;set head on
'C','Completed',
'I','Inactive',
'P','Pending',
DECODE(a.status_code,
'A','Waiting',
'B','Resuming',
'C','Normal',
'D','Cancelled',
'E','Error',
'G','Warning',
'H','On Hold',
'I',' Normal',
'M','No Manager',
'P','Scheduled',
'Q','Standby',
'R',' Normal',
'S','Suspended',
'T','Terminating',
'U','Disabled',
'W','Paused',
'X','Terminated',
(nvl(actual_completion_date,sysdate) - actual_start_date)*1440
"Elapsed", a.argument_text ,a.USER_CONCURRENT_PROGRAM_NAME
---(nvl(actual_completion_date,sysdate) -
actual_start_date)*1440 > 10
ttitle off
set linesize 180
set pagesize 60
set newpage 0
set termout on
select
trunc(actual_start_date) sdate,
request_id reqid,
user_name,
to_char(actual_start_date,'HH24:MI:SS') astart,
to_char(actual_completion_date,'HH24:MI:SS') acomp,
que.concurrent_queue_name conc_que,
prog.user_concurrent_program_name pname2,
req.argument_text args
from
applsys.fnd_concurrent_queues que,
applsys.fnd_user usr,
applsys.fnd_concurrent_programs prog,
applsys.fnd_concurrent_requests req,
applsys.fnd_concurrent_processes proc
where
or
and
and
que.application_id= proc.queue_application_id
and
que.concurrent_queue_id = proc.concurrent_queue_id
and
req.controlling_manager= proc.concurrent_process_id
and
usr.user_id = req.requested_by
and
prog.concurrent_program_id = req.concurrent_program_id
and
prog.application_id = req.program_application_id
('ACTIVATE','ABORT','DEACTIVATE','VERIFY')
order by
actual_start_date;
set pages 58
set linesize 79Column Reqst Format 999999
Fcr.Logfile_Name LN,
Concurrent_Queue_Name Manager,
Concurrent_Program_Name Program,
To_Char(Actual_Start_Date, 'Mm-Dd-Yy Hh24:Mi') Started,
Run_Alone_Flag, Single_Thread_Flag
Fnd_Oracle_Userid O, Fnd_Concurrent_Processes P,
Fnd_Concurrent_Queues Q, Fnd_User
Where
Controlling_Manager = Concurrent_Process_ID
P.Queue_Application_ID = Q.Application_ID )
/
Query to find Terminating Requests in Concurrent Manager
set pages 58
Fcr.Logfile_Name LN,
Concurrent_Queue_Name Manager,
Concurrent_Program_Name Program,
Run_Alone_Flag, Single_Thread_Flag
Fnd_Oracle_Userid O, Fnd_Concurrent_Processes P,
Fnd_Concurrent_Queues Q, Fnd_User
Where
Controlling_Manager = Concurrent_Process_ID
P.Queue_Application_ID = Q.Application_ID )
set pages 58
Fcr.Logfile_Name LN,
Concurrent_Program_Name Program,
Run_Alone_Flag, Single_Thread_Flag
Fnd_Oracle_Userid O, Fnd_User
/
Check the log and outfile created from certain time period
select outfile_node_name,outfile_name,
logfile_node_name,logfile_name
from fnd_concurrent_requests
Run the following query to check whether any specialization rule defined for any
concurrent manager that includes/excludes the concurrent program in
question. Query returns ‘no rows selected’ when there are no Include/Exclude
specialization rules of Program type for the given concurrent program.
DECODE(a.phase_code,
'C','Completed',
'I','Inactive',
'P','Pending',
'R','Running') || ' ' ||
DECODE(a.status_code,
'A','Waiting',
'B','Resuming',
'C','Normal',
'D','Cancelled',
'E','Error',
'G','Warning',
'H','On Hold',
'I',' Normal',
'M','No Manager',
'P','Scheduled',
'Q','Standby',
'R',' Normal',
'S','Suspended',
'T','Terminating',
'U','Disabled',
'W','Paused',
'X','Terminated',
(nvl(actual_completion_date,sysdate) - actual_start_date)*1440
"Elapsed", a.argument_text ,a.USER_CONCURRENT_PROGRAM_NAME
FROM fnd_concurrent_requests
FROM fnd_concurrent_requests
FROM fnd_concurrent_requests
select a.concurrent_queue_name,a.target_node
from apps.fnd_concurrent_queues a
, apps.fnd_concurrent_processes b
where a.concurrent_queue_id=b.concurrent_queue_id
and a.concurrent_queue_name=’FNDICM’
and b.process_status_code=’A’
order by b.process_status_code
from apps.fnd_concurrent_queues_vl
Q,apps.Fnd_Concurrent_Processes P
from fnd_amp_requests_v;
select MAX_PROCESSES,RUNNING_PROCESSES
from FND_CONCURRENT_QUEUES
where CONCURRENT_QUEUE_NAME='FNDICM';
select MAX_PROCESSES,RUNNING_PROCESSES
from FND_CONCURRENT_QUEUES
where CONCURRENT_QUEUE_NAME='STANDARD';
from dba_objects
and status='INVALID';
Note: Program Short Name is visible when the program is queried in concurrent
program definition form.
sum(decode(b.PHASE_CODE,'P',decode(b.STATUS_CODE,'Q',1,0),0))
Pending_Standby,
sum(decode(b.PHASE_CODE,'P',decode(b.STATUS_CODE,'I',1,0),0))
Pending_Normal,
sum(decode(b.PHASE_CODE,'R',decode(b.STATUS_CODE,'R',1,0),0))
Running_Normal
FROM FND_CONCURRENT_QUEUES_VL a,
FND_CONCURRENT_WORKER_REQUESTS b
AND b.Requested_Start_Date<=SYSDATE
GROUP BY a.USER_CONCURRENT_QUEUE_NAME,a.MAX_PROCESSES
SELECT fcr.oracle_session_id
,fcr.request_id rqst_id
,fcr.requested_by rqst_by
,fu.user_name
,fr.responsibility_name
,fcr.concurrent_program_id cp_id
,fcp.user_concurrent_program_name cp_name
,fcr.oracle_process_id "oracle_pid/SPID"
,fcr.os_process_id os_pid
,fcr.argument_text
,fcr.outfile_name
,fcr.logfile_name
,fcr.enable_trace
,apps.fnd_user fu
,apps.fnd_responsibility_tl fr
,apps.fnd_concurrent_programs_tl fcp
ORDER BY fcr.concurrent_program_id
,request_id DESC;
DECODE (running_type,
'P', 'Program',
'S', 'Request set',
'UNKNOWN'
) "Type",
b1.user_concurrent_program_name "Incompatible_Prog",
DECODE (to_run_type,
'P', 'Program',
'UNKNOWN'
) incompatible_type
apps.fnd_concurrent_programs_tl a1,
apps.fnd_concurrent_programs_tl b1,
apps.fnd_application_tl a2,
apps.fnd_application_tl b2
AND b1.concurrent_program_id =
cps.to_run_concurrent_program_id
E.SQL_TEXT
FROM APPS.FND_CONCURRENT_REQUESTS A,
APPS.FND_CONCURRENT_PROCESSES B,
V$PROCESS C,
V$SESSION D,
V$SQL E
--By request id
update fnd_concurrent_requests
where request_id=&reqid;
--By program_id
update fnd_concurrent_requests
where CONCURRENT_PROGRAM_ID=&prgid;
CONCSUB / \
[WAIT=N|Y|] \
CONCURRENT \
[PROGRAM_NAME=] \
[REPEAT_TIME=] \
[REPEAT_INTERVAL= ] \
[REPEAT_END=] \
[START=] \
[IMPLICIT=< type of concurrent request> \
[ ... ]
For RAC
Enable Trace
SELECT cr.request_id,
DECODE (cp.user_concurrent_program_name,
'Report Set', 'Report Set:' || cr.description,
cp.user_concurrent_program_name
) NAME,
argument_text, cr.resubmit_interval,
NVL2 (cr.resubmit_interval,
'PERIODICALLY',
NVL2 (cr.release_class_id, 'ON SPECIFIC DAYS', 'ONCE')
) schedule_type,
DECODE (NVL2 (cr.resubmit_interval,
'PERIODICALLY',
NVL2 (cr.release_class_id, 'ON SPECIFIC DAYS', 'ONCE')
),
'PERIODICALLY', 'EVERY '
|| cr.resubmit_interval
|| ' '
|| cr.resubmit_interval_unit_code
|| ' FROM '
|| cr.resubmit_interval_type_code
|| ' OF PREV RUN',
'ONCE', 'AT :'
|| TO_CHAR (cr.requested_start_date, 'DD-MON-RR HH24:MI'),
'EVERY: ' || fcr.class_info
) schedule,
fu.user_name, requested_start_date
FROM apps.fnd_concurrent_programs_tl cp,
apps.fnd_concurrent_requests cr,
apps.fnd_user fu,
apps.fnd_conc_release_classes fcr
WHERE cp.application_id = cr.program_application_id
AND cp.concurrent_program_id = cr.concurrent_program_id
AND cr.requested_by = fu.user_id
AND cr.phase_code = 'P'
AND cr.requested_start_date > SYSDATE
AND cp.LANGUAGE = 'US'
AND fcr.release_class_id(+) = cr.release_class_id
AND fcr.application_id(+) = cr.release_class_app_id;
SUBSTR(B.DESCRIPTION,1,25) DESCRIPTION
WHERE A.ENABLE_TRACE='Y'
AND A.LAST_UPDATED_BY=B.USER_ID;
Script
SELECT
distinct user_concurrent_program_name,
responsibility_name,
request_date,
argument_text,
request_id,
phase_code,
status_code,
logfile_name,
outfile_name,
output_file_type,
hold_flag,
user_name
FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs_tl fcp,
fnd_responsibility_tl fr,
fnd_user fu
WHERE
fcr.CONCURRENT_PROGRAM_ID = fcp.concurrent_program_id
and fcr.responsibility_id = fr.responsibility_id
and fcr.requested_by = fu.user_id
--and user_name = upper('HIMSINGH')
and user_concurrent_program_name in
('Active Users')
and Phase_code='P'
ORDER BY REQUEST_DATE DESC;
set term on
set feedback on
set echo on
set arraysize 4
set linesize 200
set pages 9999
set underline =;
column username format A15
column sid format 9990 heading SID
column type format A4
column lmode format 990 heading 'HELD'
column request format 990 heading 'REQ'
column id1 format 9999990
column id2 format 9999990
column sql_text format a100
column name format a80
break on id1 skip 1 dup
undefine v_request_id
define v_request_id
undefine v_spid
define v_spid
undefine v_sid
define v_sid
spool vj_concurrent_monitor.lst
Prompt Enter the operating system oracle process id for this concurrent request
accept v_spid
Prompt Getting the sid
SELECT SID,SERIAL#,LOGON_TIME FROM V$SESSION WHERE PADDR IN
(SELECT ADDR FROM V$PROCESS WHERE SPID='&v_spid');
spool off
clear columns
clear breaks
This way you know now this running program (concurrent request) is handled by new manager and
not part of standard manager.
SELECT
request_id, SUBSTR(requestor,1,25), SUBSTR(program,1,50),
SUBSTR(user_concurrent_program_name,1,100),
TO_CHAR(actual_start_date,’dd/mm/yy :hh24:mi’) start_date,
TO_CHAR(actual_completion_date,’dd/mm/yy :hh24:mi’) completion_date,
FLOOR((ACTUAL_COMPLETION_DATE- ACTUAL_START_DATE)*24) “in Hours”,
(((ACTUAL_COMPLETION_DATE- ACTUAL_START_DATE)*24)-(FLOOR((ACTUAL_COMPLETION_DATE-
ACTUAL_START_DATE)*24)))*60 “In_Min”
–requestor, program, user_concurrent_program_name
FROM fnd_conc_req_summary_v
WHERE (ACTUAL_COMPLETION_DATE- ACTUAL_START_DATE)*24*60 >10
Cancel Concurrent requests. We don't need concurrent requests which are scheduled in
production to keep running in test. We use the following update to cancel them.
update fnd_concurrent_requests
set phase_code='C',
status_code='D'
where phase_code = 'P'
and concurrent_program_id not in (
select concurrent_program_id
from fnd_concurrent_programs_tl
where user_concurrent_program_name like '%Synchronize%tables%'
or user_concurrent_program_name like '%Workflow%Back%'
or user_concurrent_program_name like '%Sync%responsibility%role%'
or user_concurrent_program_name like '%Workflow%Directory%')
and (status_code = 'I' OR status_code = 'Q');
Use the SQL below to only cancel the running requests connecting as sys
UPDATE applsys.fnd_concurrent_requests
SET phase_code = 'C', status_code = 'X'
WHERE phase_code = 'R' and status_code ='R'
/
commit
Also, please put all Pending Jobs on Hold, using the SQL below connecting as sys
update applsys.fnd_concurrent_requests
set hold_flag='Y' where
phase_code='P' and hold_flag='N'
/
commit
update fnd_concurrent_requests fcr
set phase_code = 'C',
status_code = 'D'
where fcr.PHASE_CODE <> 'C'
and (fcr.program_application_id,fcr.CONCURRENT_PROGRAM_id) in
(select fcp.application_id,fcp.concurrent_program_id from fnd_concurrent_programs
fcp,fnd_executables_vl fev
where fcp.executable_application_id=fev.application_id and fcp.executable_id=fev.executable_id
and (upper(fev.user_executable_name) like 'AL%MAIL%'
or upper(fev.user_executable_name) like 'AL%FTP%'
or upper(fev.user_executable_name) like 'AL%EXCEL%'))
/
select
REQUEST_ID,CONCURRENT_PROGRAM_ID,substr(ARGUMENT_TEXT,1,60)params,status_code,phase_c
ode from fnd_concurrent_requests where CONCURRENT_PROGRAM_ID=;
"From Note ID 737311.1 we need to do step 3 We are changing this parameter to 2048m as
mentioned below in script.
Configure the Output Post Processor's JVM. These steps set the JVM to 2GB, depending upon
your server's size you might find 3 GB (-mx3072m), 4GB (-mx4096m) or even 5GB (-mx5120m) is a
better value. This setting prevents the error ""java.lang.OutOfMemoryError: Java heap space""
in the Output Post Processor's log associated to the Subledger Accounting Program.
Login to SQL*Plus as APPS.
SQL>update FND_CP_SERVICES set DEVELOPER_PARAMETERS =
'J:oracle.apps.fnd.cp.gsf.GSMServiceController:-mx2048m'
where SERVICE_ID = (select MANAGER_TYPE from FND_CONCURRENT_QUEUES
where CONCURRENT_QUEUE_NAME = 'FNDCPOPP');
Bounce the concurrent managers.
one more eg:
To determine current heap size:
select DEVELOPER_PARAMETERS
from FND_CP_SERVICES
where SERVICE_ID = (select MANAGER_TYPE from FND_CONCURRENT_QUEUES where
CONCURRENT_QUEUE_NAME = 'FNDCPOPP');
select count(*)
from APPS.FND_ 2 CONCURRENT_PROGRAMS_VL a,
APPS.FND_CONCURRENT_REQUESTS b
where a.CONCURRENT_PROGRAM_ID = b.CONCURRENT_PROGRAM_ID
and a.APPLICATION_ID = b.PROGRAM_APPLICATION_ID
and b.PHASE_CODE = 'P'
and b.requested_start_date <= sysdate
1 row updated.
SQL> commit;
Commit complete.
Parameter:
Entity : REQUEST
Mode : Age
Mode Value : 15 On non-prod environments as per case# 734780
Schedule:
on specific days : Wednesday and Saturday at 19:00 CET
select substr(fcrv.request_id,1,8)REQUEST,
decode(fcrv.phase_code,'P','Pending','R','Running','I','Inactive','Completed')PHASE,
decode(fcrv.status_code,
'A','Waiting',
'B','Resuming',
'C','Normal',
'F','Scheduled',
'G','Warning',
'H','On Hold',
'I','Normal',
'M','No Manager',
'Q','Standby',
'R','Normal',
'S','Suspended',
'T','Terminating',
'U','Disabled',
'W','Paused',
'X','Terminated',
'Z','Waiting',fcrv.status_code)STATUS,
substr(fcrv.program,1,40)PROGRAM,substr(fcrv.PROGRAM_SHORT_NAME,1,15)SHORT,
substr(fcrv.requestor,1,15)REQUESTOR,
-- to_char(fcrv.actual_start_date,'MM/DD/RR HH24:MI')START_TIME,
round(((sysdate - fcrv.actual_start_date)*1440),1)RUN_TIME,
substr(fcr.oracle_process_id,1,7)OSPID,s.sid,s.serial#
from apps.fnd_conc_req_summary_v fcrv,
apps.fnd_concurrent_requests fcr,
v$session s,v$process p
where fcrv.phase_code = 'R'
and fcrv.request_id = fcr.request_id
and s.paddr = p.addr
and fcr.oracle_process_id = p.spid
and fcrv.concurrent_program_id not in ('40112','40113','36887')
--and trunc(fcrv.actual_start_date) like trunc(sysdate)
order by PHASE, STATUS, REQUEST desc;
Table truncated.
Table truncated.
Table truncated.
Table truncated.
Import the data back into the fnd tables which was exported as part of step above
Check whether the GSM is Up and Running in the system --> Profile option or using the
Following Query :
select DECODE(b.profile_option_value, 'Y', 'Enabled', 'Disabled') DETAILS
from fnd_profile_options a, fnd_profile_option_values b
where a.APPLICATION_ID = b.APPLICATION_ID
and a.PROFILE_OPTION_ID = b.PROFILE_OPTION_ID
and a.PROFILE_OPTION_NAME = 'CONC_GSM_ENABLED';
Check whether the Service Manager is up and Running by the following Query :
select CONCURRENT_QUEUE_NAME, ENABLED_FLAG, MAX_PROCESSES, RUNNING_PROCESSES
from FND_CONCURRENT_QUEUES
where CONCURRENT_QUEUE_NAME like 'FNDSM%';
The following SQL scripts located under $FND_TOP/sql are useful when diagnosing concurrent
manager problems:
afrqscm.sql Prints log file name of managers that can run a given request. It can be used to check
for possible errors when a request stays in pending status. It requires a request id value.
afcmcreq.sql Prints the log file name of the manager that processed the request
Reports on requests that having been running for over a specified amount of time (hard coded
as 4 hours). Exceptions, in addition to the defaults below, can be added by entering the
program ID for the program exceptions under multi-items.
Excludes:
36887 - Workflow Mailer
43393 - ITM Adapter
38121 - Gather Schema Statistics
42789 - OAM Applications Dashboard Collection
31556 - Planning Manager
Monitors pending jobs exceeds the specified threshold. Excessive pending jobs may indicate an
issue with the Concurrent Manager. Uses the following query:
The error threshold monitor will alert if the number of failed jobs exceeds the user defined
threshold in a 30 minute period.
select oracle_process_id ,
decode(status_code,'R','Running','D','Canceled','E','Error','X','Terminated','G','Warning','T','Terminating'
)""Status_code"",
phase_code,to_char(actual_start_date,'DD-MON-YYYY=>hh24:mi:ss') ""Login Time""
from apps.fnd_concurrent_requests where request_id='&Enter_conn_req_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
NOTE: You have to commit if select & update are same number of records. Otherwise rollback and
try again till the numbers are same
5) Commit;
if (req_id = 0) then
/* Handle submission error */
DBMS_OUTPUT.PUT_LINE('Request ID :' || req_id);
DBMS_OUTPUT.PUT_LINE('As the request ID is 0, the request was not submitted');
DBMS_OUTPUT.PUT_LINE('Please verify this part again');
else
DBMS_OUTPUT.PUT_LINE('Request ID :' || req_id);
DBMS_OUTPUT.PUT_LINE('Request submitted successfully');
commit;
end if;
end;
/
A - Waiting
B - Resuming
C - Normal
D - Cancelled
E - Error
F - Scheduled
G - Warning
H - On Hold
I - Normal
M - No Manager
Q - Standby
R - Normal
S - Suspended
T - Terminating
U - Disabled
W - Paused
X - Terminated
Z - Waiting
PHASE_CODE column
C - Completed
I - Inactive
P - Pending
R - Running
check long running concurrent request in Oracle Apps
Looking on how to check long running concurrent request in Oracle Apps 11i or R12?
Here’s the overview of the SQL query script to detect the session information of each program.
First you need to get the listing of running concurrent request in Oracle Apps 11i or R12.
You can use the SQL query script as below to obtain the list of running request.
--------------
SELECT a.request_id
,a.oracle_process_id "SPID"
,frt.responsibility_name
,c.concurrent_program_name || ': ' || ctl.user_concurrent_program_name
,a.description
,a.ARGUMENT_TEXT
,b.node_name
,b.db_instance
,a.logfile_name
,a.logfile_node_name
,a.outfile_name
,q.concurrent_queue_name
,a.phase_code,a.status_code, a.completion_text
, actual_start_date
, actual_completion_date
, fu.user_name
,(nvl(actual_completion_date,sysdate)-actual_start_date)*1440 mins
,(SELECT avg(nvl(a2.actual_completion_date-a2.actual_start_date,0))*1440 avg_run_time
FROM APPLSYS.fnd_Concurrent_requests a2,
APPLSYS.fnd_concurrent_programs c2
WHERE c2.concurrent_program_id = c.concurrent_program_id
AND a2.concurrent_program_id = c2.concurrent_program_id
AND a2.program_application_id = c2.application_id
AND a2.phase_code || '' = 'C') avg_mins
,round((actual_completion_date - requested_start_date),2) * 24 duration_in_hours
FROM APPLSYS.fnd_Concurrent_requests a,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_concurrent_programs_tl ctl
,apps.fnd_user fu
,apps.FND_RESPONSIBILITY_TL frt
WHERE a.controlling_manager = b.concurrent_process_id
AND a.concurrent_program_id = c.concurrent_program_id
AND a.program_application_id = c.application_id
AND a.phase_code = 'R'
AND a.status_code = 'R'
AND b.queue_application_id = q.application_id
AND b.concurrent_queue_id = q.concurrent_queue_id
AND ctl.concurrent_program_id = c.concurrent_program_id
AND a.requested_by = fu.user_id
AND a.responsibility_id = frt.responsibility_id
ORDER BY a.actual_start_date DESC;
------------------------------------------------------
You can see the request id and other relevant information from the result.
Based on the SPID associated to each running request, query the v$session or
v$session_longops table to see what is the request id doing in the backend.
5.To find concurrent program name,phase code,status code for a given request id?
6.To find the sql query for a given concurrent request sid?
update fnd_concurrent_requests
set status_code='D', phase_code='C'
where request_id=&req_id;
select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''' immediate;' from v$session where
MODULE like '';
SELECT a.request_id,
d.sid as Oracle_SID,
d.serial#,
d.osuser,
d.process,
c.SPID as OS_Process_ID
FROM apps.fnd_concurrent_requests a,
apps.fnd_concurrent_processes b,
gv$process c,
gv$session d
WHERE a.controlling_manager = b.concurrent_process_id
AND c.pid = b.oracle_process_id
AND b.session_id=d.audsid
AND d.sid = &SID;
12. Oracle Concurrent Request Error Script (requests which were error ed out)
SELECT
user_concurrent_program_name,
request_date,
request_id,
phase_code,
status_code
FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs_tl fcp,
fnd_responsibility_tl fr,
fnd_user fu
WHERE
fcr.CONCURRENT_PROGRAM_ID = fcp.concurrent_program_id
and fcr.responsibility_id = fr.responsibility_id
and fcr.requested_by = fu.user_id
and user_name = '&user'
AND actual_start_date > sysdate - 1
ORDER BY REQUEST_DATE Asc;
•Check the Statistics,History Runs of that program & Based on this timelines we need
to decide the long running Request.
•Check The load on DB node to ensure that High Resource Usage is not
the Main cause.i troubleshoot
•Check DB locks in The Database To Ensure that This Session is not
blocked by any other session.’
•Check wether Same Iteration Of concurrent program is running on
Instance. like if concurrent request is running twise/trice
If we are Happy/resolved the above things and find that we dont have any
problem Then we need to Digg
Note : before Using Oradebug make sure that spid shoud exist on DB node..
Coming to My Case
SQL> oradebug setospid 1100
—
Oracle pid: 79, Unix process pid: 1100, image: oracle@Acer
—
/ORADB/acerdb/9.2.0/admin/DELL_ACER/udump/ACER_ora_1100.trc
Wait for 30 Min to get the Trace file to find the Root Cause
Step 4 : Disable trace if u r thinking that trace is enough to find the root cause..
tkprof ‘ /ORADB/acerdb/9.2.0/admin/DELL_ACER/udump/ACER_ora_1100.trc’ ’
/ORADB/acerdb/9.2.0/admin/DELL_ACER/udump/ACER_ora_1100.txt ’
explain=apps/[apps_passwd] prsela.
Step 6 : Check TKPROF out file to find root cause of slow concurrent request.
********************************************************************************
.
Application version: 11.5.10.2 multi-node (4 nodes)
Database: 11g RAC
Scenario:
Business critical concurrent request is running from more than 2 hours which was supposed
to complete within 1 hour.
The standard manager and the manager responsible to execute the critical concurrent
request (custom manager) were overloaded with many requests. The server on which these
managers run had very high server load and all CPU’s were utilized.
After diagnosis, we had to kill few requests which were running from more than 2 hours and
were creating load on the server. These requests were in fact not performing anything and
had gone zombie.
The server load came down and CPU’s available were set free to execute new
requests/processes.
However the business critical request was still running and wasn’t moving ahead at all. The
database session associated was also not executing anything.
Challenge:
Since this being a critical business request, we couldn’t terminate the request coz we had
already lost few hours running it. At the same time the database session also wasn’t
performing any execution and the whole request was not going anywhere even though it
showed running normal status.
Trick:
Looking on how to check long running concurrent request in Oracle Apps 11i or R12?
Here’s the overview of the SQL query script to detect the session information of each
program.
First you need to get the listing of running concurrent request in Oracle Apps 11i or R12.
You can use the SQL query script as below to obtain the list of running request.
SELECT a.request_id
,a.oracle_process_id “SPID”
,frt.responsibility_name
,c.concurrent_program_name || ‘: ‘ || ctl.user_concurrent_program_name
,a.description
,a.ARGUMENT_TEXT
,b.node_name
,b.db_instance
,a.logfile_name
,a.logfile_node_name
,a.outfile_name
,q.concurrent_queue_name
,a.phase_code,a.status_code, a.completion_text
, actual_start_date
, actual_completion_date
, fu.user_name
,(nvl(actual_completion_date,sysdate)-actual_start_date)*1440 mins
,(SELECT avg(nvl(a2.actual_completion_date-a2.actual_start_date,0))*1440 avg_run_time
FROM APPLSYS.fnd_Concurrent_requests a2,
APPLSYS.fnd_concurrent_programs c2
WHERE c2.concurrent_program_id = c.concurrent_program_id
AND a2.concurrent_program_id = c2.concurrent_program_id
AND a2.program_application_id = c2.application_id
AND a2.phase_code || ” = ‘C’) avg_mins
,round((actual_completion_date – requested_start_date),2) * 24 duration_in_hours
FROM APPLSYS.fnd_Concurrent_requests a,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_concurrent_programs_tl ctl
,apps.fnd_user fu
,apps.FND_RESPONSIBILITY_TL frt
WHERE a.controlling_manager = b.concurrent_process_id
AND a.concurrent_program_id = c.concurrent_program_id
AND a.program_application_id = c.application_id
AND a.phase_code = ‘R’
AND a.status_code = ‘R’
AND b.queue_application_id = q.application_id
AND b.concurrent_queue_id = q.concurrent_queue_id
AND ctl.concurrent_program_id = c.concurrent_program_id
AND a.requested_by = fu.user_id
AND a.responsibility_id = frt.responsibility_id
ORDER BY a.actual_start_date DESC
You can see the request id and other relevant information from the result.
Based on the SPID associated to each running request, query the v$session
orv$session_longops table to see what is the request id doing in the backend.
SELECT b.sid, b.serial#, a.spid, b.program, b.osuser, b.machine,
b.TYPE, b.event, b.action, b.p1text, b.p2text, b.p3text, b.state, c.sql_text,b.logon_time
FROM v$process a, v$session b, v$sqltext c
WHERE a.addr=b.paddr
AND b.sql_hash_value = c.hash_value
AND b.STATUS = ‘ACTIVE’
AND a.spid = ‘11696’
ORDER BY a.spid, c.piece
5.To find concurrent program name,phase code,status code for a given request id?
SELECT request_id, user_concurrent_program_name,
DECODE(phase_code,’C’,’Completed’,phase_code)
phase_code, DECODE(status_code,’D’, ‘Cancelled’ ,
‘E’, ‘Error’ , ‘G’, ‘Warning’, ‘H’,’On Hold’ , ‘T’, ‘Terminating’, ‘M’, ‘No Manager’ , ‘X’,
‘Terminated’, ‘C’, ‘Normal’, status_code) status_code, to_char(actual_start_date,’dd-mon-
yy:hh24:mi:ss’) Start_Date, to_char(actual_completion_date,’dd-mon-yy:hh24:mi:ss’),
completion_text FROM apps.fnd_conc_req_summary_v WHERE request_id = ‘&req_id’
ORDER BY 6 DESC;
6.To find the sql query for a given concurrent request sid?
select sid,sql_text from gv$session ses, gv$sqlarea sql where
ses.sql_hash_value = sql.hash_value(+) and ses.sql_address = sql.address(+) and
ses.sid=’&oracle_sid’
/
12. Oracle Concurrent Request Error Script (requests which were error ed out)
SELECT a.request_id “Req Id”
,a.phase_code,a.status_code
, actual_start_date
, actual_completion_date
,c.concurrent_program_name || ‘: ‘ || ctl.user_concurrent_program_name “program”
FROM APPLSYS.fnd_Concurrent_requests a,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_concurrent_programs_tl ctl
WHERE a.controlling_manager = b.concurrent_process_id
AND a.concurrent_program_id = c.concurrent_program_id
AND a.program_application_id = c.application_id
AND a.status_code = ‘E’
AND a.phase_code = ‘C’
AND actual_start_date > sysdate – 2
AND b.queue_application_id = q.application_id
AND b.concurrent_queue_id = q.concurrent_queue_id
AND ctl.concurrent_program_id = c.concurrent_program_id
AND ctl.LANGUAGE = ‘US’
ORDER BY 5 DESC;
13. Request submitted by User
SELECT
user_concurrent_program_name,
request_date,
request_id,
phase_code,
status_code
FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs_tl fcp,
fnd_responsibility_tl fr,
fnd_user fu
WHERE
fcr.CONCURRENT_PROGRAM_ID = fcp.concurrent_program_id
and fcr.responsibility_id = fr.responsibility_id
and fcr.requested_by = fu.user_id
and user_name = ‘&user’
AND actual_start_date > sysdate – 1
ORDER BY REQUEST_DATE Asc;
Note: The same information can be seen in Administer Concurrent Manager form for each
manager.
2 Through OAM
In oracle apps, navigate to
OAM>Site Map>/License Manager>Reports>Licensed Products
Here filter the products by using “Licensed”. These are the licensed and installed products
in oracle apps.
Are you running Oracle E-Business Suite (EBS) / Applications and want to get an operating
system level environment variable value from a database table, for example for use in
PL/SQL? Or perhaps to default a concurrent program parameter? Didn’t think environment
variables were stored in the database?
Try out out this query that shows you $FND_TOP:
SELECT
DBA_USERS.USERNAME USERNAME,
DECODE(V$SESSION.USERNAME, NULL, ‘NOT CONNECTED’, ‘CONNECTED’) STATUS,
NVL(OSUSER, ‘-‘) OSUSER,
NVL(TERMINAL,’-‘) TERMINAL,
SUM(DECODE(V$SESSION.USERNAME, NULL, 0,1)) SESSIONS
FROM
DBA_USERS, V$SESSION
WHERE DBA_USERS.USERNAME = V$SESSION.USERNAME (+)
GROUP BY
DBA_USERS.USERNAME,
DECODE(V$SESSION.USERNAME, NULL, ‘NOT CONNECTED’, ‘CONNECTED’),
OSUSER,
TERMINAL
ORDER BY 1 ;
Step1 : Run the first query , this will list all the programs that currently running in Application.
Take the SID and use it in the second query.
SELECT
f.user_name
,a.request_id “Req Id”
,a.concurrent_program_id “Prg Id”
,a.RESPONSIBILITY_ID Responsibility
,a.phase_code,a.status_code
,b.os_process_id “OS”
,vs.sid
,vs.serial# “Serial#”
,vp.spid
,TO_CHAR(request_date,’DD-MON-YY hh24:mi:ss’) request_date
,(NVL(a.actual_completion_date,SYSDATE)-a.actual_start_date)*1440 “Time”
,c.concurrent_program_name||’ – ‘||c2.user_concurrent_program_name “Program”
FROM APPLSYS.fnd_Concurrent_requests a
,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs_tl c2
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_user f
,v$session vs
,v$process vp
WHERE
a.controlling_manager = b.concurrent_process_id
AND a.concurrent_program_id = c.concurrent_program_id
AND a.program_application_id = c.application_id
AND c2.concurrent_program_id = c.concurrent_program_id
AND c2.application_id = c.application_id
AND a.phase_code IN (‘I’,’P’,’R’,’T’)
AND a.requested_by = f.user_id
AND b.queue_application_id = q.application_id
AND b.concurrent_queue_id = q.concurrent_queue_id
AND c2.LANGUAGE = ‘US’
AND a.oracle_process_id = vp.spid
AND vs.paddr = vp.addr
ORDER BY 9
Step 2 : Get Sid from step1 and Keep on executing this query in SQL. This query will show the
currently running SQL in the DB, as your concurrent is submitted and running. You can now find
out the exact query ( select / insert / update ) which is actually taking time in your concurrent
program.
SELECT sql_text FROM v$sqltext t,v$session s
WHERE t.ADDRESS = s.SQL_ADDRESS
AND t.HASH_VALUE = s.SQL_HASH_VALUE
AND s.sid = 100 – Get this value from step1
ORDER BY PIECE
Step 3 :
————
The following query finds total run-time (in minutes) for a concurrent program. Thus, with a
little modification to this query, you can track which concurrent programs take (very) long
time to complete, and may need performance tuning.
Change the concurrent program name (tl.user_concurrent_program_name, see below)
according to your search criteria. In this example, my concurrent program is “Autoinvoice
Import Program”. You can also uncomment the “&Start_Date” line to get the list for a
specific date.
——————————————————————————-
— Query to find runtime for a concurrent program
——————————————————————————-
SELECT /*+ rule */
rq.parent_request_id “Parent Req. ID”,
FROM applsys.fnd_concurrent_programs_tl tl,
applsys.fnd_concurrent_requests rq
WHERE tl.application_id = rq.program_application_id
AND tl.concurrent_program_id = rq.concurrent_program_id
AND tl.LANGUAGE = USERENV(‘LANG’)
AND rq.actual_start_date IS NOT NULL
AND rq.actual_completion_date IS NOT NULL
AND tl.user_concurrent_program_name = ‘Autoinvoice Import Program’ —
— AND TRUNC(rq.actual_start_date) = ‘&start_date’ — uncomment this for a specific date
ORDER BY rq.request_id DESC;
*************************************************************
Here is a sample anonymous PL/SQL block which will reset the Oracle Apps frontend
password for a given user from backend
DECLARE
flag_value BOOLEAN;
BEGIN
flag_value :=
fnd_user_pkg.changepassword(username=> ‘NKUMAR2’
,newpassword => ‘welcome1’);
IF flag_value
THEN
DBMS_OUTPU.PUT_LINE(‘The password reset successfully’);
ELSE
DBMS_OUTPUT.PUT_LINE(‘The password reset has failed’);
END IF;
END;
/
COMMIT;
25 .Checking the duplicated schedules of the same program with the same arguments
The below query can be used to check the duplicated schedule of the same program with
the same arguments. This can be used to alert the users to cancel these duplicated
schedules.
Note: This query will return even though the request was submitted using a different
responsibility.
SELECT request_id, NAME, argument_text, user_name
FROM (SELECT cr.request_id,
DECODE (cp.user_concurrent_program_name,
‘Report Set’, ‘Report Set:’ || cr.description,
cp.user_concurrent_program_name
) NAME,
argument_text, fu.user_name
FROM apps.fnd_concurrent_programs_tl cp,
apps.fnd_concurrent_requests cr,
apps.fnd_user fu
WHERE cp.application_id = cr.program_application_id
AND cp.concurrent_program_id = cr.concurrent_program_id
AND cr.requested_by = fu.user_id
AND cr.phase_code = ‘P’
AND cr.requested_start_date > SYSDATE
AND cp.LANGUAGE = ‘US’
AND fu.user_name NOT LIKE ‘PPG%’) t1
WHERE EXISTS (
SELECT 1
FROM (SELECT cr.request_id,
DECODE (cp.user_concurrent_program_name,
‘Report Set’, ‘Report Set:’
|| cr.description,
cp.user_concurrent_program_name
) NAME,
argument_text, fu.user_name
FROM apps.fnd_concurrent_programs_tl cp,
apps.fnd_concurrent_requests cr,
apps.fnd_user fu
WHERE cp.application_id = cr.program_application_id
AND cp.concurrent_program_id =
cr.concurrent_program_id
AND cr.requested_by = fu.user_id
AND cr.phase_code = ‘P’
AND cr.requested_start_date > SYSDATE
AND cp.LANGUAGE = ‘US’
AND fu.user_name NOT LIKE ‘PPG%’) t2
WHERE t1.NAME = t2.NAME
AND t1.argument_text = t2.argument_text
AND t1.user_name = t2.user_name
GROUP BY NAME, argument_text, user_name
HAVING COUNT (*) > 1)
ORDER BY user_name, NAME;
26.Average pending time per request
A Request can be in Pending state for variety of reasons like conflict with other requests,
improperly tuned managers (sleep seconds / cache size / number of managers etc)
We can schedule this script to gather data regularly for historical analysis as we normally
purge the concurrent requests regularly.
Note: Depending on the purging schedules some requests might miss if the corresponding
data in fnd_concurrent_processes is purged.
27.Script to Monitor Concurrent requests average run time
Do you need a daily report which would give an average run time of all concurrent
requests in your environment?
So you would know which concurrent request is taking longer time and on which day:
The below script gives an average run time for all concurrent requests for the current day,
previous day, day before yesterday and for the whole week:
col outfile format a30 col logfile format a30 select cp.plsql_dir || ‘/’ || cp.plsql_out outfile ,
cp.plsql_dir || ‘/’ || cp.plsql_log logfile from apps.fnd_concurrent_requests cr ,
apps.fnd_concurrent_processes cp where cp.concurrent_process_id =
cr.controlling_manager and cr.request_id = &request_id; OUTFILE LOGFILE
—————————— —————————— /usr/tmp/PROD/o0068190.tmp
/usr/tmp/PROD/l0068190.tmp REM Now tail log file on database node to see where it is at,
near realtime REM tail -f /usr/tmp/l0068190.tmp
set lines 150 col object_name format a32 col mode_held format a15 select /*+ ordered */
fcr.request_id , object_name , object_type , decode( l.block , 0, ‘Not Blocking’ , 1, ‘Blocking’ ,
2, ‘Global’ ) status , decode( v.locked_mode , 0, ‘None’ , 1, ‘Null’ , 2, ‘Row-S (SS)’ , 3, ‘Row-X
(SX)’ , 4, ‘Share’ , 5, ‘S/Row-X (SSX)’ , 6, ‘Exclusive’ , to_char(lmode) ) mode_held from
apps.fnd_concurrent_requests fcr , gv$process pro , gv$session sess , gv$locked_object v ,
gv$lock l , dba_objects d where fcr.phase_code = ‘R’ and fcr.oracle_process_id = pro.spid (+)
and pro.addr = sess.paddr (+) and sess.sid = v.session_id (+) and v.object_id = d.object_id (+)
and v.object_id = l.id1 (+) ; REQUEST_ID OBJECT_NAME OBJECT_TYPE STATUS MODE_HELD
———- ——————————– ——————- ———— ————— 1070780
VIRTUATE_GL_OLAP_REFRESH TABLE Not Blocking Exclusive
——————————————————————————-
— Query to find concurrent request status related information
——————————————————————————-
SELECT fu.user_name “User ID”,
frt.responsibility_name “Responsibility Used”,
DECODE(fcr.phase_code,
‘C’, ‘Completed’,
‘P’, ‘Pending’,
‘R’, ‘Running’,
‘I’, ‘Inactive’,
fcr.phase_code) “Phase”,
DECODE(fcr.status_code,
‘A’, ‘Waiting’,
‘B’, ‘Resuming’,
‘C’, ‘Normal’,
‘D’, ‘Cancelled’,
‘E’, ‘Error’,
‘F’, ‘Scheduled’,
‘G’, ‘Warning’,
‘I’, ‘Normal’,
‘Q’, ‘Standby’,
‘R’, ‘Normal’,
‘S’, ‘Suspended’,
‘T’, ‘Terminating’,
‘U’, ‘Disabled’,
‘W’, ‘Paused’,
‘X’, ‘Terminated’,
‘Z’, ‘Waiting’,
fcr.status_code) “Status”,
— fcr.number_of_arguments,
— fcr.argument_text,
— fcr.logfile_name,
— fcr.outfile_name
FROM fnd_user fu,
fnd_responsibility_tl frt,
fnd_concurrent_requests fcr,
fnd_concurrent_programs_tl fcpt
WHERE fu.user_id = fcr.requested_by
AND fcr.concurrent_program_id = fcpt.concurrent_program_id
AND fcr.responsibility_id = frt.responsibility_id
AND frt.LANGUAGE = USERENV(‘LANG’)
AND fcpt.LANGUAGE = USERENV(‘LANG’)
— AND fcr.request_id = 7137350 —
AND fcpt.user_concurrent_program_name = ‘Autoinvoice Import Program’ —
ORDER BY fcr.request_date DESC;
//*
2. Menus Listing
Purpose/Description:
To see the Menus associated with a given responsibility
Parameters
responsibility_id that you can retrieve from query nr 1 (Responsibilities Listing)
*//
SELECT DISTINCT
a.responsibility_name
, c.user_menu_name
FROM
apps.fnd_responsibility_tl a
, apps.fnd_responsibility b
, apps.fnd_menus_tl c
, apps.fnd_menus d
, apps.fnd_application_tl e
, apps.fnd_application f
WHERE
a.responsibility_id(+) = b.responsibility_id
AND a.responsibility_id = 50103
AND b.menu_id = c.menu_id
AND b.menu_id = d.menu_id
AND e.application_id = f.application_id
AND f.application_id = b.application_id
AND a.LANGUAGE = ‘US’;
//*
3. Submenu And Function Listing
Purpose/Description:
By using this query you can check function and submenus attached to a specific menu
Parameters
User_menu_name that you can get by running query 2 (Menu Listing)
*//
SELECT
c.prompt
, c.description
FROM
apps.fnd_menus_tl a
, fnd_menu_entries_tl c
WHERE
a.menu_id = c.menu_id
AND a.user_menu_name = ‘Navigator Menu – System Administrator GUI’;
//*
4.User and Assigned Responsibility Listing
Purpose/Description:
You can use this query to check responsibilities assigned to users.
Parameters
None
*//
SELECT UNIQUE
u.user_id
, SUBSTR (u.user_name, 1, 30) user_name
, SUBSTR (r.responsibility_name, 1, 60) responsiblity
, SUBSTR (a.application_name, 1, 50) application
FROM
fnd_user u
, fnd_user_resp_groups g
, fnd_application_tl a
, fnd_responsibility_tl r
WHERE
g.user_id(+) = u.user_id
AND g.responsibility_application_id = a.application_id
AND a.application_id = r.application_id
AND g.responsibility_id = r.responsibility_id
ORDER BY
SUBSTR (user_name, 1, 30)
, SUBSTR (a.application_name, 1, 50)
, SUBSTR (r.responsibility_name, 1, 60);
//*
5. Responsibility and assigned request group listing
Purpose/Description:
To find responsibility and assigned request groups.
Every responsibility contains a request group (The request group is basis of submitting requests)
Parameters
None
*//
SELECT
responsibility_name responsibility
, request_group_name
, frg.description
FROM
fnd_request_groups frg
, fnd_responsibility_vl frv
WHERE
frv.request_group_id = frg.request_group_id
ORDER BY responsibility_name
//*
6. Profile option with modification date and user
Purpose/Description:
Query that can be used to audit profile options.
Parameters
None
*//
SELECT
t.user_profile_option_name
, profile_option_value
, v.creation_date
, v.last_update_date
, v.creation_date – v.last_update_date “Change Date”
, (SELECT UNIQUE user_name
FROM fnd_user
WHERE user_id = v.created_by) “Created By”
, (SELECT user_name
FROM fnd_user
WHERE user_id = v.last_updated_by) “Last Update By”
FROM
fnd_profile_options o
, fnd_profile_option_values v
, fnd_profile_options_tl t
WHERE
o.profile_option_id = v.profile_option_id
AND o.application_id = v.application_id
AND start_date_active = SYSDATE
AND o.profile_option_name = t.profile_option_name
AND level_id = 10001
AND t.LANGUAGE IN (SELECT language_code
FROM fnd_languages
WHERE installed_flag = ‘B’
UNION
SELECT nls_language
FROM fnd_languages
WHERE installed_flag = ‘B’)
ORDER BY user_profile_option_name;
//*
7. Forms personalization Listing
Purpose/Description:
To get modified profile options.
Personalization is a feature available in 11.5.10.X.
Parameters
None
*//
SELECT
ffft.user_function_name “User Form Name”
, ffcr.SEQUENCE
, ffcr.description
, ffcr.rule_type
, ffcr.enabled
, ffcr.trigger_event
, ffcr.trigger_object
, ffcr.condition
, ffcr.fire_in_enter_query
, (SELECT user_name
FROM fnd_user fu
WHERE fu.user_id = ffcr.created_by) “Created By”
FROM
fnd_form_custom_rules ffcr
, fnd_form_functions_vl ffft
WHERE ffcr.ID = ffft.function_id
ORDER BY 1;
//*
8. Patch Level Listing
Purpose/Description:
Query that can be used to view the patch level status of all modules
Parameters
None
*//
SELECT
a.application_name
, DECODE (b.status, ‘I’, ‘Installed’, ‘S’, ‘Shared’, ‘N/A’) status
, patch_level
FROM
apps.fnd_application_vl a
, apps.fnd_product_installations b
WHERE
a.application_id = b.application_id;
//*
9. Request attached to responsibility listing
Purpose/Description:
To see all requests attached to a responsibility
Parameters
None
*//
SELECT
responsibility_name
, frg.request_group_name
, fcpv.user_concurrent_program_name
, fcpv.description
FROM
fnd_request_groups frg
, fnd_request_group_units frgu
, fnd_concurrent_programs_vl fcpv
, fnd_responsibility_vl frv
WHERE
frgu.request_unit_type = ‘P’
AND frgu.request_group_id = frg.request_group_id
AND frgu.request_unit_id = fcpv.concurrent_program_id
AND frv.request_group_id = frg.request_group_id
ORDER BY responsibility_name;
//*
10. Request listing application wise
Purpose/Description:
View all request types application wise
Parameters
None
*//
SELECT
fa.application_short_name
, fcpv.user_concurrent_program_name
, description
, DECODE (fcpv.execution_method_code
,’B’, ‘Request Set Stage Function’
,’Q’, ‘SQL*Plus’
,’H’, ‘Host’
,’L’, ‘SQL*Loader’
,’A’, ‘Spawned’
,’I’, ‘PL/SQL Stored Procedure’
,’P’, ‘Oracle Reports’
,’S’, ‘Immediate’
,fcpv.execution_method_code) exe_method
, output_file_type
, program_type
, printer_name
, minimum_width
, minimum_length
, concurrent_program_name
, concurrent_program_id
FROM
fnd_concurrent_programs_vl fcpv
, fnd_application fa
WHERE
fcpv.application_id = fa.application_id
ORDER BY description
//*
11. Count Reports per module
Purpose/Description:
To Count Reports
Parameters
None
*//
SELECT
fa.application_short_name
, DECODE (fcpv.execution_method_code
,’B’, ‘Request Set Stage Function’
,’Q’, ‘SQL*Plus’
,’H’, ‘Host’
,’L’, ‘SQL*Loader’
,’A’, ‘Spawned’
,’I’, ‘PL/SQL Stored Procedure’
,’P’, ‘Oracle Reports’
,’S’, ‘Immediate’
,fcpv.execution_method_code) exe_method
, COUNT (concurrent_program_id) COUNT
FROM
fnd_concurrent_programs_vl fcpv
, fnd_application fa
WHERE
fcpv.application_id = fa.application_id
GROUP BY
fa.application_short_name
, fcpv.execution_method_code
ORDER BY 1;
//*
12. Request Status Listing
Purpose/Description:
This query returns report/request processing time
Parameters
None
*//
SELECT
f.request_id
, pt.user_concurrent_program_name user_concurrent_program_name
, f.actual_start_date actual_start_date
, f.actual_completion_date actual_completion_date
, floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)
‘ HOURS ‘
floor((((f.actual_completion_date-f.actual_start_date)*24*60*60) –
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600)/60)
‘ MINUTES ‘
round((((f.actual_completion_date-f.actual_start_date)*24*60*60) –
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600 –
(floor((((f.actual_completion_date-f.actual_start_date)*24*60*60) –
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600)/60)*60) ))
‘ SECS ‘ time_difference
, DECODE(p.concurrent_program_name
,’ALECDC’
,p.concurrent_program_name’[‘
f.description’]‘
,p.concurrent_program_name) concurrent_program_name
, decode(f.phase_code
,’R’,’Running’
,’C’,’Complete’
,f.phase_code) Phase
, f.status_code
FROM
apps.fnd_concurrent_programs p
, apps.fnd_concurrent_programs_tl pt
, apps.fnd_concurrent_requests f
WHERE
f.concurrent_program_id = p.concurrent_program_id
AND f.program_application_id = p.application_id
AND f.concurrent_program_id = pt.concurrent_program_id
AND f.program_application_id = pt.application_id
AND pt.language = USERENV(‘Lang’)
AND f.actual_start_date is not null
ORDER by f.actual_completion_date-f.actual_start_date desc;
//*
13. User and responsibility listing
Purpose/Description:
Check responsibilities assigned to users
Parameters
None
*//
SELECT UNIQUE
u.user_id
, SUBSTR (u.user_name, 1, 30) user_name
, SUBSTR (r.responsibility_name, 1, 60) responsiblity
, SUBSTR (a.application_name, 1, 50) application
FROM
fnd_user u
, fnd_user_resp_groups g
, fnd_application_tl a
, fnd_responsibility_tl r
WHERE g.user_id(+) = u.user_id
AND g.responsibility_application_id = a.application_id
AND a.application_id = r.application_id
AND g.responsibility_id = r.responsibility_id
–AND a.application_name like ‘%Order Man%’
ORDER BY SUBSTR (user_name, 1, 30),
SUBSTR (a.application_name, 1, 50),
SUBSTR (r.responsibility_name, 1, 60)
//*
14. Applied Patch Listing
Purpose/Description:
Check Current Applied Patches
Parameters
None
*//
SELECT
patch_name
, patch_type
, maint_pack_level
, creation_date
FROM applsys.ad_applied_patches
ORDER BY creation_date DESC
15. How to check the System Administarator responsiblity for the users in ORACLE EBS ?
set lines 2000
set pages 5000
col USER_NAME for a45
Select b.user_name, c.responsibility_name, a.START_DATE, a.END_DATE
from fnd_user_resp_groups_direct a, fnd_user b, fnd_responsibility_tl c
where a.user_id = b.user_id
and a.responsibility_id = c.responsibility_id
and c.responsibility_name=’System Administrator’
Step 3) Update fnd_concurrent_requests table to mark the request in error and completed
1 update fnd_concurrent_requests
2 set status_code='X', phase_code='C'
3 where request_id=2063673;
4
5 commit;
6
7 update fnd_concurrent_requests
8 set status_code='E', phase_code='C'
9 where request_id=2063673;
10
11 commit;
12
If this does not solve your problem then try restarting Standard Concurrent Manager and
Output Post Processor Concurrent Manager.
See
How To Troubleshoot Only One Concurrent Job Running at a Time Note 1504743.1
II)
a. Check the value for the following profile options:
Step5:- Copy the Concurrent Request Id for this Concurrent Program and Find the Log Trace File
for this Concurrent Request
Based on my experience I will share what all you need to check in Oracle Database
and Application in order to narrow down the issue. As soon as issue reported by the
application team DBA jumps into the database and application to resolve the issue.
But I believe that is not the correct way to troubleshoot. We may have to understand
the issue and always approach bottom down concept to troubleshoot the issue.
2. Was this running long in last few run as well, or this time only
5. Does this job runs any specific time or it can be run anytime
9. Query to get the row fetched using the SID from step 8.
declare
SID number := 0 ;
SERIAL number := 0 ;
machine varchar(10) := '';
terminal varchar(25) := '';
program varchar(30) := '';
sql_hash_value number := 0 ;
last_call_et number := 0 ;
proc number := 0 ;
spid number := 0 ;
select a.sid sid,
a.serial# serial,
a.username username,
a.status status ,
a.machine machine,
a.terminal terminal,
a.program program,
a.module module,
a.action action,
a.sql_hash_value sql_hash_value,
a.last_call_et last_call_et,
a.process proc,
b.spid spid,
sw.event event,
sw.state state
and a.sid='&1'
and a.inst_id=sw.inst_id
and a.sid=sw.sid;
begin
DBMS_OUTPUT.PUT_LINE('-----------------------------------------------------------------');
DBMS_OUTPUT.PUT_LINE('-----------------------------------------------------------------');
for m in cur1
loop
DBMS_OUTPUT.ENABLE(50000);
DBMS_OUTPUT.PUT_LINE(' ');
s.sql_hash_value=v.hash_value and
loop
dbms_output.put_line(rec.sql_text);
end loop;
DBMS_OUTPUT.PUT_LINE('--------------------------------------------------------------------');
DBMS_OUTPUT.PUT_LINE(' ');
end loop;
end;
11. Check which sql id it is running, you can get these details using above steps.
12. You should check the sql_id history and can run sql advisory against the
sql_id. this will give you incase of the sql query is not correct or may have
13. Check the stale value of the tables which is used by the concurrent program.
stale_stats='YES';
14. You may have to run the gather stats against those tables which are
having stale value.
15. You can also use OEM and monitor the Session id.
After checking these above points you can definitely narrow down the issue and
based on your finding you can suggest the user corrective action item.