首页 > 数据库 > Oracle > 查看db tablespace 使用率
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/ ,如需转载,请注明出处,否则将追究法律责任。