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: DBMS Job not running (time change)

Re: DBMS Job not running (time change)

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 08 Feb 2006 15:04:18 -0800
Message-ID: <1139439851.341090@jetspin.drizzle.com>


David.E.M...._at_gmail.com wrote:
> You say option D but how do I do this? The parameters in the dbms job
> submit function are of type date. Is there a way to trick it to only
> look at the seconds and not the hours and minutes?
>
> Anyway, I implemented option A, here it is:
>
> -- Check the get_run_summary job in the job queue for a bad
> -- DBMS_JOB.NEXT_DATE which
> -- could be the result of a time change. get_run_summary is scheduled
> -- to run every 60 seconds so a bad date would be outside this range.
> -- If the date is bad fix it.
>
> -- Retrieve the summarization job from the Oracle job queue schedule.
> SELECT * INTO l_job_rec
> FROM all_jobs WHERE what = 'get_run_summary;';
>
> -- If this_date is NOT NULL, it indicates the job is currently running.
> -- If the job is running assume the date is good.
> IF l_job_rec.this_date IS NULL THEN
>
> -- Get the next.date and check to see if it is > ( now + one minute )
> -- If the next.date is > ( now + 1 minute ) then set it to now + 1 min
> -- Ignore the case where the next_date is < sysdate because this job
> -- is already backlogged with a high priority.
>
> IF l_job_rec.next_date > (sysdate+1/1440) THEN
> -- Reschedule the summarization to run 1 minute from now.
> DBMS_JOB.NEXT_DATE
> (l_job_rec.job, sysdate+1/1440);
> COMMIT;
> END IF;
> END IF;
>

1/8640th of a day.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Wed Feb 08 2006 - 17:04:18 CST

Original text of this message

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