Home » RDBMS Server » Server Administration » How identify Schedule Object triggered in job with 2 associated schedules (Oracle 11g)
How identify Schedule Object triggered in job with 2 associated schedules [message #663645] Mon, 12 June 2017 17:16 Go to next message
athensromania
Messages: 46
Registered: July 2007
Location: Valencia,Spain
Member
Hi all,
I've been running some test, to run a job using two different schedule objects.
In example, job will be exexuted at 10 on Mondays using using schedule 1 and at 12:25 on Tuesdays using schedule 2.

Is it posible to know which schedule has triggered the job execution? I've looking data dictionary views and I can't find anything useful.

Thanks and Regards.
Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663646 is a reply to message #663645] Mon, 12 June 2017 21:01 Go to previous messageGo to next message
BlackSwan
Messages: 25716
Registered: January 2009
Location: SoCal
Senior Member
athensromania wrote on Mon, 12 June 2017 15:16
Hi all,
I've been running some test, to run a job using two different schedule objects.
In example, job will be exexuted at 10 on Mondays using using schedule 1 and at 12:25 on Tuesdays using schedule 2.

Is it posible to know which schedule has triggered the job execution? I've looking data dictionary views and I can't find anything useful.

Thanks and Regards.
obtain SYSDATE if before noon, then schedule 1 otherwise schedule 2.
Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663649 is a reply to message #663646] Tue, 13 June 2017 00:01 Go to previous messageGo to next message
athensromania
Messages: 46
Registered: July 2007
Location: Valencia,Spain
Member
Agree,
but if se have 10 a.m and 11a.m? Both are only examples, what I need to do is identify the specific schedule that triggered the job, no matter the time in the repeat interval is defined.

Thanks.
Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663650 is a reply to message #663649] Tue, 13 June 2017 00:36 Go to previous messageGo to next message
Michel Cadot
Messages: 65199
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Explain why it is important or necessary you know which schedule executed the job if both schedules execute the same thing which is independent of the schedule; maybe you are approaching your issue in a wrong way.

Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663652 is a reply to message #663645] Tue, 13 June 2017 02:26 Go to previous messageGo to next message
athensromania
Messages: 46
Registered: July 2007
Location: Valencia,Spain
Member
Hi,
in example for this scenario:

- If it executed for schedule 1 --> Action 1, not execute action 2
- If it executed for schedule 2 --> Action 2, not execute action 1

Instead of using a configuration table to check if action 1 or action 2 have been executed at the same day.

Just re-thinking a dirty solution could a lookup table clonning repeat interval (Day,Time) with action to be executed in case if it match.

Thanks and Regards.
Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663653 is a reply to message #663652] Tue, 13 June 2017 03:04 Go to previous messageGo to next message
Michel Cadot
Messages: 65199
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
to check if action 1 or action 2 have been executed at the same day.
Given that your schedule are
Quote:
job will be exexuted at 10 on Mondays using using schedule 1 and at 12:25 on Tuesdays using schedule 2.

I wonder how one can be executed on the same day than the other one. Do you mean week?

If I understand your specification it can be read as:
- On scheduling "N", if previous action is "not N" [on the same day] then do nothing otherwise execute action "N".

As far as I know a job can be associated to only one schedule, so you should have 2 jobs and %_scheduler_jobs views have a LAST_START_DATE column that gives you when the job was lastly executed.

Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663654 is a reply to message #663652] Tue, 13 June 2017 05:57 Go to previous messageGo to next message
John Watson
Messages: 7148
Registered: January 2010
Location: Global Village
Senior Member
athensromania wrote on Tue, 13 June 2017 08:26
Hi,
in example for this scenario:

- If it executed for schedule 1 --> Action 1, not execute action 2
- If it executed for schedule 2 --> Action 2, not execute action 1

Instead of using a configuration table to check if action 1 or action 2 have been executed at the same day.

Just re-thinking a dirty solution could a lookup table clonning repeat interval (Day,Time) with action to be executed in case if it match.

Thanks and Regards.
I don't understand this. One schedule can be attached to many jobs, not the other way around.
Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663744 is a reply to message #663654] Thu, 15 June 2017 13:48 Go to previous messageGo to next message
Caffeine+
Messages: 14
Registered: February 2017
Junior Member
I would say that you could combine multiple windows and conditional chain steps to control both jobs but I'd have to see a test case containing your job and schedule DDL.
Re: How identify Schedule Object triggered in job with 2 associated schedules [message #663745 is a reply to message #663744] Thu, 15 June 2017 13:52 Go to previous message
Michel Cadot
Messages: 65199
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

As we have and fail to get.

Previous Topic: upgrading 11g to 12c on new windows server
Next Topic: creating a database link between 12c and 8i
Goto Forum:
  


Current Time: Mon Nov 20 22:39:23 CST 2017

Total time taken to generate the page: 0.01436 seconds