DBAsupport.com Forums - Powered by vBulletin
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 38

Thread: Statpack help

  1. #21
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    he wanted 15 minutes, not 10 and why post the same imformation again

  2. #22
    Join Date
    Oct 2005
    Posts
    26
    thanks guys, that is most helpful, I will run those scripts. one more thing it takes a snapshot every 10/15 mins, how will i get it to stop taking them??, is there something i type to switch it off?/

    Can you also direct me to a good book where it would explain all of this stuff, as i really want to understand what your code is doing exactly.

    Cheers.

  3. #23
    Join Date
    Oct 2005
    Posts
    26
    Davey could you just clarify my understanding my comments are in {}

    DECLARE
    X NUMBER; {this would be the number of snaps that I want to take?}
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    ( job => X {im unsure what this X if for??}
    ,what => 'statspack.snap;'
    ,next_date => sysdate
    ,interval => 'TRUNC(SYSDATE+15/1440,''MI'')' {run every 15 minutes but what is the /1140 and the "MI" mean?}
    ,no_parse => TRUE
    ,force => TRUE
    );
    END;


    running the report manually, i could just do this in a shell script right??

    Thanks for all your help so far, you have been an Oracle of knowledge (excuse the pun).

  4. #24
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    job => X

    dbms_job.submit is a procedure which schedules a job, one of arguments of the procedure is job, X will be the job number and it will be assigned to the job argument.

    in a day we have 1440 minutes right?

    TRUNC(SYSDATE+15/1440,'MI') means get current time down to minutes (if you have 15:09:34 this will get you 15:09:00) and add 15 minutes

  5. #25
    Join Date
    Oct 2005
    Posts
    26
    thanks dude that is much clearer.

  6. #26
    Join Date
    Oct 2005
    Posts
    26
    one more thing i have tried running this in sqlplus but I cant get it to end and go back to the sql> prompt im getting this:

    SQL> DECLARE
    X NUMBER;
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    ( job => X
    ,what => 'statspack.snap;'
    ,next_date => sy 2 3 4 sdate
    ,interval => 'TRUNC(SYSDATE+15/1440,''MI'')'
    ,no_parse => TRUE
    ,force => TRUE
    );
    END; 5 6 7 8 9 10 11 12
    13
    14
    15
    16 \

    what am i doing wrong?

  7. #27
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you need a forward slash at the end, not a backwards one

    and type commit; after as well or it wont save
    Last edited by davey23uk; 11-07-2005 at 07:18 AM.

  8. #28
    Join Date
    Oct 2005
    Posts
    26
    if it doesnt save then it will only be actioned during that session?? and will reset when i log out??

    when do i type commit after the /??

  9. #29
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    ok type this each line here corresponds to a separate line in sqlplus

    Code:
    DECLARE
    X NUMBER;
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    ( job => X
    ,what => 'statspack.snap;'
    ,next_date => sy 2 3 4 sdate
    ,interval => 'TRUNC(SYSDATE+15/1440,''MI'')'
    ,no_parse => TRUE
    ,force => TRUE
    );
    END;
    /
    commit;

  10. #30
    Join Date
    Oct 2005
    Posts
    26
    cheers davey......now im getting the following error messaged

    Current Instance
    ~~~~~~~~~~~~~~~~

    DB Id DB Name Inst Num Instance
    ----------- ------------ -------- ------------
    1208997577 EDISS1 1 EDISS1

    SP2-0310: unable to open file "sprepins.sql"


    any idea what this means...

    sorry to be a pain, and thanks for all your help.

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