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: Job starting problem

Re: Job starting problem

From: Wojtek Wawrzyniak <wojciech.wawrzyniak_at_quantum.pl>
Date: Tue, 22 Feb 2005 11:34:01 +0100
Message-ID: <cvf22v$akv$1@nemesis.news.tpi.pl>

Uzytkownik <fitzjarrell_at_cox.net> napisal w wiadomosci news:1108656022.329211.16840_at_o13g2000cwo.googlegroups.com...
>
> Wojtek Wawrzyniak wrote:
> > > What does the view USER_JOBS tell you about this job? Is it
> broken?
> > > What are the values for NEXT_DATE and NEXT_SEC? Have you tried
> > > increasing job_queue_processes?
> > >
> > >
> > > David Fitzjarrell
> > >
> > I notice that just after restart database all existing jobs are
> executed,
> > but on the NEXT_DATE again nothing.. (after that BROKEN=N, the
> FAILURES=0,
> > NEXT_DATE / NEXT_SEC and LAST_DATE / LAST_SEC are set correctly,
> > but does not change anymore)..
> > Normally when I create new job (of course with commit) it has:
> > BROKEN=N, the FAILURES=NULL, NEXT_DATE / NEXT_SEC points to the same
> date as
> > when job was created, for examle yesterday created job has
> '2005-02-16
> > 10:27:56' / '10:27:56' and this values does not change, fields
> LAST_DATE /
> > LAST_SEC are empty..
> > The job_queue_processes param was set to 3,4 and 5 -does nothing..
> >
> > Wojtek Wawrzyniak
>
> Apparently you are not explicitly setting your interval for your jobs.
> You need to do so, to allow them to reschedule themselves. An example
> is shown below:
>
> declare
> --
> -- Job number
> --
> -- Returned by DBMS_JOB.SUBMIT()
> --
> jobid number;
> start_dt varchar2(20);
> begin
> --
> -- Obtain the next days date
> --
> select to_char(sysdate + 1, 'YYYY-MM-DD:')
> into start_dt
> from dual;
> --
> -- Add the time, which will be just past
> -- midnight
> --
> start_dt := start_dt||'00:01:00';
> --
> -- Submit the job to the queue
> --
> -- Supply the fraction of a day to shift
> -- SYSDATE to tomorrow, just past midnight
> --
> dbms_job.submit(jobid, 'vm_notify;',
> to_date(start_dt, 'YYYY-MM-DD:HH24:MI:SS'),
> 'sysdate + 1');
> --
> -- Commit the job
> --
>
> commit;
>
> --
> -- Report the job number returned by DBMS_JOB.SUBMIT()
> --
> dbms_output.put_line('Job number: '||jobid);
>
> end;
> /
>
> Note the submission of the interval, the last string in the parameter
> list.
>
>
> David Fitzjarrell
>

I did like you wrote, I use example as bellow:

begin
dbms_job.isubmit(99,'BEGIN insert into ww values(1,sysdate); commit; END;',sysdate + 0.5/1440,'sysdate + 0.5/1440'); commit;
end;

Where ww is my test table: create table ww (cc number, dd date); Finally we decide to recreate this instance (last import of data wasn't successful). I hope it will help.
Thanks for help,
Wojtek Received on Tue Feb 22 2005 - 04:34:01 CST

Original text of this message

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