Oracle查询表空间使用情况的一个sql

select  t1.tablespace_name,curr_b/1024/1024/1024,max_b/1024/1024/1024,case when max_b<>0 then curr_b/max_b end from
(select tablespace_name,sum(case when autoextensible='NO' then bytes else maxbytes end) max_b from dba_data_files group by tablespace_name) t1
join
(select tablespace_name,sum(bytes) curr_b from dba_segments group by tablespace_name) t2 on t1.tablespace_name=t2.tablespace_name

 

以上

posted @ 2019-11-15 12:47  张不正  阅读(313)  评论(0编辑  收藏  举报
返回顶部