美文网首页
查看Oracle数据库表空间剩余

查看Oracle数据库表空间剩余

作者: 安易学车 | 来源:发表于2019-10-29 17:11 被阅读0次

    1)查看表空间物理文件的名称及大小 

    SELECT tablespace_name, 

    file_id, 

    file_name, 

    round(bytes/(1024*1024*1024), 2)||' GB' total_space 

    FROM dba_data_files 

    ORDER BY tablespace_name;

    2)查看表空间的使用情况 

    SELECT round(SUM(bytes)/(1024*1024*1024),2)||' GB' AS free_space, tablespace_name 

    FROM dba_free_space 

    GROUP BY tablespace_name; 

    3)查看表空间的使用情况 

    SELECT a.tablespace_name, 

    round(a.bytes/(1024*1024*1024),2)||' GB' total, 

    round(b.bytes/(1024*1024*1024),2)||' GB' used, 

    round(c.bytes/(1024*1024*1024),2)||' GB' free, 

    round((b.bytes * 100) / a.bytes)||'%' "% USED ", 

    round((c.bytes * 100) / a.bytes)||'%' "% FREE " 

    FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c 

    WHERE a.tablespace_name = b.tablespace_name 

    AND a.tablespace_name = c.tablespace_name; 

    相关文章

      网友评论

          本文标题:查看Oracle数据库表空间剩余

          本文链接:https://www.haomeiwen.com/subject/qxugvctx.html