select /*+ordered*/
c.tablespace_name,
round(c.all_bytes / 1024 / 1024 / 1024, 2) 现有空间,
round(c.max_bytes / 1024 / 1024 / 1024, 2) 最大空间,
round(c.all_bytes / 1024 / 1024 / 1024, 2) -
round(b.free_bytes / 1024 / 1024 / 1024, 2) 使用空间,
round(b.free_bytes / 1024 / 1024 / 1024, 2) 空闲空间
from (select /*+no_merge*/ t.tablespace_name, sum(t.bytes) free_bytes
from dba_free_space t
group by tablespace_name) b,
(select /*+no_merge*/tablespace_name,
sum(t.bytes) all_bytes,
sum(case when t.maxbytes >0 then maxbytes else bytes end) max_bytes
from dba_data_files t
group by t.tablespace_name) c
where c.tablespace_name = b.tablespace_name(+)
order by c.tablespace_name
ORACLE中如何查看表空间
最新推荐文章于 2024-07-02 19:46:20 发布