首页 > 数据库技术 > 详细

查询DB表实际大小

时间:2017-07-25 00:41:00      阅读:384      评论:0      收藏:0      [点我收藏+]

1.查询DB表实际大小(保证clob/blob/nclob lob大字段)

 select round(sum(bytes/1024/1024/1024),2) ||‘G‘ from dba_segments where owner=‘用户‘ 
 and segment_name =‘表‘ OR segment_name IN (select SEGMENT_NAME from dba_LOBS where TABLE_NAME=‘表‘ and owner=‘用户‘);

如果不是dba用户可以用user_segments & user_lobs 且不需要owner.


2. 查询表里LOB大字段

   select round(sum(b.BYTES/1024/1024),2) ||‘M‘ from dba_lobs a, dba_segments b  
 where a.segment_name = b.segment_name  and a.owner = ‘用户‘ and a.table_name = ‘表‘ ;


3.查询表大小不带LOB大字段

select round(sum(bytes/1024/1024/1024),2) ||‘G‘ from user_segments where segment_name =‘表‘;


查询DB表实际大小

原文:http://ql0722.blog.51cto.com/4353164/1950556

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!