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: oracle job

Re: oracle job

From: Anurag Varma <avdbi_at_hotmail.com>
Date: Thu, 07 Aug 2003 03:33:54 GMT
Message-ID: <BMjYa.27986$tt1.13970@news02.roc.ny>

"Anton Buijs" <remove_aammbuijs_at_xs4all.nl> wrote in message news:3f31425f$0$49100$e4fe514c_at_news.xs4all.nl...
>
> Solaris77 <giofai_at_inwind.it> schreef in berichtnieuws
> bgr054$r953n$1_at_ID-203060.news.uni-berlin.de...
> | Hi,
> | i have 1 oracle job starting every 2 hours.
> | My question is:
> |
> | if the oracle job starts 12:00 and it's running at 14:00 what's happening?
> |
> | The new job start or wait the finish of the first job??
> |
> | PS Sorry for my english!!
> |
> | Thank
> | Giovanni
> |
>
> Oracle calculates the next job execution time when the job finishes. It uses
> the function you specified as the "interval" parameter. Example:
> - suppose interval is "sysdate +2/24" (means: every 2 hours)
> - job started to run at 12:00 (while running you can see that in dba_jobs
> columns this_date and this_sec or the view dba_jobs_running)
> - job finishes at 15:05 (see view dba_jobs columns last_date and last_sec)
> - Oracle calculates a new scheduled time (dba_jobs columns next_date and
> next_sec) using interval, resulting in 17:05 in this example.
>
>
>

Anton,

I do not think that you are correct.

A job which runs for 3 hours, if scheduled to run every 2 hours .... will run every (approx.) 3 hours.

So
- job starts at 12:00 and finishes at 15:05 - the next job will start pretty soon after 15:05

.. thus if a job takes longer than its interval ... it will behave as a continuous job.

And since job puts a "job lock", only one of them will be running at one time.

Try out a simple example using dbms_lock.sleep. Pretty easy to test this.

.. so the answer to OP's question is: Only one job will be running at one time. However, in his case .. as soon as the job finishes, another will start. So "new job will wait for the one currently running to finish".

Anurag Received on Wed Aug 06 2003 - 22:33:54 CDT

Original text of this message

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