Gather database statics

There are several ways to gather statics in Oracle. It all depends on how wide you want to do your collection.

To gather statics for the whole database:

SQL> EXEC DBMS_STATS.gather_database_stats;

To gather statics for a single schema:
SQL> EXEC DBMS_STATS.gather_schema_stats('SCOTT');

To gather statics for a single table:SQ

L> EXEC DBMS_STATS.gather_table_stats('SCOTT', 'EMPLOYEES');

To gather statics for a single index:
SQL> EXEC DBMS_STATS.gather_index_stats('SCOTT', 'EMPLOYEES_PK');

For more information see:
http://www.oracle-base.com/articles/8i/CostBasedOptimizerAndDatabaseStatistics.php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s