查看当前正在运行的请求

时间:2021-08-24 23:27:25

--查看当前正在运行的报表(如果查不到,则把这行注释and a.phase_code in ('I','P','R','T'))

/* Formatted on 2018/3/15 13:00:50 (QP5 v5.256.13226.35538) */

SELECT q.concurrent_queue_name qname

     , f.user_name || ': ' || f.description user_desc

     , a.request_id "Req Id"

     , DECODE (a.parent_request_id, -1, NULL, a.parent_request_id) "Parent"

     , a.concurrent_program_id "Prg Id"

     , DECODE (a.phase_code,  'C', 'Completed',  'I', 'Inactive',  'P', 'Pending',  'R', 'Running',  a.phase_code) "Phase_Code"

     , DECODE (a.status_code

             , 'G', 'Warning'

             , 'C', 'Normal'

             , 'E', 'Error'

             , 'R', 'Normal'

             , 'D', 'Cancelled'

             , 'I', 'Scheduled'

             , 'X', 'Terminated'

             , a.status_code)

          "Status_Code"

     --      ,b.os_process_id "OS"

     --      ,vs.sid

     --      ,vs.serial# "Serial#"

     --      ,vp.spid

     , a.oracle_process_id "spid"

     , a.actual_start_date

     , a.actual_completion_date

     , ROUND ( (NVL (a.actual_completion_date, SYSDATE) - a.actual_start_date) * 1440, 2) "Time--Minutes"

     , c.concurrent_program_name || ' - ' || c2.user_concurrent_program_name || ' ' || a.description "Program"

     , a.argument_text

  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';