您的位置:首页 > 数据库 > Oracle

ORACLE9i_性能调优基础十(Oracle Blocks Efficiently)

2015-04-25 13:47 369 查看

Avoiding Dynamic Allocation

<p>要执行收集信息</p><pre class="sql" name="code">exec dbms_stats.gather_table_stats('MARK','T');
analyze table t coumpute statistics;


select owner,table_name,blocks,empty_blocks from dba_tables where empty_blocks/(blocks+empty_blocks)< .1


<span style="font-size:18px;">To avoid dynamic allocation</span>


alter table hr.employees allocate extent;


Advantage and disadvantage of Large Extents

Advantage: 减少分配次数 ,性能稍微有点提高,一次I/O 就能读整个 extent map

aisadvantage:小空间可能不被利用

Recovring Space

1.Below the high-water mark:

a.把表导出 ,drop or truncate 原表,把数据导回原表

b.Alter Table employees move

2.Above the high-water mark: alter table employees Deallocate Unused

Minimize block visits by

用大尺寸的数据块,装数据紧凑些 , 防止 row migration

小块: 优点:减少BLOCK 竞争 ,对小记录比较好 ,对 随机访问比较好

缺点:额外开销多(每个块都有控制信息) ,一个块容纳的记录条数少, 索引的块就多

大块:小块相反的方面

一般 OLAP使用大块 , OLTP使用小块

Detecting M&C

1.
analyze table oe.orders compute STATISTICS;
select num_row,chain_cnt from dba_tables where table_name='ORdERS';

2.通过Statspack报告 也可以查看

找到那些记录发生M&C



Index Reorganization

1.易变表上索引的问题

2.只有索引所在块的 全部无效 这个块 才能被回收






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