RE: Finding OEM future scheduled jobs

From: Courtney Llamas <courtney.llamas_at_oracle.com>
Date: Fri, 25 Jan 2019 11:29:30 -0800 (PST)
Message-ID: <4f335c07-f1e3-47c8-8562-07169c41a7e6_at_default>





Not my query ;) But from one of the EM experts internally…

 

A bit 'tricky'....

Here's the query:

SELECT j.job_id, j.job_name, j.job_owner, j.job_type, e.start_time FROM   mgmt_job_execution e, mgmt_job j WHERE  e.start_time     > mgmt_global.sysdate_utc

  AND  e.command_type   < 3
  AND  e.parent_step_id = -1
  AND  e.step_type      = 7
  AND  e.job_id         = j.job_id
ORDER BY e.start_time DESC
;

One 'but' here:
- This output WILL include a set of jobs that the 'system' has scheduled on behalf of the users (and the admin tasks those users did)
  Those jobs are not going to be a problem: If the OMS is down at the time the job was supposed to start, they'll just wake up when the OMS's come back online, and kick off
- If the EM users of the site have been 'good', and NOBODY is using SYSMAN to do stuff, you COULD filter out those jobs like this:
    AND  j.job_owner != 'SYSMAN'

  That would give you JUST the user-submitted jobs in the system that are 'waiting for their start time'....

 

 

-- 

- Courtney
http://www.oracle.com/ Courtney Llamas | Architect Phone: HYPERLINK "tel:+17137342102"+17137342102 | Mobile: HYPERLINK "tel:+18324720596"+18324720596 https://myoracle.webex.com/meet/courtney.llamas Oracle Security & Systems Management http://www.oracle.com/commitment Oracle is committed to developing practices and products that help protect the environment   From: Dave Herring <gdherri_at_gmail.com> Sent: Friday, January 25, 2019 11:08 AM To: ORACLE-L <oracle-l_at_freelists.org> Subject: Finding OEM future scheduled jobs   Folks,   We have downtime scheduled for 2 of our 12c OEMs (12.1.0.4 OMS) Saturday night starting at 11pm.  I know some OEM job executions will occur within the window and also know that once the OMS is back up it'll immediately schedule single executions that were missed, but what I currently don't have is a way to programmatically determine ALL executions that will be missed within the downtime.   Within the Console in Job Activity you can see the next scheduled execution for all jobs, but if a job is scheduled every Tues and Sat and it's currently Monday, for example, you don't see that the Sat execution will happen because, obviously, it's not scheduled yet.  Same with "get_jobs" option of "emcli".  What I'd like to do is run a cursor that determines for a given time window what all job executions should happen.  I know that I can use FREQUENCY_CODE and INTERVAL off of MGMT_JOB_SCHEDULE to calculate future executions, but I was wondering if anyone has already written this logic and would be willing to share.  Or maybe I missed something and this kind of functionality already exists.   After writing the above it sounds like I'm being lazy but, well, I am.  I'm mainly hoping to not re-invent something if I don't have to.  I did a few searches but as always, I didn't find a lot written about OEM jobs.   Thx. -- Dave -- http://www.freelists.org/webpage/oracle-l
Received on Fri Jan 25 2019 - 20:29:30 CET

Original text of this message