-
dbms_jobs questions
below is what I have for my dbms_jobs:
var j number
begin
dbms_job.submit(:j,'GATHER_STATS;',SYSDATE,'NEXT_DAY(trunc(sysdate),''SATURDAY'')+1/12');
COMMIT;
end;
based on what I have, it will execute right away and schedule to run EVERY sATURDAY AT 2:00AM. the question I have is how can I schedule the job to be run every SAT BUT DO NOT RUN RIGHT AWAY.
-
Try using this
DECLARE j number;
BEGIN
DBMS_JOB.SUBMIT(j,
'GATHER_STAT;',
TO_DATE('Saturday, July 1, 2006 2 00 00 AM', 'DAY, MONTH DD, YYYY HH:MI:SS AM'),
'trunc(sysdate+7) + 2/24');
COMMIT;
END;
/
-
Is it possible for us to run just from 6:00AM to 6:00PM only?
thanks
-
yes, might be easire to write a fucntion which returns the next time though
-
You might be looking for the new job scheduling if you're running 10g. I highly recommend http://www.rampant-books.com/book_2005_1_scheduling.htm if you're interested.
-