码迷,mamicode.com
首页 > 数据库 > 详细

Oracle11g表空间使用监控

时间:2018-11-28 17:33:28      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:rac   name   from   pac   group   sele   tables   data   dba   

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;

col TABLESPACE_NAME for a10;
col SUM_SPACE for a10;
col FREE_SPACE for a10;
col USED_SPACE for a10;

Oracle11g表空间使用监控

标签:rac   name   from   pac   group   sele   tables   data   dba   

原文地址:https://www.cnblogs.com/xibuhaohao/p/10032701.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!