SELECT upper(f.tablespace_name) tablespace_name,
d.Tot_grootte_Mb total_Mb,
d.Tot_grootte_Mb - f.total_bytes used_Mb,
to_char(round((d.Tot_grootte_Mb - f.total_bytes) / d.Tot_grootte_Mb * 100,
2),
'990.99') || '%' use_rage,
f.total_bytes free_Mb,
f.max_bytes max_block
FROM (SELECT tablespace_name,
round(SUM(bytes) / (1024 * 1024), 2) total_bytes,
round(MAX(bytes) / (1024 * 1024), 2) max_bytes
FROM sys.dba_free_space
GROUP BY tablespace_name) f,
(SELECT dd.tablespace_name,
round(SUM(dd.bytes) / (1024 * 1024), 2) Tot_grootte_Mb
FROM sys.dba_data_files dd
GROUP BY dd.tablespace_name) d
WHERE d.tablespace_name = f.tablespace_name
ORDER BY 4;
d.Tot_grootte_Mb total_Mb,
d.Tot_grootte_Mb - f.total_bytes used_Mb,
to_char(round((d.Tot_grootte_Mb - f.total_bytes) / d.Tot_grootte_Mb * 100,
2),
'990.99') || '%' use_rage,
f.total_bytes free_Mb,
f.max_bytes max_block
FROM (SELECT tablespace_name,
round(SUM(bytes) / (1024 * 1024), 2) total_bytes,
round(MAX(bytes) / (1024 * 1024), 2) max_bytes
FROM sys.dba_free_space
GROUP BY tablespace_name) f,
(SELECT dd.tablespace_name,
round(SUM(dd.bytes) / (1024 * 1024), 2) Tot_grootte_Mb
FROM sys.dba_data_files dd
GROUP BY dd.tablespace_name) d
WHERE d.tablespace_name = f.tablespace_name
ORDER BY 4;