It provides the average time taken by requests to run.
SELECT /*+ index(r FND_CONCURRENT_REQUESTS_N6) */ f.application_short_name apps, p.concurrent_program_name,
p.user_concurrent_program_name description, COUNT(*) COUNT,
DECODE(TRUNC(AVG(actual_completion_date - actual_start_date)), 0, NULL, TRUNC(AVG(actual_completion_date - actual_start_date)) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(AVG(actual_completion_date - actual_start_date),1) * 86400), 'SSSSS'), 'HH24:MI:SS') average,
DECODE(TRUNC(MAX(actual_completion_date - actual_start_date)), 0, NULL, TRUNC(MAX(actual_completion_date - actual_start_date)) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(MAX(actual_completion_date - actual_start_date),1) * 86400), 'SSSSS'), 'HH24:MI:SS') MAX,
DECODE(TRUNC(MIN(actual_completion_date - actual_start_date)), 0, NULL, TRUNC(MIN(actual_completion_date - actual_start_date)) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(MIN(actual_completion_date - actual_start_date),1) * 86400), 'SSSSS'), 'HH24:MI:SS') MIN
FROM applsys.fnd_concurrent_request_class c,
applsys.fnd_application f,
apps.fnd_concurrent_programs_vl p,
applsys.fnd_concurrent_requests r
WHERE r.program_application_id = p.application_id
AND r.concurrent_program_id = p.concurrent_program_id
AND r.phase_code='C' AND r.status_code = 'C'
AND actual_completion_date BETWEEN SYSDATE-2 AND SYSDATE
AND p.application_id = f.application_id
AND r.program_application_id = f.application_id
AND r.request_class_application_id = c.application_id(+)
AND r.concurrent_request_class_id = c.request_class_id(+)
-- AND p.concurrent_program_name LIKE '%XXCUST%'
-- AND p.user_concurrent_program_name like '%SSO%'
GROUP BY c.request_class_name, f.application_short_name,
p.concurrent_program_name, p.user_concurrent_program_name, r.priority
ORDER BY average DESC, APPS ASC;
SELECT /*+ index(r FND_CONCURRENT_REQUESTS_N6) */ f.application_short_name apps, p.concurrent_program_name,
p.user_concurrent_program_name description, COUNT(*) COUNT,
DECODE(TRUNC(AVG(actual_completion_date - actual_start_date)), 0, NULL, TRUNC(AVG(actual_completion_date - actual_start_date)) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(AVG(actual_completion_date - actual_start_date),1) * 86400), 'SSSSS'), 'HH24:MI:SS') average,
DECODE(TRUNC(MAX(actual_completion_date - actual_start_date)), 0, NULL, TRUNC(MAX(actual_completion_date - actual_start_date)) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(MAX(actual_completion_date - actual_start_date),1) * 86400), 'SSSSS'), 'HH24:MI:SS') MAX,
DECODE(TRUNC(MIN(actual_completion_date - actual_start_date)), 0, NULL, TRUNC(MIN(actual_completion_date - actual_start_date)) || ' Days' || ' + ') ||
TO_CHAR(TO_DATE(TRUNC(MOD(MIN(actual_completion_date - actual_start_date),1) * 86400), 'SSSSS'), 'HH24:MI:SS') MIN
FROM applsys.fnd_concurrent_request_class c,
applsys.fnd_application f,
apps.fnd_concurrent_programs_vl p,
applsys.fnd_concurrent_requests r
WHERE r.program_application_id = p.application_id
AND r.concurrent_program_id = p.concurrent_program_id
AND r.phase_code='C' AND r.status_code = 'C'
AND actual_completion_date BETWEEN SYSDATE-2 AND SYSDATE
AND p.application_id = f.application_id
AND r.program_application_id = f.application_id
AND r.request_class_application_id = c.application_id(+)
AND r.concurrent_request_class_id = c.request_class_id(+)
-- AND p.concurrent_program_name LIKE '%XXCUST%'
-- AND p.user_concurrent_program_name like '%SSO%'
GROUP BY c.request_class_name, f.application_short_name,
p.concurrent_program_name, p.user_concurrent_program_name, r.priority
ORDER BY average DESC, APPS ASC;
No comments:
Post a Comment