oracle tablespace Total free space
SELECT
SUBSTR(a.tablespace_name,1,30) TABLESPACE,
ROUND(SUM(a.total1) /1024/1024,1) "TotalMB",
ROUND(SUM(a.total1) /1024/1024,1)-ROUND(SUM(a.sum1)/1024/1024,1) "UsedMB",
ROUND(SUM(a.sum1) /1024/1024,1) "FreeMB",
ROUND((ROUND(SUM(a.total1)/1024/1024,1)-ROUND(SUM(a.sum1)/1024/1024,1))/ROUND(SUM(a.total1)/1024/1024,1)*100,2) "Used%"
FROM
(
SELECT tablespace_name,
0 total1,
SUM(bytes) sum1,
MAX(bytes) MAXB,
COUNT(bytes) cnt
FROM dba_free_space
GROUP BY tablespace_name
UNION
SELECT tablespace_name,
SUM(bytes) total1,
0,
0,
0
FROM dba_data_files
GROUP BY tablespace_name
) a
GROUP BY a.tablespace_name
ORDER BY TABLESPACE;