SELECT F.TABLESPACE_NAME,
(T.TOTAL_SPACE - F.FREE_SPACE) "已使用 (MB)",
F.FREE_SPACE "剩余 (MB)",
T.TOTAL_SPACE "当前总量 (MB)",
(ROUND((F.FREE_SPACE / T.TOTAL_SPACE) * 100)) || '% ' "空闲率",
(ROUND(((T.TOTAL_SPACE - F.FREE_SPACE) / T.TOTAL_SPACE) * 100)) || '% ' "使用率"
FROM (SELECT TABLESPACE_NAME,
ROUND(SUM(BLOCKS * (SELECT VALUE / 1024
FROM V$PARAMETER
WHERE NAME = 'db_block_size') / 1024)) FREE_SPACE
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F,
(SELECT TABLESPACE_NAME, ROUND(SUM(BYTES / 1048576)) TOTAL_SPACE
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME) T
WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME
oracle表空间使用情况查看
最新推荐文章于 2022-06-13 00:03:12 发布