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
本文提供了一种SQL查询方法,用于获取数据库中各表空间的总大小、已用空间、剩余空间及使用率等详细信息。
1万+

被折叠的 条评论
为什么被折叠?



