-
ask for a help with statspack's snapshot deletion
Hi DBAs,
I need to schedule a cronjob to delete all snapshots which are older than
some specified days, for example, 30 days.
i modified the oracle's sppurge.sql and got my version sppurge.sql, which
deletes the snapshots which are older the {$1} days.
My shell script's logic is like this:
enter the sqlplus:
do a query:like : select count(*) from stats$snapshot where
snap_time < sysdate - $1;
if the count(*) >0 then call my modified sppurge.sql to delete all the old
snapshots.
the problem is---
how can I return the count(*) from sqlplus back to shell script,
if it is greater than 0, then my shell script continues to call my modified sppurge.sql.
Thanks,
Lily
-
Milind
-----------------------------
www.milinds.com
My Private World on the Web !
-
This is another--exactly what you want to do..
Hi,
Sorry for multiple posts, Please review this link, i just got it from my bookmarks ..
http://asktom.oracle.com/pls/ask/f?p...:6722856149512
This works best ..
Milind
-----------------------------
www.milinds.com
My Private World on the Web !
-
Thank you very much, Milind.
This is what I exactly want. Of course, the solution is much better than
my original one.
Thank you again.
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
|