Oracle EBS-SQL (SYS-14):查询表空间1.sql

SELECT d.status "状态",
           d.tablespace_name "名称",
           d.contents "类型",
           TO_CHAR(NVL(a.bytes / 1024 / 1024, 0),'99G999G990D900') "大小 (M)",
           TO_CHAR(NVL(a.bytes - NVL(f.bytes, 0),0)/1024/1024, '99G999G990D900') "已使用 (M)",
           TO_CHAR(NVL((a.bytes - NVL(f.bytes, 0)) / a.bytes * 100, 0), '990D00') "占用率 %"
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 D.TABLESPACE_NAME;

原文地址:https://www.cnblogs.com/st-sun/p/3777805.html