Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Execution interval is incorrect while using DBMS_JOB.SUBMIT

Re: Execution interval is incorrect while using DBMS_JOB.SUBMIT

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Thu, 19 Aug 2004 14:07:03 +0200
Message-ID: <cg24p2$l3m$1@news2.tilbu1.nb.home.nl>


Maoz Mussel wrote:

> Hi,
>
> I've created a job using the following code:
>
> DECLARE
> X NUMBER;
> BEGIN
> SYS.DBMS_JOB.SUBMIT
> ( job => X
> ,what => 'TEST_ONLY.TEST_JOB;'
> ,next_date => to_date('17/08/2004 17:33:00','dd/mm/yyyy
> hh24:mi:ss')
> ,interval => 'TRUNC(SYSDATE+5/1440,''MI'')'
> ,no_parse => TRUE
> );
> END;
>
> ... so I expected it to run first time at 17:33:00, than again and
> again every 5 minutes. But I found that it actually run not exactly
> every 5 minutes, but with a small delay between each two execution,
> i.e. next one was on 17:38:07, then the next on 17:43:15 and so on, so
> after some time this difference have huge impact on execution time and
> intervals (the job itself is very small and completed after no more
> than a second).
> Any ides why it's happened like this? How can I change it to work as I
> expected it to be?
>
> thanks,
> Maoz

What Jim and Eric said.
And the reason is that Oracle reschedules the job _after_ it's completed, so if your schedule is "5 minutes later", your job will rerun 5 minutes after *completion* of the previous run.

-- 

Regards,
Frank van Bortel
Received on Thu Aug 19 2004 - 07:07:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US