analyze table tab_name compute statistics;select blocks as 占用blocks,empty_blocks as 空的blocks from user_all_tables where table_name = upper(&&tab_name) ;粗略估算的话,blocks * 20 应该是将可能占用的blocks
调试欢乐多
因为只是估算,而且已经有了大概1w的数据的blocks,偷懒一点拉
where owner = 'owner_name'
and tablespace_name = 'tablespace_name'
and segment_name = 'table_name'; 当然了你的有dba的权限
'N',nvl(data_precision,38),
'D',7,data_length) ) max_row_length
from dba_tab_columns
where owner='USER_NAME'
group by table_name取得最大行长(单位:字节),再乘以1w,除以1024,再除以8k得到blocks数
select avg(vsize(col1)+vsize(col2)) avglen from table1
select 10000/((8192-90)*0.9/avglen) blocks from dual
发现这个blocks有点不太准确
这个是否应该是这样:
select 10000*avglen/1024/8192 blocks from dual不理解((8192-90)*0.9)这个是什么意思
你要精确计算的话,就要考虑这个在内
另外如果因为pctfree设置不当,而导致出现行链接,那更加难以精确计算