SELECT REQUEST_ID,
a.user_name,
f.ACTUAL_START_DATE DATE_STARTED,
DECODE(TRUNC(sysdate - ACTUAL_START_DATE),
0,
NULL,
TRUNC(sysdate - f.ACTUAL_START_DATE) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(sysdate - f.ACTUAL_START_DATE, 1) * 86400),
'SSSSS'),
'HH24:MI:SS') REQ_DURATION,
s.SID,
s.SERIAL#,
s.status,
p.SPID,
s.MODULE,
p.CONCURRENT_PROGRAM_NAME CONC_PROGRAM,
ARGUMENT_TEXT
FROM applsys.fnd_concurrent_requests f,
applsys.fnd_user a,
applsys.fnd_concurrent_programs p,
v$process p,
v$session s
WHERE a.user_id(+) = f.REQUESTED_BY
AND f.CONCURRENT_PROGRAM_ID = p.CONCURRENT_PROGRAM_ID
AND TRUNC(f.ACTUAL_START_DATE) > TRUNC(SYSDATE - 30)
--AND request_id = 1491647
AND phase_code = 'R'
AND s.paddr = p.addr
AND f.ORACLE_PROCESS_ID = p.spid
--AND status_code = 'C'
--AND p.CONCURRENT_PROGRAM_NAME LIKE '%XLAACCUP%'
--AND a.user_name like 'ACHASAPI'
--AND ARGUMENT_TEXT LIKE '%TPA_Prov_IN%'
--AND completion_text = 'Normal completion'
ORDER BY requested_start_date DESC;