Get Job report from OEM sysman user regarding backup in Oracle
This following SQL query retrieves details about jobs and their execution statuses from an Oracle Enterprise Manager (OEM) database.
SELECT j.job_name,
t.target_name,
DECODE(status,
1, 'Scheduled',
2, 'Running',
3, 'Error',
4, 'Failed',
5, 'Succeeded',
6, 'Suspended By User',
7, 'Suspended: Agent Unreacheable',
8, 'Stopped',
9, 'Suspended on Lock',
10, 'Suspended on Event',
11, 'Stop Pending',
13, 'Suspend Pending',
14, 'Inactive',
15, 'Queued',
16, 'Failed Retried',
17, 'Suspended',
18, 'Skipped', status) status,
e.scheduled_time
FROM sysman.MGMT_JOB j, sysman.MGMT_JOB_EXEC_SUMMARY e,
sysman.MGMT_JOB_TARGET jt, sysman.MGMT_TARGETS t,
sysman.MGMT_JOB_SCHEDULE s
WHERE j.schedule_id = s.schedule_id AND
J.IS_LIBRARY = 0 and j.system_job = 0 AND
j.nested=0 AND j.job_id=e.job_id AND
j.is_corrective_action=0 AND e.job_id=jt.job_id (+) AND e.execution_id=jt.execution_id (+) AND jt.target_guid=t.target_guid (+)
Tables Involved:
MGMT_JOB (j)– Stores job-related details.MGMT_JOB_EXEC_SUMMARY (e)– Stores execution summaries of jobs.MGMT_JOB_TARGET (jt)– Maps jobs to targets.MGMT_TARGETS (t)– Stores information about different managed targets.MGMT_JOB_SCHEDULE (s)– Stores scheduling details for jobs.