oracle table statistics 1

oracle table statistics

SELECT ST.TABLE_NAME, ST.PARTITION_NAME, HIGH_VALUE, ST.NUM_ROWS, 
	   ST.BLOCKS, ST.LAST_ANALYZED
FROM DBA_TAB_STATISTICS ST
LEFT JOIN DBA_TAB_PARTITIONS PAR
ON PAR.TABLE_NAME = ST.TABLE_NAME AND PAR.PARTITION_NAME = ST.PARTITION_NAME
WHERE ST.OWNER = 'MY_OWNER'
  AND ST.TABLE_NAME = 'MY_TABLE'
ORDER BY PARTITION_NAME;

Here is what the above code is Doing:
1. It’s selecting the table name, partition name, high value, number of rows, blocks, and last analyzed date.
2. It’s joining the table partitions table to the table statistics table on the table name and partition name.
3. It’s filtering the results to only show the table name and owner that you’re interested in.
4. It’s ordering the results by partition name.

Similar Posts