Oracle11g表空间使用监控
Posted xibuhaohao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle11g表空间使用监控相关的知识,希望对你有一定的参考价值。
SELECT * FROM (select *
from
(select a.TABLESPACE_NAME TABLESPACE_NAME,(a.total || ‘M‘) AS "SUM_SPACE",(b.free_space||‘M‘) AS "FREE_SPACE",((a.total-b.free_space)||‘M‘) AS "USED_SPACE",ROUND((a.total-b.free_space)/a.total*100,2) as "USED_RATE"
from
(select TABLESPACE_NAME,sum(bytes/1024/1024) total from dba_data_files group by TABLESPACE_NAME) a,
(select TABLESPACE_NAME,sum(bytes/1024/1024) free_space from dba_free_space group by tablespace_name) b
where a.TABLESPACE_NAME=b.TABLESPACE_NAME order by "USED_RATE" desc)
UNION all
select *
from
(select c.TABLESPACE_NAME TABLESPACE_NAME,(c.total || ‘M‘) AS "SUM_SPACE",(d.free_space||‘M‘) AS "FREE_SPACE",((c.total-d.free_space)||‘M‘) AS "USED_SPACE",ROUND((c.total-d.free_space)/c.total*100,2) as "USED_RATE"
from
(select TABLESPACE_NAME,sum(bytes/1024/1024) total from dba_temp_files group by TABLESPACE_NAME) c,
(select TABLESPACE_NAME,sum(FREE_SPACE/1024/1024) free_space from dba_temp_free_space group by tablespace_name)d
where c.TABLESPACE_NAME=d.TABLESPACE_NAME order by "USED_RATE" desc)
) X order by "USED_RATE" desc;
from
(select a.TABLESPACE_NAME TABLESPACE_NAME,(a.total || ‘M‘) AS "SUM_SPACE",(b.free_space||‘M‘) AS "FREE_SPACE",((a.total-b.free_space)||‘M‘) AS "USED_SPACE",ROUND((a.total-b.free_space)/a.total*100,2) as "USED_RATE"
from
(select TABLESPACE_NAME,sum(bytes/1024/1024) total from dba_data_files group by TABLESPACE_NAME) a,
(select TABLESPACE_NAME,sum(bytes/1024/1024) free_space from dba_free_space group by tablespace_name) b
where a.TABLESPACE_NAME=b.TABLESPACE_NAME order by "USED_RATE" desc)
UNION all
select *
from
(select c.TABLESPACE_NAME TABLESPACE_NAME,(c.total || ‘M‘) AS "SUM_SPACE",(d.free_space||‘M‘) AS "FREE_SPACE",((c.total-d.free_space)||‘M‘) AS "USED_SPACE",ROUND((c.total-d.free_space)/c.total*100,2) as "USED_RATE"
from
(select TABLESPACE_NAME,sum(bytes/1024/1024) total from dba_temp_files group by TABLESPACE_NAME) c,
(select TABLESPACE_NAME,sum(FREE_SPACE/1024/1024) free_space from dba_temp_free_space group by tablespace_name)d
where c.TABLESPACE_NAME=d.TABLESPACE_NAME order by "USED_RATE" desc)
) X order by "USED_RATE" desc;
col TABLESPACE_NAME for a10;
col SUM_SPACE for a10;
col FREE_SPACE for a10;
col USED_SPACE for a10;
以上是关于Oracle11g表空间使用监控的主要内容,如果未能解决你的问题,请参考以下文章