ITeye博客

查看表空间 使用情况

jontan · 2014-01-10 22:43 · Oracle · 数据库 · Markdown

查看ORACLE数据库表空间 使用情况

    select distinct a.tablespace_name 表空间名称,
                   trunc(((total_space - free_space) / total_space) * 100) || '%' 已使用率,
                   (total_space - free_space) / 1024 / 1024 已使用空间,
                   to_char(free_space / 1024 / 1024, '9999999990.99') || 'M' 剩余空间,
                   total_space / 1024 / 1024 总空间
     from (select tablespace_name, sum(bytes) free_space
             from dba_free_space
            group by tablespace_name) a,
          (select tablespace_name, sum(bytes) total_space
             from dba_data_files
            group by tablespace_name) b
    where a.tablespace_name = b.tablespace_name;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。