You are on page 1of 10

Scheduled concurrent requests Lot of times we need to find out the concurrent programs scheduled.

Users can sc hedule the concurrent requests in three ways (To run once at a specified time / To run periodically / To run on specific days of the month or week). The below query will return all the concurrent requests which are scheduled usin g any of the above methods:

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; Note: The "SCHEDULE" column in the above query returns a string of zeros and one s for the requests which are scheduled on specific days of the month or week. Positions 1 through 31: Specific day of the month. Position 32: Last day of the month Positions 33 through 39: Sunday through Saturday 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 du plicated schedules. Note: This query will return even though the request was submitted using a diffe rent 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 Average pending time per request This is a very useful query to check the performance of the concurrent managers. Average pending time for a request is calculated like below: ("Highest of Requested_start_date or Date_submitted" - Actual_start_date ) / Tot al requests

A Request can be in Pending state for variety of reasons like conflict with othe r requests, improperly tuned managers (sleep seconds / cache size / number of ma nagers etc) We can schedule this script to gather data regularly for historical analysis as we normally purge the concurrent requests regularly. SELECT TO_CHAR (actual_start_date, 'DD-MON-YYYY') DAY, concurrent_queue_name, (SUM ( ( actual_start_date - (CASE WHEN requested_start_date > request_date THEN requested_start_date ELSE request_date END ) ) * 24 * 60 * 60 ) ) / COUNT (*) "Wait_Time_per_Req_in_Secs" FROM apps.fnd_concurrent_requests cr, apps.fnd_concurrent_processes fcp, apps.fnd_concurrent_queues fcq WHERE cr.phase_code = 'C' AND cr.actual_start_date IS NOT NULL AND cr.requested_start_date IS NOT NULL AND cr.controlling_manager = fcp.concurrent_process_id AND fcp.queue_application_id = fcq.application_id AND fcp.concurrent_queue_id = fcq.concurrent_queue_id GROUP BY TO_CHAR (actual_start_date, 'DD-MON-YYYY'), concurrent_queue_name ORDER BY 2 Note: Depending on the purging schedules some requests might miss if the corresp onding data in fnd_concurrent_processes is purged. Checking which manager is going to execute a program The below query identifies the manager which will be executing a given program. This query is based on the specialization rules set for the managers. SELECT user_concurrent_program_name, user_concurrent_queue_name FROM apps.fnd_concurrent_programs_tl cp, apps.fnd_concurrent_queue_content cqc, apps.fnd_concurrent_queues_tl cq WHERE cqc.type_application_id(+) = cp.application_id AND cqc.type_id(+) = cp.concurrent_program_id AND cqc.type_code(+) = 'P' AND cqc.include_flag(+) = 'I' AND cp.LANGUAGE = 'US' AND cp.user_concurrent_program_name = '&USER_CONCURRENT_PROGRAM_NAME' AND NVL (cqc.concurrent_queue_id, 0) = cq.concurrent_queue_id AND NVL (cqc.queue_application_id, 0) = cq.application_id AND cq.LANGUAGE = 'US' To see all the pending / Running requests per each manager wise

SELECT request_id, phase_code, status_code, user_name, user_concurrent_queue_name FROM apps.fnd_concurrent_worker_requests cwr, apps.fnd_concurrent_queues_tl cq, apps.fnd_user fu WHERE (cwr.phase_code = 'P' OR cwr.phase_code = 'R') AND cwr.hold_flag != 'Y' AND cwr.requested_start_date <= SYSDATE AND cwr.concurrent_queue_id = cq.concurrent_queue_id AND cwr.queue_application_id = cq.application_id AND cq.LANGUAGE = 'US' AND cwr.requested_by = fu.user_id ORDER BY 5 Note: The same information can be seen in Administer Concurrent Manager form for each manager. Checking the incompatibilities between the programs The below query can be used to find all incompatibilities in an application inst ance. SELECT a2.application_name, a1.user_concurrent_program_name, DECODE (running_type, 'P', 'Program', 'S', 'Request set', 'UNKNOWN' ) "Type", b2.application_name "Incompatible App", b1.user_concurrent_program_name "Incompatible_Prog", DECODE (to_run_type, 'P', 'Program', 'S', 'Request set', 'UNKNOWN' ) incompatible_type FROM apps.fnd_concurrent_program_serial cps, apps.fnd_concurrent_programs_tl a1, apps.fnd_concurrent_programs_tl b1, apps.fnd_application_tl a2, apps.fnd_application_tl b2 WHERE a1.application_id = cps.running_application_id AND a1.concurrent_program_id = cps.running_concurrent_program_id AND a2.application_id = cps.running_application_id AND b1.application_id = cps.to_run_application_id AND b1.concurrent_program_id = cps.to_run_concurrent_program_id AND b2.application_id = cps.to_run_application_id AND a1.language = 'US' AND a2.language = 'US' AND b1.language = 'US' AND b2.language = 'US'

------------------------------------------------------------------------------Query to find the responsibilities to which the request is been assigned

------------------------------------------------------------------------------SELECT DISTINCT * FROM fnd_responsibility_tl WHERE responsibility_id IN ( SELECT responsibility_id FROM fnd_responsibility_vl WHERE request_group_id IN ( SELECT request_group_id FROM fnd_request_group_units WHERE request_unit_id = (SELECT DISTINCT concurrent_program_id FROM fnd_concurrent_programs_tl WHERE user_concurrent_program_name = :Concurrent_Program_name)) AND end_date IS NULL) AND "LANGUAGE" LIKE 'US' ORDER BY responsibility_name --------------------------------------------------------Query to find the application name --------------------------------------------------------SELECT * FROM fnd_application "application name" WHERE application_id IN (SELECT application_id FROM fnd_request_group_units WHERE request_unit_id=(SELECT DISTINCT concurrent_program_id FROM fnd_concurrent_programs_tl WHERE user_concurrent_program_name=:Concurrent_Program_name)) --------------------------------------------------------Query to find the concurrent program short name --------------------------------------------------------SELECT * FROM fnd_concurrent_programs WHERE concurrent_program_id=(SELECT DISTINCT concurrent_program_id FROM fnd_concurrent_programs_tl WHERE user_concurrent_program_name=:Concurrent_Program_name) --------------------------------------------------------Query to find the execution file name for the request --------------------------------------------------------SELECT * FROM fnd_executables WHERE executable_id=(SELECT executable_id FROM fnd_concurrent_programs WHERE concurrent_program_id=(SELECT DISTINCT concurrent_program_id FROM fnd_concurrent_programs_tl WHERE user_concurrent_program_name=:Concurrent_Program_name)) --------------------------------------------------------Query to find the requests groups --------------------------------------------------------SELECT * FROM fnd_request_groups "requests groups" WHERE request_group_id IN (SELECT request_group_id FROM fnd_request_group_units WHERE request_unit_id=(SELECT DISTINCT concurrent_program_id FROM fnd_concurrent_programs_tl WHERE user_concurrent_program_name=:Concurrent_Program_name))

--------------------------------------------------------Query for identifying if it is a child process --------------------------------------------------------SELECT * FROM fnd_concurrent_requests WHERE parent_request_id IS NOT NULL AND program_application_id = 20003 AND concurrent_program_id = (SELECT DISTINCT concurrent_program_id FROM fnd_concurrent_programs_tl WHERE user_concurrent_program_name LIKE :Concurrent_Program_name) --------------------------------------------------------Delete the programs from the application --------------------------------------------------------begin fnd_program.delete_program('program short name','schema name'); fnd_program.delete_executable('program short name','schema name'); commit; end;

----------------------------------------------------------------------------------------------------------------------------------------------------------The following script will find the responsibility than can run a given concurren t program OR request set. The second script will find the responsibility than ca n run a given concurrent program ANDrequest set. ----------------------------------------------------------------------------------------------------------------------------------------------------------SELECT 'REQUEST SET' TYPE ,fr.responsibility_name ,frg.request_group_name ,frs.user_request_set_name FROM fnd_request_group_units frgus ,fnd_request_sets_vl frs ,fnd_request_groups frg ,fnd_responsibility_vl fr WHERE 1=1 AND fr.request_group_id = frg.request_group_id AND frg.request_group_id = frgus.request_group_id AND frgus.request_unit_type = 'S' AND frgus.request_unit_id = frs.request_set_id AND frs.user_request_set_name LIKE &user_request_set_name AND frs.request_set_name LIKE &request_set_name UNION SELECT 'CONC PROG' TYPE ,fr.responsibility_name ,frg.request_group_name ,fcp.user_concurrent_program_name FROM fnd_request_group_units frgup ,fnd_concurrent_programs_vl fcp ,fnd_request_groups frg ,fnd_responsibility_vl fr WHERE 1=1

AND AND AND AND AND AND

fr.request_group_id = frg.request_group_id frg.request_group_id = frgup.request_group_id frgup.request_unit_type = 'P' frgup.request_unit_id = fcp.concurrent_program_id fcp.user_concurrent_program_name LIKE &user_concurrent_program_name fcp.concurrent_program_name LIKE &concurrent_program_name

-----------------------------------------------------------------------------------------------------------------------------------------------------------Find concurrent programs attached to certain responsibility. -----------------------------------------------------------------------------------------------------------------------------------------------------------select * from fnd_concurrent_programs_tl where concurrent_program_id in ( select request_unit_id from fnd_request_group_units where request_group_id in ( select request_group_id from fnd_request_groups where request_group_id in ( select request_group_id from fnd_responsibility where responsibility_key = 'YOUR RESPONSIBILITY KEY') )) -----------------------------------------------------------------------------------------------------------------------------------------------------------Find all responsibilities and concurrent program names based on the executable N ame -----------------------------------------------------------------------------------------------------------------------------------------------------------select --r.rowid rrowid,p.rowid prowid,e.rowid erowid,fcp.rowid frowid, e.executable_name,responsibility_key,user_concurrent_program_name from fnd_responsibility r, fnd_concurrent_programs_tl p, fnd_request_group_units u, fnd_executables e, fnd_concurrent_programs fcp where r.request_group_id=u.request_group_id and u.request_unit_id = p.concurrent_program_id and executable_name like '%SEARCH EXECUTABLE PATTERN%' and fcp.executable_id = e.executable_id and user_concurrent_program_name like '%SEARCH PATTERN%' and fcp.concurrent_program_id = p.concurrent_program_id -----------------------------------------------------------------------------------------------------------------------------------------------------------Find all responsibilities having the "search concurrent program" attached to the request group ------------------------------------------------------------------------------------------------------------------------------------------------------------------> select responsibility_key,user_concurrent_program_name from fnd_responsibility r, fnd_concurrent_programs_tl p, fnd_request_group_units u

where r.request_group_id=u.request_group_id and u.request_unit_id = p.concurrent_program_id and user_concurrent_program_name like '%SEARCH PATTERN%' ---------------< -----------------------------------------------------------------------------------------------------------------------------------------------------------Find concurrent Program Names based on Responsibility Key Value -----------------------------------------------------------------------------------------------------------------------------------------------------------select * from fnd_concurrent_programs_tl where concurrent_program_id in ( select request_unit_id from fnd_request_group_units where request_group_id in ( select request_group_id from fnd_request_groups where request_group_id in ( select request_group_id from fnd_responsibility where responsibility_key = 'Your Responsibility Key Search Pattern') )) / Note that all the parameters must be entered with a '%' if not used. ----------------------------------------------------------------------------------------------------------------------------------------------------------SELECT fr.responsibility_name FROM fnd_request_group_units frgus ,fnd_request_sets_vl frs ,fnd_request_groups frg ,fnd_responsibility_vl fr WHERE 1=1 AND fr.request_group_id = frg.request_group_id AND frg.request_group_id = frgus.request_group_id AND frgus.request_unit_type = 'S' AND frgus.request_unit_id = frs.request_set_id AND frs.user_request_set_name LIKE :user_request_set_name AND frs.request_set_name LIKE :request_set_name INTERSECT SELECT fr.responsibility_name FROM fnd_request_group_units frgup ,fnd_concurrent_programs_vl fcp ,fnd_request_groups frg ,fnd_responsibility_vl fr WHERE 1=1 AND fr.request_group_id = frg.request_group_id AND frg.request_group_id = frgup.request_group_id AND frgup.request_unit_type = 'P' AND frgup.request_unit_id = fcp.concurrent_program_id AND fcp.user_concurrent_program_name LIKE :user_concurrent_program_name AND fcp.concurrent_program_name LIKE :concurrent_program_name ----------------------------------------------------------------------------------------------------------------------------------------------------------select A.CONCURRENT_PROGRAM_NAME, A.USER_CONCURRENT_PROGRAM_NAME, A.description, B.executable_Name,

B.USER_EXECUTABLE_NAME,EXECUTION_FILE_NAME,B.description from FND_CONCURRENT_PRO GRAMS_VL A, FND_EXECUTABLES_FORM_V B where upper(A.User_concurrent_program_name) like '%%' and A.EXECUTION_METHOD_COD E = 'I' AND A.EXECUTABLE_ID = B.EXECUTABLE_ID; ----------------------------------------------------------------------------------------------------------------------------------------------------------SELECT DISTINCT FCPL.USER_CONCURRENT_PROGRAM_NAME , FCP.CONCURRENT_PROGRAM_NAME , FAPP.APPLICATION_NAME , FRG.REQUEST_GROUP_NAME --, FNRTL.RESPONSIBILITY_NAME FROM APPS.FND_REQUEST_GROUPS FRG , APPS.FND_APPLICATION_TL FAPP , APPS.FND_REQUEST_GROUP_UNITS FRGU , APPS.FND_CONCURRENT_PROGRAMS FCP , APPS.FND_CONCURRENT_PROGRAMS_TL FCPL , APPS.FND_RESPONSIBILITY FNR , APPS.FND_RESPONSIBILITY_TL FNRTL WHERE FRG.APPLICATION_ID =FAPP.APPLICATION_ID AND FRG.APPLICATION_ID = FRGU.APPLICATION_ID AND FRG.REQUEST_GROUP_ID = FRGU.REQUEST_GROUP_ID AND FRG.REQUEST_GROUP_ID = FNR.REQUEST_GROUP_ID AND FRG.APPLICATION_ID = FNR.APPLICATION_ID AND FNR.RESPONSIBILITY_ID = FNRTL.RESPONSIBILITY_ID AND FRGU.REQUEST_UNIT_ID = FCP.CONCURRENT_PROGRAM_ID AND FRGU.UNIT_APPLICATION_ID = FCP.APPLICATION_ID AND FCP.CONCURRENT_PROGRAM_ID = FCPL.CONCURRENT_PROGRAM_ID AND FCPL.USER_CONCURRENT_PROGRAM_NAME IN (select A.USER_CONCURRENT_PROGRAM_NAME from FND_CONCURRENT_PROGRAMS_VL A, FND_EXECUTABLES_FORM_V B where upper(A.User_concurrent_program_name) like '%%' and A.EXECUTION_METHOD_COD E = 'I' AND A.EXECUTABLE_ID = B.EXECUTABLE_ID) AND FNRTL.LANGUAGE = 'US' AND FAPP.LANGUAGE = 'US'; -----------------------------------------------------------------------------------------------------------------------------------------------------------final query: SELECT DISTINCT FCPL.USER_CONCURRENT_PROGRAM_NAME , FCP.CONCURRENT_PROGRAM_NAME , FAPP.APPLICATION_NAME , FRG.REQUEST_GROUP_NAME , FNRTL.RESPONSIBILITY_NAME ,FNRTL.responsibility_id FROM APPS.FND_REQUEST_GROUPS FRG , APPS.FND_APPLICATION_TL FAPP , APPS.FND_REQUEST_GROUP_UNITS FRGU , APPS.FND_CONCURRENT_PROGRAMS FCP , APPS.FND_CONCURRENT_PROGRAMS_TL FCPL , APPS.FND_RESPONSIBILITY FNR

, APPS.FND_RESPONSIBILITY_TL FNRTL WHERE FRG.APPLICATION_ID =FAPP.APPLICATION_ID AND FRG.APPLICATION_ID = FRGU.APPLICATION_ID AND FRG.REQUEST_GROUP_ID = FRGU.REQUEST_GROUP_ID AND FRG.REQUEST_GROUP_ID = FNR.REQUEST_GROUP_ID AND FRG.APPLICATION_ID = FNR.APPLICATION_ID AND FNR.RESPONSIBILITY_ID = FNRTL.RESPONSIBILITY_ID AND FRGU.REQUEST_UNIT_ID = FCP.CONCURRENT_PROGRAM_ID AND FRGU.UNIT_APPLICATION_ID = FCP.APPLICATION_ID AND FCP.CONCURRENT_PROGRAM_ID = FCPL.CONCURRENT_PROGRAM_ID AND Upper(FNRTL.responsibility_name) like upper('%us%Payables%') AND FCPL.USER_CONCURRENT_PROGRAM_NAME IN (select A.USER_CONCURRENT_PROGRAM_NAME from FND_CONCURRENT_PROGRAMS_VL A, F ND_EXECUTABLES_FORM_V B where upper(A.User_concurrent_progra m_name) like '%%' and A.EXECUTION_METHOD_CODE = 'I' AND A.EXECUTABLE_ID = B.EXECUTABLE _ID) AND FNRTL.LANGUAGE = 'US' AND FAPP.LANGUAGE = 'US' and FNRTL.LANGUAGE = 'US' order by FNRTL.responsibility_name;

You might also like