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

Thread: ask for a help with statspack's snapshot deletion

  1. #1
    Join Date
    Mar 2004
    Location
    IA USA
    Posts
    257

    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

  2. #2
    Join Date
    Jun 2005
    Location
    Florida
    Posts
    41
    You may want to refer to this link:
    http://www.idevelopment.info/data/Or...tom_pkg_9i.sql

    Milind
    Milind
    -----------------------------
    www.milinds.com
    My Private World on the Web !

  3. #3
    Join Date
    Jun 2005
    Location
    Florida
    Posts
    41

    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 !

  4. #4
    Join Date
    Mar 2004
    Location
    IA USA
    Posts
    257
    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
  •  


Click Here to Expand Forum to Full Width