Row Migration and Row Chaining(行遷移和行連結)

china_yebin發表於2009-11-23

Row Migration and Row Chaining(行遷移和行連結)

Row Migration(行遷移)
當記錄被更新時,原資料塊無法容納新的資料時,新的更新資料將遷移到別的資料塊中,而原資料塊的記錄保留並指向被遷移的資料塊。

Row Chaining(行連結)
(1)當行記錄大於資料塊的大小時,一個資料塊將無法容納,這時候,將加入新的資料塊直到能容納全部資料,資料塊之間就有連結關係。
(2)當表的定義超過255個欄位時,將產生塊內部的連結。

v$sysstat and v$sesstat
The idea is to check the statistic that gives the number of fetches that read more than one row piece (including intra-block chained rows), namely, [table fetch continued row].
this statistic could also be compared with [table scan rows gotten] and [table fetch by rowid].

select avg_row_len from dba_tables

ANALYZE TABLE LIST CHAINED ROWS
select * from chained_rows;

Row Migration解決方法:
1. 防止產生Row Migration:
增大pctfree
2. 清除Row Migration:
 ALTER TABLE MOVE
 或
 將行遷移的資料匯入臨時表,然後再匯入

Row Chaining解決方法:
1. 對於塊內部的連結,減少表的欄位,或將很少使用的欄位放到後面;
2. 對於塊外部的連結,重新設計表,或增大資料塊的塊大小(Block size 2K, 4K, 8K, 16K, 32K)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13605188/viewspace-620328/,如需轉載,請註明出處,否則將追究法律責任。

相關文章