ITPub博客

首页 > 数据库 > Oracle > 查看db tablespace 使用率

查看db tablespace 使用率

原创 Oracle 作者:mengbing1990 时间:2016-10-24 08:20:24 0 删除 编辑

select d.status, d.tablespace_name,

TO_CHAR(NVL(a.bytes / 1024 /1024, 0),'99G999G990') "size(M)",

TO_CHAR(NVL(a.bytes - NVL(f.bytes, 0),0)/1024/1024, '99G999G990D00') used,

TO_CHAR(NVL((a.bytes - NVL(f.bytes, 0)) / a.bytes * 100, 0), '990D00')||'%' pct

FROM sys.dba_tablespaces d,

(select tablespace_name, sum(bytes) bytes from dba_data_files group by

tablespace_name) a,

(select tablespace_name, sum(bytes) bytes from dba_free_space group by

tablespace_name) f

WHERE d.tablespace_name = a.tablespace_name(+)

AND d.tablespace_name = f.tablespace_name(+)

order by tablespace_name ;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29551564/viewspace-2126974/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 取每周的周一sql
请登录后发表评论 登录
全部评论
v❤550166897

注册时间:2014-03-19

  • 博文量
    88
  • 访问量
    195240