|
-
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
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
|