oracle如何查看用户的表空间大小?

不是 sum(bytes)/1024/1024 from user_extents; 的那种
2024-12-19 23:54:02
推荐回答(2个)
回答1:

select t.tablespace_name,
round(t.bytes / 1024 / 1024 / 1024, 2) || 'G' "总大小",
round((t.bytes - f.bytes) / 1024 / 1024 / 1024, 2) || 'G' "已使用",
round(100 * (t.bytes - f.bytes) / t.bytes, 2) || '%' "使用率"
from (select tablespace_name, sum(bytes) bytes
from dba_data_files
group by tablespace_name) t,
(select tablespace_name, sum(bytes) bytes
from dba_free_space
group by tablespace_name) f
where f.tablespace_name(+) = t.tablespace_name

回答2:

在OS层面安装个TOAD,一目了然。