Oracle Database - Determine Table Size
by
Jeremy Canfield |
Updated: December 12 2023
| Oracle Database articles
The following query can be used to list the size of the tables in the FOO tablespace.
SELECT
DS.TABLESPACE_NAME, SEGMENT_NAME, ROUND(SUM(DS.BYTES) / (1024))
AS
KB
FROM
DBA_SEGMENTS DS
WHERE
SEGMENT_NAME IN (SELECT TABLE_NAME FROM ALL_TABLES WHERE TABLESPACE_NAME = 'FOO')
GROUP BY
DS.TABLESPACE_NAME, SEGMENT_NAME
ORDER BY
KB DESC;
Something like this should be returned.
SEGMENT_NAME KB
-----------------------
TABLE001 15498432
TABLE002 2075840
TABLE003 909504
TABLE004 793728
TABLE005 270528
Did you find this article helpful?
If so, consider buying me a coffee over at