ORACLE中如何查看表空间

来源:互联网 发布:涉密网络分级保护 编辑:程序博客网 时间:2024/06/09 08:19
select /*+ordered*/c.tablespace_name,round(c.all_bytes / 1024 / 1024 / 1024, 2) 现有空间,round(c.max_bytes / 1024 / 1024 / 1024, 2) 最大空间, round(c.all_bytes / 1024 / 1024 / 1024, 2) - round(b.free_bytes / 1024 / 1024 / 1024, 2) 使用空间, round(b.free_bytes / 1024 / 1024 / 1024, 2) 空闲空间from (select /*+no_merge*/ t.tablespace_name, sum(t.bytes) free_bytesfrom dba_free_space tgroup by tablespace_name) b,(select /*+no_merge*/tablespace_name, sum(t.bytes) all_bytes,sum(case when t.maxbytes >0 then maxbytes else bytes end) max_bytesfrom dba_data_files tgroup by t.tablespace_name) cwhere c.tablespace_name = b.tablespace_name(+)order by c.tablespace_name

0 0
原创粉丝点击