select a.tablespace_name "表空间名",
Total / (1024 * 1024 * 1024) "表空间大小(G)",
Free / (1024 * 1024 * 1024) "表空间剩余大小(G)",
(Total - Free) / (1024 * 1024 * 1024) "表空间使用大小(G)",
Round((Total - free) / Total, 4) * 100 "使用率(%)"
from (select tablespace_name,SUM(bytes) Free
from dba_free_space
group by tablespace_name) a,
(select tablespace_name,SUM(bytes) total
from dba_data_files
group by tablespace_name) b
where a.tablespace_name=b.tablespace_name
注:该语句执行时可能会报错,提示找不到dba_free_space和dba_data_files。用system用户登录oracle执行该语句即可解决该报错。
阅读(1680) | 评论(0) | 转发(0) |