SELECT a.tablespace_name "表空间名",
total "表空间大小",
free "表空间剩余大小",
(total - free) "表占用空间大小",
ROUND((total - free) / total * 100, 2) || '%' "已使用空间百分比"
FROM (SELECT tablespace_name, SUM(bytes) / 1024 / 1024 total
FROM dba_data_files
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM(bytes) / 1024 / 1024 free
FROM dba_free_space
GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name
ORDER BY (total - free) DESC;
Oracle查看数据库磁盘空间
最新推荐文章于 2024-08-02 15:49:51 发布