Concurrent program SQL statement currently running in background

By Amol Jadhav
Concurrent program SQL statement currently running in background
Oracle apps current sql query
oracle sql running in session
oracle sql running in background

Step1 :  Run the below query ,  this will list all the programs that currently running in Application. Take the SID and use it in the second query.

SQL Querysql
1SELECT f.user_name,
2         a.request_id                                 "Req Id",
3         a.concurrent_program_id                      "Prg Id",
4         a.RESPONSIBILITY_ID                          Responsibility,
5         a.phase_code,
6         a.status_code,
7         b.os_process_id                              "OS",
8         vs.sid,
9         vs.serial#                                   "Serial#",
10         vp.spid,
11         TO_CHAR (request_date, 'DD-MON-YY hh24:mi:ss') request_date,
12         (NVL (a.actual_completion_date, SYSDATE) - a.actual_start_date) * 1440
13            "Time",
14         c.concurrent_program_name || ' - ' || c2.user_concurrent_program_name
15            "Program"
16    FROM APPLSYS.fnd_Concurrent_requests  a,
17         APPLSYS.fnd_concurrent_processes b,
18         applsys.fnd_concurrent_queues    q,
19         APPLSYS.fnd_concurrent_programs_tl c2,
20         APPLSYS.fnd_concurrent_programs  c,
21         APPLSYS.fnd_user                 f,
22         v$session                        vs,
23         v$process                        vp
24   WHERE     a.controlling_manager = b.concurrent_process_id
25         AND a.concurrent_program_id = c.concurrent_program_id
26         AND a.program_application_id = c.application_id
27         AND c2.concurrent_program_id = c.concurrent_program_id
28         AND c2.application_id = c.application_id
29         AND a.phase_code IN ('I',
30                              'P',
31                              'R',
32                              'T')
33         AND a.requested_by = f.user_id
34         AND b.queue_application_id = q.application_id
35         AND b.concurrent_queue_id = q.concurrent_queue_id
36         AND c2.LANGUAGE = 'US'
37         AND a.oracle_process_id = vp.spid
38         AND a.request_id = '<Provide concurrentyour request ID>'
39         AND vs.paddr = vp.addr
40ORDER BY 9


Step 2 : Get SID from step 1 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.

SQL Querysql
1SELECT sql_text
2    FROM v$sqltext t, v$session s
3   WHERE     t.ADDRESS = s.SQL_ADDRESS
4         AND t.HASH_VALUE = s.SQL_HASH_VALUE
5         AND s.sid = 144  -- Get this value from step 1
6ORDER BY PIECE

Related posts: