Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove OLD STATS

Status
Not open for further replies.

Sambo8

Programmer
May 10, 2005
78
NZ
Hi There,

I think there is a script to remove old stats from the STATS tablespace, e.g older than 1 month. But cannot find it anywhere. Does anyone know of such a script.

Many thanks,

Sam
 
Sam,

If you want to get rid of statistics for a specific Oracle user/schema, you can issue this command from SQL*Plus:
Code:
SQL> exec dbms_utility.ANALYZE_SCHEMA('<schema name>','DELETE')
Let us know if this resolves your need.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
It would probably depend upon how you have gathered your stats

DBMS_UTILITY As per the documentation:
Use this procedure to collect nonoptimizer statistics. For optimizer statistics, use the DBMS_STATS.GATHER_SCHEMA_STATS procedure.

I would suggest possibly using
DBMS_STATS.DELETE_SCHEMA_STATS.

Check out to get documentation for your appropriate version.
 
Good update, Jim! Thanks.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top