查看ORACLE表空间的情况

来源:互联网 发布:美工欣赏 温斯顿 编辑:程序博客网 时间:2024/05/19 06:18

 select  b.tablespace_name 表空间名M,
        b.file_name   数据文件,
        b.bytes/1024/1024 总共大小M,
        (B.BYTES-SUM(NVL(A.BYTES,0)))/1024/1024 以使用空间M,
         sum(nvl(a.bytes,0))/1024/1024 剩余空间M,
        sum(nvl(a.bytes,0))/(b.bytes)*100 以使用百分比,    
(100-(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 b.tablespace_name,b.file_name,b.file_id,b.bytes
order by b.tablespace_name

原创粉丝点击