加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

查询表空间使用情况

发布时间:2020-12-12 14:39:12 所属栏目:百科 来源:网络整理
导读:##查询语句 select upper(f.tablespace_name) as tablespace_name,d.tot_grootte_mb as "Size(MB)",f.total_bytes as "Free size(MB)",d.tot_grootte_mb - f.total_bytes as "Already in use(MB)",round((d.tot_grootte_mb - f.total_bytes) / d.tot_grootte

##查询语句

select upper(f.tablespace_name) as tablespace_name,d.tot_grootte_mb as "Size(MB)",f.total_bytes as "Free size(MB)",d.tot_grootte_mb - f.total_bytes as "Already in use(MB)",round((d.tot_grootte_mb - f.total_bytes) / d.tot_grootte_mb * 100,2) as "Percent used(%)",round(d.maxbytes / 1024) as "Maximum value(GB)",round((d.tot_grootte_mb - f.total_bytes) / d.maxbytes * 100,2) as "Percent of maximum value%"
  from (select tablespace_name,round(sum(bytes) / (1024 * 1024),2) total_bytes
          from sys.dba_free_space
         group by tablespace_name) f,(select dd.tablespace_name,round(sum(dd.bytes) / (1024 * 1024),2) tot_grootte_mb,round(sum(case
                           when dd.autoextensible = 'YES' then
                            dd.maxbytes
                           else
                            dd.bytes
                         end) / (1024 * 1024),2) maxbytes
          from sys.dba_data_files dd
         group by dd.tablespace_name) d
 where d.tablespace_name = f.tablespace_name
 order by tablespace_name;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读