Re: Job submitted via dbms_job, when does it first run?

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: 1998/01/16
Message-ID: <34bfd7a4.13544448_at_www.sigov.si>#1/1


[Quoted] On Fri, 16 Jan 1998 12:13:30 +0000, Andy Hardy <Andy_Hardy_at_camk.demon.co.uk> wrote:

>From the available documentation, I thought that a job entered via
>dbms_job would run immediately(ish) and then at the defined 'interval'.
>
>In practice, it appears that the job is only run for the first time when
>you call dbms_job.run.
>
>Is this true, or am I experiencing local difficulties?

After you submit a job using DBMS_JOB package, you must execute a COMMIT if you want to execute it automaticaly. Or alternatively, run DBMS_JOB.RUN, which is the only procedure from this package that contains implicit COMMIT.

Jobs are stored in dictionary, so you must commit, otherwise the system won't see it.

Try the following test: submit the job and select job from DBA_JOBS - you'll see your job there, however the job won't start by itself. Then open another session and select job from DBA_JOBS - your job won't be listed! Then from your first session execute a COMMIT or DBMS_JOB.RUN. Now your job will be seen also from your second session and the job will be executed periodicaly as defined. The same principle applies to all other DBMS_JOB procedures. Keep in mind this especially when you want to alter or remove a job - it won't take effect until you isue an explicit or implicit COMMIT!

>Andy
>NT4, OWS 7.3.3
>--
>Andy Hardy
>Senior IT Systems Engineer
>Cegelec AEG
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Opinions are mine and do not necessarily reflect those of Cegelec AEG

Regards,


Jurij Modic                             Republic of Slovenia
jurij.modic_at_mf.sigov.mail.si		Ministry of Finance
============================================================
The above opinions are mine and do not represent any official standpoints of my employer Received on Fri Jan 16 1998 - 00:00:00 CET

Original text of this message