1.通过查询dba_segments

Select owner,segment_name,sum(bytes)/1024/1024 as MB from dba_segments group by owner,segment_name;

查询:是分配给一个表的物理空间数量,而不管空间是否被使用。

2.num_rows * avg_row_len

select table_name, round(num_rows * avg_row_len /1024/1024, 8) as total_len, num_rows  from all_tables where table_name = '表名' order by table_name;

查到的是实际占用的空间大小,已经使用的

04-14 02:47