SELECT tablespace_name "TABLESPACE",
initial_extent "INITIAL_EXT",
next_extent "NEXT_EXT",
min_extents "MIN_EXT",
max_extents "MAX_EXT",
pct_increase
FROM sys.dba_tablespaces;
TABLESPACE INITIAL_EXT NEXT_EXT MIN_EXT MAX_EXT PCT_INCREASE
---------- ----------- -------- ------- ------- ------------
SYSTEM 10240000 10240000 1 99 50
USERS 10240000 10240000 1 99 50
SELECT file_name, bytes, tablespace_name
FROM sys.dba_data_files;
FILE_NAME BYTES TABLESPACE_NAME
------------ ---------- --------------------
filename1 10240000 SYSTEM
filename2 10240000 USERS
filename3 20480000 USERS
SELECT tablespace_name, file_id,
COUNT(*) "PIECES",
MAX(blocks) "MAXIMUM",
MIN(blocks) "MINIMUM",
AVG(blocks) "AVERAGE",
SUM(blocks) "TOTAL"
FROM sys.dba_free_space
WHERE tablespace_name = 'SYSTEM'
GROUP BY tablespace_name, file_id;
TABLESPACE FILE_ID PIECES MAXIMUM MINIMUM AVERAGE SUM
---------- ------- ------ ------- ------- ------- -------
SYSTEM 1 2 2928 115 1521.5 3043
SUM shows the amount of free space in each tablespace, PIECES shows the amount of fragmentation in the datafiles of the tablespace, and MAXIMUM shows the largest contiguous area of space. This query is useful when you are going to create a new object or you know that a segment is about to extend, and you want to make sure that there is enough space in the containing tablespace.