Oracle查询表空间大小语句

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

猜你喜欢

转载自blog.csdn.net/x_baicai/article/details/81112435