Home » SQL & PL/SQL » SQL & PL/SQL » Scheduling same job with different timing. (Oracle 10g)
Scheduling same job with different timing. [message #585361] Fri, 24 May 2013 04:40 Go to next message
sss111ind
Messages: 496
Registered: April 2012
Location: India
Senior Member

Hi All,

IS it possible TO schedule same JOB WITH different timings.
I need only one SCHEDULER which should run ON saturday AT 6 pm ,AND monday AT 9 pm.

CREATE TABLE dept1 AS SELECT * FROM dept;

CREATE OR REPLACE
procedure update_record is
BEGIN
insert into dept1 values(10,'xxx','xxx');
END;

BEGIN
  DBMS_SCHEDULER.create_job (
    job_name        => 'test_full_job_definition',
    job_type        => 'STORED_PROCEDURE',
    job_action      => 'UPDATE_RECORD',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'FREQ=WEEKLY; BYDAY=MON; BYHOUR=21; BYMINUTE=00; BYSECOND=00;',
    end_date        => NULL,
    enabled         => TRUE,
    comments        => 'Job defined entirely by the CREATE JOB procedure.');
END;


Regards,
Nathan
Re: Scheduling same job with different timing. [message #585362 is a reply to message #585361] Fri, 24 May 2013 05:32 Go to previous messageGo to next message
Littlefoot
Messages: 19882
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Create 2 jobs with different timings, but each of them would call the same procedure.
Re: Scheduling same job with different timing. [message #585363 is a reply to message #585362] Fri, 24 May 2013 05:37 Go to previous messageGo to next message
John Watson
Messages: 4857
Registered: January 2010
Location: Global Village
Senior Member
OR you could normalize it: one job, two schedules.
Re: Scheduling same job with different timing. [message #585364 is a reply to message #585362] Fri, 24 May 2013 06:06 Go to previous messageGo to next message
sss111ind
Messages: 496
Registered: April 2012
Location: India
Senior Member

Thanks LittleFoot,

So one scheduler basically cannot run on two different timings (i.e MON 9pm,TUE 6pm,THU 3pm )but two different days(i.e MON 9pm,TUE 9pm,THU 9pm).

And there must be needed to create two schedulers.

Thanks John,

Can one job contain multiple schedulers in oracle .

[Updated on: Fri, 24 May 2013 06:18]

Report message to a moderator

Re: Scheduling same job with different timing. [message #585389 is a reply to message #585364] Fri, 24 May 2013 10:25 Go to previous messageGo to next message
Michel Cadot
Messages: 59968
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can use the old DBMS_JOB for this.

Regards
Michel
Re: Scheduling same job with different timing. [message #585393 is a reply to message #585389] Fri, 24 May 2013 10:30 Go to previous messageGo to next message
sss111ind
Messages: 496
Registered: April 2012
Location: India
Senior Member

Thanks Michel,

In new features of Oracle ,the offers should be good.Why it misses out this option so that we have to go to the old again.

Is that kind of old is gold. Cool

[Updated on: Fri, 24 May 2013 10:32]

Report message to a moderator

Re: Scheduling same job with different timing. [message #585400 is a reply to message #585393] Fri, 24 May 2013 10:48 Go to previous messageGo to next message
Michel Cadot
Messages: 59968
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Scheduler introduces many and many useful features like executing something else than PL/SQL, chaining, executing during a window, in a specific resource group and so on but, if I don't need these ones, I prefer to use the old way which is easier to manage (and so the extended wiki page I added to the basic one).

Regards
Michel

[Updated on: Fri, 24 May 2013 10:49]

Report message to a moderator

Re: Scheduling same job with different timing. [message #585401 is a reply to message #585400] Fri, 24 May 2013 11:21 Go to previous message
sss111ind
Messages: 496
Registered: April 2012
Location: India
Senior Member

Thanks Michel,

When you are not here for some moments ,we feel loneliness like something is missing.

So be with us always.Cool

Regards,
Nathan
Previous Topic: Find and trace custom view/procedure...
Next Topic: SQL Query Help
Goto Forum:
  


Current Time: Wed Dec 17 20:46:56 CST 2014

Total time taken to generate the page: 0.11909 seconds