Database Tuning (MOSC)

MOSC Banner

Using DBMS_STATS - Gather Table/Index Stats

edited May 19, 2009 3:31AM in Database Tuning (MOSC) 4 commentsAnswered
DBMS_GATHER_STATS
Before reinventing the wheel would like to check if anyone has already done listed below.

I would like to get translation of Analyze statement below using DBMS_STAT

select 'ANALYZE TABLE ' || owner || '.' || table_name || ' COMPUTE STATISTICS ; ' from dba_tables where owner = 'MY_OWN' and TABLE_NAME not in ('MY_REQ','MY_RES','MY_RES_AMT');

The above statment has tables/indexes which are partition and not partition (a mix).

Also below specific to partition tables:

select 'ANALYZE TABLE ' || owner || '.' || table_name || ' partition (P03) COMPUTE STATISTICS; ' from dba_tables where owner = 'MY_OWN' and TABLE_NAME in ('MY_REQ','MY_RES','MY_RES_AMT');

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center