Check the current and allocated disk space a specific Oracle table consumes.
Knowing table size prevents storage overruns, guides partitioning decisions, and lets you forecast growth for capacity planning.
Use USER_SEGMENTS for objects in your schema, DBA_SEGMENTS for all objects, or ALL_SEGMENTS for objects you can access. These views return allocated bytes, not free space.
Query USER_SEGMENTS filtering by SEGMENT_NAME. Convert BYTES to MB or GB with simple math.
SELECT ROUND(bytes / 1024 / 1024) AS size_mb
FROM user_segments
WHERE segment_name = 'ORDERS';
Sort USER_SEGMENTS by BYTES to see heavy hitters.
SELECT segment_name,
ROUND(bytes / 1024 / 1024) AS size_mb
FROM user_segments
WHERE segment_type = 'TABLE'
ORDER BY bytes DESC
FETCH FIRST 5 ROWS ONLY;
Sum BYTES across SEGMENT_TYPEs that belong to the same table. Use DBA_SEGMENTS when tables span schemas.
SELECT segment_name,
ROUND(SUM(bytes) / 1024 / 1024) AS total_mb
FROM dba_segments
WHERE owner = 'SHOP'
AND segment_name = 'PRODUCTS'
GROUP BY segment_name;
Schedule the above query in DBMS_SCHEDULER, store results in a metrics table, and graph them in a dashboard of your choice.
Analyze after purges to reclaim space; use SHRINK SPACE for ASSM tablespaces. Always account for indexes and LOBs when sizing.
No. Deleted rows leave empty blocks. Use ALTER TABLE ... SHRINK SPACE or rebuild tablespaces to reclaim disk.
Yes. USER_SEGMENTS exposes only your schema objects and requires no special privilege.
Divide BYTES by POWER(1024,3) (1,073,741,824). ROUND for readability.