-
he wanted 15 minutes, not 10 and why post the same imformation again
-
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.
-
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).
-
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
-
thanks dude that is much clearer.
-
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?
-
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.
-
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 /??
-
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;
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|