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

Thread: dbms_job

  1. #1
    Join Date
    Apr 2001
    Location
    London
    Posts
    725
    Hi friends,

    I have never used dbms_job before and need some advice on how to add a new job to run every 2 weeks.

    I want to use dbms_job to analayse a schema at 10pm every 2 weeks. The sql is as follows :

    EXECUTE SYS.DBMS_UTILITY.ANALYZE_SCHEMA('USERNAME','COMPUTE');

    Can someone please supply syntax.

    Thanks.


    Once you have eliminated all of the impossible,
    whatever remains however improbable,
    must be true.

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    SQL*Plus:
    Code:
    var j number
    begin
      dbms_job.submit
      (
        :j,
        'SYS.DBMS_UTILITY.ANALYZE_SCHEMA(''USERNAME'',''COMPUTE'');',
        trunc(sysdate)+22/24,
        'trunc(sysdate)+22/24+14'
      );
      COMMIT;
    end;
    /
    print j
    Ales
    The whole difference between a little boy and an adult man is the price of toys

  3. #3
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,591
    Sureshy i think dbms_stats is ok to use 8.0 up. Utility was for 73.
    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

  4. #4
    Join Date
    Apr 2001
    Location
    London
    Posts
    725
    Thanks foe your help ales.
    Tarry, I will use dbms stats.

    Thanks again
    Once you have eliminated all of the impossible,
    whatever remains however improbable,
    must be true.

  5. #5
    Join Date
    Apr 2001
    Location
    London
    Posts
    725
    Hello Again,

    can I set the next_date and interval parameters to specify a time using to_char ?
    Once you have eliminated all of the impossible,
    whatever remains however improbable,
    must be true.

  6. #6
    Join Date
    Apr 2001
    Location
    London
    Posts
    725
    Please excuse my ignorance.

    I have just read dbms_job documentation properly and realise that the code ales supplied does exactly what I want.

    Once you have eliminated all of the impossible,
    whatever remains however improbable,
    must be true.

  7. #7
    Join Date
    Aug 2002
    Location
    Bangalore, India
    Posts
    405
    Originally posted by Sureshy
    Please excuse my ignorance.

    I have just read dbms_job documentation properly and realise that the code ales supplied does exactly what I want.

    Yep it does have detailed documentation. BTB did you notice the difference between 'sysdate' and 'SYSDATE' used as in arguement for interval?????
    -nagarjuna

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