--表空间使用情况
SELECT a.tablespace_name "表空间名",
round(total/1024/1024,2) "表空间大小",
round(free/1024/1024,2) "表空间剩余大小",
round(( total - free )/1024/1024,2) "表空间使用大小",
Round(( total - free ) / total, 4) * 100 "使用率%"
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;
--临时表空间使用情况
select tablespace_name "表空间名",
round(user_bytes/1024/1024) "已用大小",
round(bytes/1024/1024) "表空间大小",
round(maxbytes/1024/1024) "可扩展最大",
round(user_bytes/bytes, 2)*100 "使用率%"
from dba_temp_files;