Escolar Documentos
Profissional Documentos
Cultura Documentos
Description
Wait for the request completion, then return the request phase/status and
completion message to the caller. Also call sleep between database checks.
Arguments (input)
request_id
The request ID of the program to wait on.
interval
Time to wait between checks. This is the number of seconds to sleep.
The default is 60 seconds.
max_wait
The maximum time in seconds to wait for the requests completion.
Arguments (output)
phase
The user friendly request phase from FND_LOOKUPS.
status
The user friendly request status from FND_LOOKUPS.
dev_phase
The request phase as a constant string that can be used for program
logic comparisons.
dev_status
The request status as a constant string that can be used for program
logic comparisons.
message
The completion message supplied if the request has completed.
BEGIN
l_request_id :=
fnd_request.submit_request (‘XXCUS’,
‘XXCUSSPOOL’,
NULL,
NULL,
FALSE,
p_filename_i,
p_seq_i
);
END;
p_request_id_o := l_request_id;
Author: Jay
Substitute &user or pass as parameter
******************/
SELECT
fcr.REQUEST_ID,
FU.USER_NAME,
fcr.PHASE_CODE,
fcr.STATUS_CODE,
(fcr.ACTUAL_COMPLETION_DATE –
fcr.ACTUAL_START_DATE) * 24* 60 TIME_MINS,
fcpt.USER_CONCURRENT_PROGRAM_NAME,
fcp.CONCURRENT_PROGRAM_NAME,
fcr.ACTUAL_START_DATE,
fcr.ACTUAL_COMPLETION_DATE,
fcp.CONCURRENT_PROGRAM_NAME
FROM
apps.FND_CONCURRENT_REQUESTS FCR,
apps.FND_CONCURRENT_PROGRAMS FCP,
apps.FND_CONCURRENT_PROGRAMS_TL FCPT,
apps.FND_USER FU
WHERE 1=1
AND FCP.CONCURRENT_PROGRAM_ID=FCR.CONCURRENT_PROGRAM_ID
AND FCPT.CONCURRENT_PROGRAM_ID=FCP.CONCURRENT_PROGRAM_ID
AND FCR.REQUESTED_BY = FU.USER_ID
AND FU.USER_NAME = ‘&user’
ORDER BY FCR.REQUEST_ID DESC;
A concurrent request has a life cycle consisting of the following phases: pending, running,
completed, and inactive.
During each phase, a concurrent request has a specific condition or status. lists each
phase/status combination and describes its meaning in relation to a request.
If a request is pending, you can determine when it will start by using the Concurrent
Managers For the Request window from the Requests window to review the request’s
position in the queues of current managers that can run that request.
The database tables that are affected by running the Purge Concurrent Request and/or
Manager Data program are:
FND_CONCURRENT_REQUESTS
This table contains a complete history of all concurrent requests.
FND_RUN_REQUESTS
When a user submits a report set, this table stores information about the reports in the
report set and the parameter values for each report.
FND_CONC_REQUEST_ARGUMENTS
This table records arguments passed by the concurrent manager to each program it starts
running.
FND_DUAL
This table records when requests do not update database tables.
FND_CONCURRENT_PROCESSES
This table records information about Oracle Applications and operating system processes.
FND_CONC_STAT_LIST
This table collects runtime performance statistics for concurrent requests.
FND_CONC_STAT_SUMMARY
This table contains the concurrent program performance statistics generated by the Purge
Concurrent Request and/or Manager Data program. The Purge Concurrent Request and/or
Manager Data program uses the data in FND_CONC_STAT_LIST to compute these
statistics.
Phase Status Description
PENDING Normal Request is waiting for the next available manager
Program to run request is incompatible with other program(s) currently
Standby running
Scheduled Request is scheduled to start at a future time or date.
A child request is waiting for its Parent request to mark it ready to run.
For example, a request in a request set that runs sequentially must wait
Waiting for a prior request to complete
RUNNING Normal Request is running normally
Parent request pauses for all its child requests to finish running. For
Paused example, a request set pauses for all requests in the set to complete.
All requests submitted by the same parent request have completed
Resuming running. The Parent request resumes running.
Request is terminated by choosing the Cancel Request button in Requests
Terminating window
COMPLETEDNormal Request completed successfully.
Error Request failed to complete successfully
Request completed with warnings. For example, a request is generated
Warning successfully but fails to print
Pending or Inactive request is cancelled by choosing the Cancel Request
Cancelled button in the Requests window.
Request is terminated by choosing the Cancel Request button in the
Terminated Requests window.
Inactive Disabled Program to run request is not enabled. Contact your system administrator.
Pending request is placed on hold by choosing the Hold Request button
On Hold in the Requests window.
No manager is defined to run the request. Check with your system
No administrator. A status of No Manager is also given when all managers
Manager are locked by run-alone requests.
Oracle Concurrent query slow, what happened?
You have to have request_id in where clause with request_id > :id so that it uses index and runs faster.
There may be other issues involved with slow performance, but I find this one is common.
These descriptive flexfield columns do not contain values unless you have defined the descriptive
flexfield at your site. You need one row for each independent, dependent or parent value
belonging to a value set.Oracle Application Object Library uses this information to ensure that
users enter valid values in flexfield segments
I often use this script to find the concurrent jobs ran yesterday and
Failed. You can also automate the script into unix shell or some oracle alerts.
SELECT
fu.user_name,
fcpt.USER_CONCURRENT_PROGRAM_NAME,
fcpt.description,
fcp.CONCURRENT_PROGRAM_NAME,
fcr.REQUEST_ID,
round((fcr.actual_completion_date –
decode(trunc(fcr.request_date),fcr.requested_start_date,fcr.request_date,fcr.re
quested_start_date))*60*24)WaitTimeMIN,
DECODE(fcr.PHASE_CODE,‘C’,‘Completed’,‘R’,‘Running’,fcr.PHASE_CODE) PHASE_CODE,
DECODE(fcr.STATUS_CODE,‘C’,‘Completed’,‘R’,‘Running’,‘W’,‘Paused’,‘E’,‘Error’,‘
G’, ‘Warning’, fcr.STATUS_CODE) STATUS_CODE,
to_char(fcr.request_date,‘DD-MON-YYYY HH24:MI:SS’) request_date,
to_char(fcr.requested_start_date,‘DD-MON-YYYY HH24:MI:SS’) start_time,
to_char(fcr.actual_completion_date,‘DD-MON-YYYY HH24:MI:SS’) complete_time
FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcpt,
fnd_user fu
WHERE 1=1
AND fcp.CONCURRENT_PROGRAM_ID=fcr.CONCURRENT_PROGRAM_ID
AND fcpt.CONCURRENT_PROGRAM_ID=fcp.CONCURRENT_PROGRAM_ID
AND fcr.requested_by = fu.user_id
AND trunc(fcr.request_date) BETWEEN sysdate – 1 AND sysdate
AND fcr.status_code IN (‘E’,‘G’)
ORDER BY fcr.status_code,fcp.CONCURRENT_PROGRAM_NAME,fcr.REQUEST_ID;
Here is the shell script that you can put it in crontab to run daily to send you
email
#!/bin/sh
#
# Author: Jiltin
# Test email for future cronjobs
#
FILENAME=DailyReport
FILETEXT=$FILENAME.txt
source /usr/local/bin/production.env
sqlplus -s username/password@database <<EOF
–alter session set current_schema=apps;
SET echo OFF
SET feedback OFF
SET heading on
SET linesize 221
SET pagesize 55
SET newpage 0
spool $FILETEXT
column today new_value CURR_DATE noprint
SELECT to_char(sysdate,‘DD-MON-YYYY HH24:MI:SS’) today from dual;
TTITLE left ‘JILERRCC’ CENTER ‘Jiltin Corporation’ –
RIGHT ‘DATE:’ CURR_DATE skip 1 -
CENTER ‘Concurrent Jobs Errored Yesterday’ -
RIGHT ‘PAGE:’ format 999 SQL.PNO skip 1 -
column user_name format a10
column USER_CONCURRENT_PROGRAM_NAME format a40
column description format a50
column CONCURRENT_PROGRAM_NAME format a10
column REQUEST_ID format 99999999
column WaitTimeMIN format 9999.99
column PHASE_CODE format a10
column STATUS_CODE format a10
column request_date format a20
column start_time format a20
column complete_time format a20
BREAK ON status_code SKIP 1
SELECT
fu.user_name,
fcpt.USER_CONCURRENT_PROGRAM_NAME,
fcpt.description,
fcp.CONCURRENT_PROGRAM_NAME,
fcr.REQUEST_ID,
round((fcr.actual_completion_date –
decode(trunc(fcr.request_date),fcr.requested_start_date,fcr.request_date,fcr.requested_sta
rt_date))*60*24) WaitTimeMIN,
DECODE(fcr.PHASE_CODE,‘C’,‘Completed’,‘R’,‘Running’,fcr.PHASE_CODE) PHASE_CO
DE,
DECODE(fcr.STATUS_CODE,‘C’,‘Completed’,‘R’,‘Running’,‘W’,‘Paused’,‘E’,‘Error’,‘G’, ‘War
ning’, fcr.STATUS_CODE) STATUS_CODE,
to_char(fcr.request_date,‘DD-MON-YYYY HH24:MI:SS’) request_date,
to_char(fcr.requested_start_date,‘DD-MON-YYYY HH24:MI:SS’) start_time,
to_char(fcr.actual_completion_date,‘DD-MON-YYYY HH24:MI:SS’) complete_time
FROM
fnd_concurrent_requests fcr,
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcpt,
fnd_user fu
WHERE 1=1
AND fcp.CONCURRENT_PROGRAM_ID=fcr.CONCURRENT_PROGRAM_ID
AND fcpt.CONCURRENT_PROGRAM_ID=fcp.CONCURRENT_PROGRAM_ID
AND fcr.requested_by = fu.user_id
and trunc(fcr.request_date) between sysdate – 1 and sysdate
AND fcr.status_code in (‘E’,‘G’)
order by fcr.status_code,fcp.CONCURRENT_PROGRAM_NAME,fcr.REQUEST_ID;
spool off;
EOF
mail -s "Yesterday Concurrent Program status! Reported on `date` " support@notesbit.com
< $FILETEXT