undo segment的建立、online以及extent的分配原則

tolywang發表於2010-10-19


When the undo tablespace is created, a number of undo segments are created. These are named using the _SYSSMU$ algorithm. Because of the new name, some commands (alter system dump undo header) require that the undo segment name be enclosed in double quotes.

The number of undo segments created and brought online is a function of the SESSIONS parameter. The algorithm is roughly 1 undo segment for each 5 sessions. All undo segments are placed online when the sessions parameter is set to 46 or greater. The lower limit was not tested, as the minimum value for the sessions parameter in the test database was 16, which was derived from the minimum number of processes (10) for the database. These are sized according to the autoallocate algorithm for locally managed tablespaces. The basic algorithm is that the first 16 extents are 64k in size. The subsequent allocation method is the next 63 extents of 1m, the next 120 extents of 8m and all additional extents at 64m.

The first block of the first undo extent is reserved as the header and not indicated in the data dictionary views. As with Oracle 8, the second block of the undo segment is not used initially and may or may not be allocated at a later time. This is one of those anomalies that has no consistent pattern and is therefore hard to explain.

 

當undo表空間被建立時,很多的undo segments被建立,這些segments以_SYSSMU$
規則來命名。 因為新的名稱,一些命令比如alert system dump undo header 需要在
undo segment的名稱上加註雙引號。

Undo segment建立和線上數量是由引數SESSIONS決定的,粗略演算法為每5個session對應
一個undo segment, 當sessions引數設定為46或更大時所有的undo segments都處於
online狀態。 下限沒有被測試過,因為在測試資料庫中sessions引數最小值是16,
這個值來自於資料庫中引數processes的最小值10,這些大小是參考本地管理表空間
(LMT)自動分配演算法而來。 基本演算法是: 前16個extents大小為64K, 隨後63個extents
是每個1M, 然後120個extents是每個8M, 再後面的extents大小都是64M不變。

第一個undo extent的第一個block保留作為頭部,沒有在資料字典中標示出來,與Oracle
8 一樣,undo segment的第二個block最初沒有被使用,後面一段時間也許被分配,也許
不會,這是異常現象之一,沒有統一的模式,因此很難解釋。 

 

查詢undo segment :  

select segment_name,segment_id,status from dba_rollback_segs order by status

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

相關文章