Gather stats for subpartition of the tables in Oracle

Gather the statistics for subpartition of the table in Oracle

Check the statistics for subpartition of the table in Oracle

-- Check the sub partition table statistics
Select * from USER_TAB_SUBPARTITIONS;

--Check the sub partition col statistics.
Select * from USER_SUBPART_COL_STATISTICS;

-- Check the Sub partition histograms
Select * from USER_SUBPART_HISTOGRAMS;

--Check the sub partition indexes
Select * from USER_SUBPART_INDEXES

Gather the subpartition stats including indexes:

exec DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'HR', TABNAME => 'SALES',
 GRANULARITY => 'SUBPARTITION' ,CASCADE => TRUE);

Gather the subpartition statistics for the table without indexes:

exec DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'HR', TABNAME => 'SALES',
 CASCADE => FALSE ,GRANULARITY => 'SUBPARTITION',METHOD_OPT => 'FOR COLUMNS');

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.