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');

This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply