首页 > 数据库技术 > 详细

oracle 查看表空间

时间:2020-10-12 17:28:17      阅读:35      评论:0      收藏:0      [点我收藏+]
SELECT TABLESPACE_NAME "表空间",
       To_char(Round(BYTES / 1024, 2), ‘99990.00‘)
       || ‘‘           "实有",
       To_char(Round(FREE / 1024, 2), ‘99990.00‘)
       || ‘G‘          "现有",
       To_char(Round(( BYTES - FREE ) / 1024, 2), ‘99990.00‘)
       || ‘G‘          "使用",
       To_char(Round(10000 * USED / BYTES) / 100, ‘99990.00‘)
       || ‘%‘          "比例"
FROM   (SELECT A.TABLESPACE_NAME                             TABLESPACE_NAME,
               Floor(A.BYTES / ( 1024 * 1024 ))              BYTES,
               Floor(B.FREE / ( 1024 * 1024 ))               FREE,
               Floor(( A.BYTES - B.FREE ) / ( 1024 * 1024 )) USED
        FROM   (SELECT TABLESPACE_NAME TABLESPACE_NAME,
                       Sum(BYTES)      BYTES
                FROM   DBA_DATA_FILES
                GROUP  BY TABLESPACE_NAME) A,
               (SELECT TABLESPACE_NAME TABLESPACE_NAME,
                       Sum(BYTES)      FREE
                FROM   DBA_FREE_SPACE
                GROUP  BY TABLESPACE_NAME) B
        WHERE  A.TABLESPACE_NAME = B.TABLESPACE_NAME)
--WHERE TABLESPACE_NAME LIKE ‘CDR%‘ --这一句用于指定表空间名称
ORDER  BY Floor(10000 * USED / BYTES) DESC;

  技术分享图片

 

oracle 查看表空间

原文:https://www.cnblogs.com/xiaobaidejiucuoben/p/13802304.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!