SELECT / * Ordered USE_NL (A b) * / b.tablespace_name,
Trunc (SUM (B.BYTES / 1024/1024), 2) "Free (m)",
Trunc (SUM (A.BYTES / 1024/1024) -SUM (B.BYTES / 1024/1024), 2) "Used (M)",
Trunc (SUM (A.BYTES / 1024/1024), 2) "All (m)"
From DBA_DATA_FILES A
Join DBA_FREE_SPACE B on (a.file_id = b.file_id)
Group by b.tablespace_name;