Re: submit jobs

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 25 Nov 1999 14:48:10 -0500
Message-ID: <dh4r3skhgv9tk9ib479lbjvib819goptsb_at_4ax.com>


A copy of this was sent to "Andreas Schwaiger" <andreas.schwaiger_at_strasser.at> (if that email address didn't require changing) On Thu, 25 Nov 1999 16:21:59 +0100, you wrote:

>Hi Carlo
>
>I use this procedure:
>
>start_job() IS
> jobno number;
>BEGIN
> DBMS_JOB.SUBMIT(jobno,proc_name,sysdate);
> commit;
>END;
>
>but if I call this procedure, nothing happens
>

have you setup the required init.ora parameters:

job_queue_processes
job_queue_interval

???

for example, on my system i have:

SVRMGR> show parameter job

NAME                                TYPE    VALUE
----------------------------------- ------- ------------------------------
job_queue_interval                  integer 60                            
job_queue_processes                 integer 3 

every minute the job queue will be inspected to see if something is ready to run. there will be upto 3 concurrently executing jobs maximum.

>Andi
>
>
><carlogol_at_my-deja.com> schrieb in im Newsbeitrag:
>8131ch$8eq$1_at_nnrp1.deja.com...
>> In article <3833f228.0_at_news.kabsi.at>,
>> "Andreas Schwaiger" <andreas.schwaiger_at_strasser.at> wrote:
>> > hi all,
>> >
>> > i want to run a procedure as a job in the background
>> >
>> > i tried this:
>> > DBMS_JOB.SUBMIT(jobno,proc_name,sysdate+1/(25*60));
>> > nothing happens
>> >
>> > then I tried this:
>> > DBMS_JOB.SUBMIT(jobno,proc_name);
>> > DBMS_JOB.RUN(jobno,true);
>> >
>> > Now the procedure proc_name is running, but I have to wait until its
>> > finished.
>> > Who can help me?
>> >
>> > Andi Schwaiger
>> > Austria
>> >
>> >
>> Hi Andi.
>> Well, I tried this and it seems to work fine!
>> Write this piece of anonymous PL/SQL code (you may use SQLPLUS)
>>
>> VARIABLE jobno number;
>> BEGIN
>> DBMS_JOB.SUBMIT (:jobno,
>> 'BR2.INSERT_DEPT;',
>> SYSDATE, 'SYSDATE +30/1440');
>> COMMIT;
>> END;
>> /
>>
>> What does it mean? It's easy: you submit a job called BR2.INSERT_DEPT
>> (it is a stored procedure created in a schema called BR2), and have
>> Oracle run it now (SYSDATE) and every 30 minutes (SYSDATE + 30/1440).
>>
>> Then, to see if everything works fine, just execute this simple query:
>>
>> SELECT * FROM USER_JOBS;
>>
>> Good luck!!!
>> Carlo
>>
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Thu Nov 25 1999 - 20:48:10 CET

Original text of this message