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

Thread: schedule a db job to run every Monday, Wednesday and Sunday

  1. #1
    Join Date
    Mar 2001
    Posts
    287

    schedule a db job to run every Monday, Wednesday and Sunday

    Hi,

    What's the best way to schedule a db job to run every Monday, Wednesday and Sunday?

    For example: the following only run once every Sunday.


    VARIABLE jobno number;
    BEGIN
    DBMS_JOB.SUBMIT(
    :jobno,
    'My_precedure;',
    trunc(SYSDATE)+1+3/24, --execute 1st time at 3am tommorrow
    'NEXT_DAY(TRUNC(SYSDATE), ''SUNDAY'')+ 3/24'); --execute at 3am every Sunday
    COMMIT;
    END;
    /

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Something similar to thje following ought to work ...
    Code:
    LEAST(
       NEXT_DAY(TRUNC(SYSDATE),''SUNDAY'')),
       NEXT_DAY(TRUNC(SYSDATE),''WEDNESDAY'')),
       NEXT_DAY(TRUNC(SYSDATE),''MONDAY''))
       )+ 3/24')
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Mar 2001
    Posts
    287
    Thank you!

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