← Space Management
Oracle · Space Management

How to check partition sizes for a table in Oracle

Show size in GB per partition for a given Oracle table from DBA_SEGMENTS.

Tested on11g12c18c19c21c23ai26ai

Drill into a partitioned table to see how big each partition is. Handy for spotting one runaway partition that dominates the table or for validating partition pruning after archive.

ACCEPT p_table CHAR PROMPT 'Table name: '

SELECT partition_name,
       SUM(bytes) / 1024 / 1024 / 1024 AS gb
FROM   dba_segments
WHERE  segment_name = UPPER('&&p_table')
GROUP BY partition_name
ORDER BY gb DESC;
spacepartitiondba_segments