Well use the fact that "STATSPACK uses foreign-key referential integrity constraints with the ON CASCADE DELETE option".
http://www.dba-oracle.com/tips_oracl...ge_utility.htm
Extend this to 12 months and test it. Good luck.Code:SQL> select SNAP_ID,to_char(SNAP_TIME,'dd-mon-yyyy hh24:mi') from stats$snapshot; SNAP_ID TO_CHAR(SNAP_TIME ---------- ----------------- 1 07-mar-2007 11:35 2 07-mar-2007 11:36 3 07-mar-2007 11:36 3 rows selected. SQL> delete from stats$snapshot where SNAP_TIME < sysdate - (1/(24*60)) ; 3 rows deleted.




Reply With Quote