所有表空间使用率
select a.tablespace_name "Tablespace Name",
b.total/1024/1024/1024 "Total Space(GB)",
a.FREE_SPACE/1024/1024/1024 "Free Space(GB)",
(b.total - a.FREE_SPACE)/1024/1024/1024 "Space in Use(GB)",
ROUND((b.total - a.FREE_SPACE) / total, 4) * 100 "Use_Total Ratio(%)"
FROM dba_temp_free_space a,
(select tablespace_name,sum(bytes) total from dba_temp_files
group by tablespace_name) b
where a.tablespace_name(+)=b.TABLESPACE_NAME
union all
SELECT a.tablespace_name "Tablespace Name",
total/1024/1024/1024 "Total Space(GB)",
free/1024/1024/1024 "Free Space(GB)",
(total - free)/1024/1024/1024 "Space in Use(GB)",
ROUND((total - free) / total, 4) * 100 "Use_Total Ratio(%)"
FROM (SELECT tablespace_name, SUM(bytes) free
FROM DBA_FREE_SPACE
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM(bytes) total
FROM DBA_DATA_FILES
GROUP BY tablespace_name) b
WHERE a.tablespace_name(+) = b.tablespace_name;