SELECT dbf.tablespace_name,
dbf.totalspace "总量(M)",
dbf.totalblocks AS 总块数,
dfs.freespace "剩余总量(M)",
dfs.freeblocks "剩余块数",
round((dfs.freespace / dbf.totalspace) * 100, 2) || '%' "空闲比例"
FROM (SELECT t.tablespace_name,
SUM(t.bytes) / 1024 / 1024 totalspace,
SUM(t.blocks) totalblocks
FROM dba_data_files t
GROUP BY t.tablespace_name) dbf,
(SELECT tt.tablespace_name,
SUM(tt.bytes) / 1024 / 1024 freespace,
SUM(tt.blocks) freeblocks
FROM dba_free_space tt
GROUP BY tt.tablespace_name) dfs
WHERE TRIM(dbf.tablespace_name) = TRIM(dfs.tablespace_name)
查看Oracle表空间
最新推荐文章于 2024-08-19 17:05:31 发布