SELECT V1.TABLESPACE_NAME "表空间名",
ROUND(NVL(V1.SPACE,0)) "表空间大小(M)",
ROUND(NVL(V1.SPACE,0)-NVL(V2.SPACE,0)) "已经使用空间(M)",
ROUND(NVL(V2.SPACE,0)) "可用空间(M)",
ROUND((NVL(V1.SPACE,0)-NVL(V2.SPACE,0))/NVL(V1.SPACE,0)*100,2) "已用百分比"
FROM (SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024 SPACE FROM DBA_DATA_FILES GROUP BY TABLESPACE_NAME) V1,
(SELECT TABLESPACE_NAME, SUM(BYTES)/1024/1024 SPACE FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) V2
WHERE V1.TABLESPACE_NAME = V2.TABLESPACE_NAME(+)
ORDER BY V1.TABLESPACE_NAME
posted on 2006-06-10 10:18
kebo 阅读(129)
评论(0) 编辑 收藏