-- Script to display status of all Concurrent Managers
-- Uses :sqlplus> apps/<apps_password>

set head on
Column OsId Format A10
Column CpId Format 999999
Column Opid Format 999
Column Manager Format A30
Column Status Format A20
Column Started_At Format A30

Column Cpid Heading 'Concurrent|Process ID'
Column OsId Heading 'System|Process ID'
Column Opid Heading 'Oracle|Process ID'
Column Manager Heading 'Concurrent Manager Name'
Column Status Heading 'Status|of Concurrent|Manager'
Column Started_At Heading 'Concurrent Manager|Started at'
Column Opid Justify Left


Select distinct Concurrent_Process_Id CpId, PID Opid,
Os_Process_ID Osid,
Q.Concurrent_Queue_Name Manager,
P.process_status_code Status,
To_Char(P.Process_Start_Date, 'MM-DD-YYYY HH:MI:SSAM') Started_At
from apps.Fnd_Concurrent_Processes P, apps.Fnd_Concurrent_Queues Q, apps.FND_V$Process
where Q.Application_Id = Queue_Application_ID
And (Q.Concurrent_Queue_ID = P.Concurrent_Queue_ID)
And ( Spid = Os_Process_ID )
And Process_Status_Code not in ('K','S')
Order by Concurrent_Process_ID, Os_Process_Id, Q.Concurrent_Queue_Name ;