Syntax dbms_job.interval ???
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Syntax dbms_job.interval ???

  1. #1
    Join Date
    Sep 2002
    Posts
    411
    Could someone help me with the syntac below, Bascially, I want this package to be run at 4:00AM every Sat morning.

    var j number
    begin
    dbms_job.submit
    (
    :j,
    'SYS.DBMS_UTILITY.ANALYZE_SCHEMA(''LIS'',''COMPUTE'');',
    'NEXT_DAY(trunc(sysdate),''SATURDAY'')+1/6'
    );
    COMMIT;
    end;
    /

    when I look into INTERVAL and it said "NULL", how can I set the interval since I want this job to be run every Sat at 4:00AM???


    Thanks
    Last edited by mike2000; 10-22-2002 at 04:29 PM.

  2. #2
    Join Date
    Nov 2000
    Location
    Israel
    Posts
    268
    Hi
    Issue:

    -- start --
    var j number
    begin
    dbms_job.submit(:j,'SYS.DBMS_UTILITY.ANALYZE_SCHEMA(''LIS'',''COMPUTE'');');
    dbms_job.interval(:j,'NEXT_DAY(trunc(sysdate),''SATURDAY'')+1/6');
    commit;
    end;
    /
    -- end --

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    If you want to submit your job right now (immediately) and then every Saturday at 4:00AM, you would use:
    Code:
    var j number
    begin
    dbms_job.submit
    (
    :j,
    'SYS.DBMS_UTILITY.ANALYZE_SCHEMA(''LIS'',''COMPUTE'');',
    SYSDATE,
    'NEXT_DAY(trunc(sysdate),''SATURDAY'')+1/6'
    );
    COMMIT;
    end;
    If you want to submit it next Saturday and then repeatedly every Saturday, you would use:
    Code:
    var j number
    begin
    dbms_job.submit
    (
    :j,
    'SYS.DBMS_UTILITY.ANALYZE_SCHEMA(''LIS'',''COMPUTE'');',
    NEXT_DAY(trunc(sysdate),''SATURDAY'')+1/6,
    'NEXT_DAY(trunc(sysdate),''SATURDAY'')+1/6'
    );
    COMMIT;
    end;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

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