查询表空间大小语句
select a.file_id 文件号,
a.tablespace_name 表名,
b.bytes 表大小,
(b.bytes-sum(nvl(a.bytes,0))) 剩余大小,
sum(nvl(a.bytes,0)) 使用大小,
sum(nvl(a.bytes,0))/b.bytes*100 剩余百分比
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
group by a.tablespace_name,a.file_id,b.bytes
order by a.file_id
select a.file_id 文件号,
a.tablespace_name 表名,
b.bytes 表大小,
(b.bytes-sum(nvl(a.bytes,0))) 剩余大小,
sum(nvl(a.bytes,0)) 使用大小,
sum(nvl(a.bytes,0))/b.bytes*100 剩余百分比
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
group by a.tablespace_name,a.file_id,b.bytes
order by a.file_id
博客给出了查询表空间大小的SQL语句,通过该语句可查询表的文件号、表名、表大小、剩余大小、使用大小以及剩余百分比等信息,语句涉及dba_free_space和dba_data_files表的关联查询。
2095

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



