DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: dbms_jobs questions

  1. #1
    Join Date
    Mar 2006
    Posts
    176

    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.

  2. #2
    Join Date
    Jan 2001
    Location
    St. Louis. MO
    Posts
    151
    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;
    /

  3. #3
    Join Date
    Mar 2006
    Posts
    176
    Is it possible for us to run just from 6:00AM to 6:00PM only?

    thanks

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    yes, might be easire to write a fucntion which returns the next time though

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    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.
    Jeff Hunter

  6. #6
    Join Date
    Mar 2006
    Posts
    176
    thanks all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width