• 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;

    col TABLESPACE_NAME for a10;
    col SUM_SPACE for a10;
    col FREE_SPACE for a10;
    col USED_SPACE for a10;
  • 相关阅读:
    ionic框架
    第3课
    第7课
    第6课
    第5课
    第4课
    第3课
    第2课
    第2课
    第1课
  • 原文地址:https://www.cnblogs.com/xibuhaohao/p/10032701.html
Copyright © 2020-2023  润新知