时间:2021-07-01 10:21:17 帮助过:3人阅读
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表实际大小
标签:oracle