您的位置:首页 > 其它

收集统计信息

2015-01-11 10:03 190 查看
有两种含义的表大小。一种是分配给一个表的物理空间数量,而不管空间是否被使用。可以这样查询获得字节数:select segment_name, bytes 
from user_segments 
where segment_type = 'TABLE'; 
或者
   Select Segment_Name,Sum(bytes)/1024/1024 From User_Extents Group By Segment_Name另一种表实际使用的空间。这样查询:analyze table emp compute statistics; 
select num_rows * avg_row_len 
from user_tables 
where table_name = 'EMP';
第1行是用dbms_stats.gather_table_stats收集的begin   dbms_stats.gather_table_stats('SYS','T1');end;第2行是用analyze table T2 compute statistics;收集的analyze table T2 compute statistics;第3行没有收集统计信息最后查询select  * from user_tables where table_name in('T1','T2','T3')查询结果

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: