2014-08-09 Created by Baoxinjian
Looking on what 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 all 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.
[SQL]View Plaincopyprint?
- 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) * 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
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_timefrom Applsys.fnd_ Concurrent_requests a2,applsys.fnd_concurrent_programs c2where c2.concurrent_program_id = C.CONCURRENT_PROGRAM_ Idand a2.concurrent_program_id = C2.concurrent_program_idand a2.program_application_id = C2.application_idAND A2.phase_code | | ' = ' C ') Avg_mins,round ((actual_completion_date-requested_start_date), 2) * Duration_in_hoursfrom 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 frtwhere A.controlling_manager = B.concurrent_process_idand a.concurrent_program_id = C.concurrent_program_idand a.program_application_id = C.application_idand A.phase_code = ' r ' and A.status_code = ' R ' and b . queue_application_id = Q.application_idand b.concurrent_queue_id = Q.concurrent_queue_idand CTL.CONCURRENT_PROGRAM_ id = C.concurrent_program_idand A.requested_by = Fu.user_idand a.responsibility_id = Frt.responsibility_idorder 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 all running request, query the v$session or V$session_longops table to see what's the RE Quest ID doing in the backend.
[SQL]View Plaincopyprint?
- 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
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_timefrom v$process A, v$session B, v$sqltext cwhere a.addr=b.paddrand b.sql_hash_value = C.has H_valueand b.status = ' ACTIVE ' and a.spid = ' 11696 ' ORDER by A.spid, c.piece
Replace v$session with Gv$session if the database are running on RAC environment. Enable or set trace if you wish to know more details on the session.
Thanks and regards
Dba_oracle ERP Concurrent program run status query and monitoring (case)