oracle 塊基本引數介紹(英文) (zt)
INITRANS, MAXTRANS, FREELISTS and FREELIST GROUPS, PCTFREE and PCTUSED
Mike Ault
July 29th, 2004
The Automatic Segment Space Management features (bitmap freelists) is a wonderful features for most shops.? However, using ASSM in some high-DML environments can result in poorer performance, and you will need to manually set the values for INITRANS and FREELISTS (as well as FREELIST GROUPS and PCTFREE and PCTUSED).
Let's examine some brief guidelines for these settings.
First let's discuss INITRANS:
The INITTRANS setting controls Initial Transaction Slots (ITLs). A transaction slot is required for any session that needs to modify a block in an object. For tables INITRANS defaults to 1 for indexes, 2.
The MAXTRANS setting controls the maximum number of ITLs that a block can allocate (usually defaults to 255). If a block is sparsely populated then Oracle will dynamically increase the number of ITLs up to MAXTRANS.
ITL's and Block Waits
However, if the block has little or no free space then transactions will serialize waiting on a free ITL. This is one cause for data base block waits. By setting INITRANS to the number of expected simultaneous DML (data manipulation language – insert, update and delete) transaction for a single block, you can avoid serialization for ITL slots.
The maximum value suggested for INITRANS is 100 and settings over this size rarely improve performance. Therefore a setting of INITRANS to the average number of simultaneous DML users and setting MAXTRANS to 100 will most likely result in the best utilization of resources and performance. Remember, each ITL requires approximately 23 bytes in the block header.
?
FREELISTS and their cousin FREELIST GROUPS:
A freelist if a one-way linked list (or a bitmap) that identified blocks that can accept data.
FREELIST GROUPS was designed for Oracle Parallel Query (OPQ) and used in Oracle Real Application Clusters (RAC) where many instances need to attach to the same data block.
For example, a setting of FREELISTS 4 and FREELIST GROUPS 2 result in 8 total FREELISTS. Generally speaking FREELIST groups are used in Oracle real application clusters where the setting should be equal to the number of nodes (instances) participating in the cluster. FREELISTS should be set to the number of simultaneous DML users for the table (not the block!), tables default to 1 FREELIST and 0 FREELIST GROUPS.
Again, settings of greater than 100 rarely result in better performance for FREELISTS. Also, tables will, by default, extend based on the minimum allowed extension times the number of FREELISTS so be aware of this when setting FREELISTS.
PCTFREE and PCTUSED
The PCTFREE and PCTUSED parameters tell Oracle when to link and unlink a block from the freelist chain.? The following discussion only applies if you are not using Automatic Segment Space Management (ASS Management).
The ASS management tablespace is new in Oracle9i and is implemented by adding the SEGMENT SPACE MANAGEMENT AUTO clause to the tablespace definition. ASM tablespaces automate freelist management and remove the ability to specify PCTFREE, PCTUSED, FREELISTS, and FREELIST GROUPS storage parameters.
The setting for PCTFREE sets the value for the percent of a block to reserve for updates. A block will remain on a FREELIST until it reaches blocksize * (1-(ptcfree/100)) full or greater. Here are the main issues with incorrect settings:
High Chained Rows - If PCTFREE is to small, adequate space may not be reserved in the block for update of variable sized rows in the block, or, may not have enough space for a complete row insert. In this case a block chaining will occur where the data is migrated to a new block and a pointer will be established from the old block to a new block.
?
High I/O - This will result in doubling the IO required to retrieve this data. For new data blocks, the space available for inserts is equal to the block size minus the sum of the block overhead (84-107 bytes) and free space (PCTFREE/100 * blocksize). When you update existing data Oracle uses any available space in the block. So, updates will eventually reduce the available space in a block to less than PCTFREE, the space reserved for updates but not accessible to inserts. This removes the block form the freelist on which it resides.
The un-link process
Blocks with total filled volume less than BLOCKSIZE – overhead – (blocksize*(1-(PCTFREE/100)) are available for inserts. When you issue an INSERT statement, Oracle checks a free list of the table for the first available data block and uses it if possible. If the free space in the selected block is not large enough to accommodate the data in the? INSERT statement, and the block is at least filled to the value PCTUSED, then Oracle will remove the block from the free list. Multiple free lists for each segment can reduce contention for free lists when concurrent inserts take place.
The Re-link Process
After processing a DELETE or UPDATE statement, Oracle checks to see if the space being used in the block is now less than (BLOCKSIZE – overhead) * PCTUSED/100. If it is, then the block goes to the beginning of the transaction free list, and it is the first of the available blocks to be used in that transaction. However, it is only when the transaction commits, that the free space in the block becomes available for other transactions.
For tables with high levels of updates, setting PCTFREE to a high value is suggested, for blocks which are never updated, then set this to a low value. For example, for a high update table a setting of 40-50 is acceptable, while for a low or no update table (such as in a data warehouse) a setting of 5 or less is acceptable. PCTUSED must be set to less than 100-PCTFREE and should be set such that PCTFREE+PCTUSED is less than 100. If PCTFREE+PCTUSED=100 this can result in see-sawing of the block on and off the free lists which can be a performance issue.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84726/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 各版本引數/隱藏引數 介紹Oracle
- Oracle expdp impdp dump引數介紹Oracle
- ORACLE MTS的介紹(zt)Oracle
- ORACLE推導引數Derived Parameter介紹Oracle
- 【體系結構】Oracle引數介紹Oracle
- Oracle sqlplus prelim 引數介紹OracleSQL
- oracle引數說明(zt)Oracle
- Oracle 靜態引數與動態引數型別介紹Oracle型別
- docker 引數介紹Docker
- ORACLE初始化引數檔案介紹Oracle
- Oracle 優化引數 optimizer_mode 介紹Oracle優化
- oracle 10g AWR介紹(ZT)Oracle 10g
- Oracle的隱含引數(zt)Oracle
- gcc 常用引數介紹GC
- HRMS Function 引數介紹Function
- Oracle 最佳化引數 optimizer_mode 介紹Oracle
- Oracle 的基本函式介紹Oracle函式
- oracle impdp network_link引數使用介紹Oracle
- MongoDB啟動引數介紹MongoDB
- PostgreSQLGUC引數級別介紹SQL
- margin引數簡單介紹
- margin 引數簡單介紹
- ipchains引數介紹(轉)AI
- Windows下常見Oracle服務介紹(zt)WindowsOracle
- [zt] 如何檢視Oracle 隱含引數Oracle
- oracle之 sqlplus prelim 引數介紹 ( 處理hang )OracleSQL
- 2720 英文自我介紹
- eclipse 啟動引數介紹Eclipse
- 【儲存】megacli 常用引數介紹
- javascript bind()第一個引數以後引數介紹JavaScript
- docker 基本介紹Docker
- ipfs基本介紹
- TypeScript基本介紹TypeScript
- mysql一些引數的介紹MySql
- 資料表建立引數介紹(一)
- 資料表建立引數介紹(二)
- 資料表建立引數介紹(三)
- 資料表建立引數介紹(四)