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
以上
啦啦啦!!!