begin dbms_stats.unlock_schema_stats('SCHEMA'); dbms_stats.delete_schema_stats('SCHEMA'); dbms_stats.gather_schema_stats(ownname => 'SCHEMA', estimate_percent => 40.0, granularity => 'GLOBAL', block_sample => TRUE, cascade => TRUE, degree => DBMS_STATS.DEFAULT_DEGREE, method_opt => 'for all columns size 1'); dbms_stats.lock_schema_stats('SCHEMA'); end; select t.owner, t.table_name, t.last_analyzed from dba_all_tables t where lower(t.owner) = 'your_schema';
this blog is intended to be a place to store code snippets, examples, notes... in order to have them handy and to quickly find during the everyday work
Search This Blog
Friday, 18 November 2011
gathering statistics on Oracle DB
Here comes a script to gather statistics on Oracle DB
Etichette:
Oracle DBA
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment