0
tbs_used_percent
emcs
67次下载
422次浏览
2019-07-24
4.5

脚本内容

set linesize 200
set pages 2000
col TABLESPACENAME for a30
SELECT  SUBSTR(a.TABLESPACE_NAME,1,30) TablespaceName,
    round(SUM(a.bytes/1024/1024/1024),2)  AS "Totle_size(G)",
    round(SUM(NVL(b.free_space1/1024/1024/1024,0)),2) AS "Free_space(G)",
    round(SUM(a.bytes/1024/1024/1024),2)-round(SUM(NVL(b.free_space1/1024/1024/1024,0)),2)  AS "Used_space(G)",
    ROUND((SUM(a.bytes/1024/1024/1024)-SUM(NVL(b.free_space1/1024/1024/1024,0))) *100/SUM(a.bytes/1024/1024/1024),2) AS "Used_percent%",
    round(SUM((case when a.MAXBYTES = 0 then a.bytes else a.MAXBYTES end)/1024/1024/1024),2)                                                                     AS "Max_size(G)",
    ROUND((SUM(a.bytes/1024/1024/1024)-SUM(NVL(b.free_space1/1024/1024/1024,0)))*100/SUM((case when a.MAXBYTES = 0 then a.bytes else a.MAXBYTES end)/1024/1024/1024),2) AS "Max_percent%"
  FROM dba_data_files a,
    (SELECT SUM(NVL(bytes,0)) free_space1,
      file_id
    FROM dba_free_space
  GROUP BY file_id
   ) b 
WHERE a.file_id = b.file_id(+)
 GROUP BY a.TABLESPACE_NAME
ORDER BY "Used_percent%" desc;

评论

热门资源
热门脚本
近期活动
全部
暂无活动,敬请期待...
相关课程
全部
暂无课程,敬请期待...