Tuesday, October 16, 2012

Query to Find the SID of the a Concurrent Program running from Application

SELECT   fcr.request_id
       , SUBSTR (DECODE (fcr.description
                       , NULL, fcp.user_concurrent_program_name
                       , fcr.description || ' (' || fcp.user_concurrent_program_name || ')'
                        )
               , 1
               , 40
                ) conc_prog_name
       , TO_CHAR (fcr.actual_start_date, 'hh24:mi') s_time
       , fu.user_name requestor
       , SID
       , vs.process
       , vp.spid
FROM     v$session vs
       , v$process vp
       , apps.fnd_user fu
       , apps.fnd_concurrent_programs_vl fcp
       , apps.fnd_concurrent_requests fcr
   WHERE fcp.concurrent_program_id = fcr.concurrent_program_id
     AND fcr.program_application_id = fcp.application_id
     AND fcr.status_code = 'R'
     AND fcr.phase_code = 'R'
     AND fcr.requested_by = fu.user_id
     AND fcr.oracle_process_id = vp.spid(+)
     AND vp.addr = vs.paddr(+)
     AND fcr.request_id = :request_id
ORDER BY SUBSTR (DECODE (fcr.description
                       , NULL, fcp.user_concurrent_program_name
                       , fcr.description || ' (' || fcp.user_concurrent_program_name || ')'
                        )
               , 1
               , 40
                )
       , fcr.actual_start_date
     

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.