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: sceduling a procedure

Re: sceduling a procedure

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sat, 16 May 1998 14:42:15 GMT
Message-ID: <355da5bd.3543365@192.86.155.100>


A copy of this was sent to Giuseppe De Donno <dedonno_at_ariadne.it> (if that email address didn't require changing) On Fri, 15 May 1998 10:19:43 +0200, you wrote:

>Hi,
>how can I to schedule a procedure pl/sql?
>
>Thank .
>Giuseppe
>

Use dbms_jobs.

Make sure you set the init.ora parameters:

job_queue_interval= 60
job_queue_processes = 1

the first one checks how often the queue is checked (every 60 seconds with the above) and how many queues there are defined (how many submitted blocks can execute concurrently -- 1 in the above).

Then, you can use dbms_job.submit to submit and schedule the job. For example, to get something to run everyday at midnight you would:

declare

    l_job number;
begin

    dbms_job.submit( job => l_job,

                     what => 'YOUR_CODE_HERE;', 
                     next_date => trunc(sysdate)+1,
                     interval => 'trunc(sysdate)+1' );
    commit;
end;
/

That will schedule your job to initially run at midnight today and then every subsequent midnight.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Sat May 16 1998 - 09:42:15 CDT

Original text of this message

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