初始化参数的设定范围与调优
2008-09-09 12:08:21 来源:WEB开发网一、内存的调节
1、SHARED_POOL_SIZEParameter type: | String |
Syntax: | SHARED_POOL_SIZE = integer [K | M] |
Parameter class: | Static |
Default value: | If 64 bit, 64MB, else 16MB |
Range of values: | 300 Kbytes to operating system dependent |
共享缓冲池由库缓存和数据字典缓存组成,库缓存存放SQL的解析代码及相应的执行计划;数据字典缓存存放表、列的定义及它们的权限信息等。调节shared_pool_size相应地调节了库缓存和数据字典缓存的大小。可通过查询视图V$SGASTAT来监控共享缓冲池的使用。
查询视图V$LIBRATYCACHE可得出Reloads_to_Pins的比率,如果此比率大于1%,增加shared_pool_size的大小。
2、SHARED_POOL_RESERVED_SIZEParameter type: | String |
Syntax: | SHARED_POOL_RESERVED_SIZE = integer [K | M] |
Parameter class: | Static |
Default value: | 5% of the value of SHARED_POOL_SIZE |
Range of values: | Minimum: value of SHARED_POOL_RESERVED_MIN_ALLOC Maximum: one half of the value of SHARED_POOL_SIZE (in bytes) |
为大需求保留的空闲空间。当shared_pool产生大量碎片,oracle为当前需求寻找shared_pool时,它避免了性能的降低。
3、DB_BLOCK_SIZEParameter type: | Integer |
Parameter class: | Static |
Default value: | Operating system dependent |
Range of values: | 2048 to 32768, but your operating system may have a narrower range |
Oracle Parallel Server: | You must set this parameter for every instance, and multiple instances must have the same value |
CAUTION: Set this parameter at the time of database creation. Do not alter it afterward. |
Parameter type: | Integer |
Parameter class: | Static |
Default value: | Derived: 48 MB / DB_BLOCK_SIZE |
Range of values: | 4 to an operating system specific maximum |
Oracle Parallel Server: | Multiple instances can have different values, and you can change the values as needed. |
数据缓存的大小 = db_block_size*db_block_buffers
查询视图V$SYSSTAT可得出数据缓存的命中率,如果命中率低于90%,增加db_block_buffers的大小。
5、BUFFER_POOL_KEEPParameter type: | String |
Syntax: | BUFFER_POOL_KEEP = {integer | (BUFFERS: integer [, LRU_LATCHES: integer] ) } where integer is the number of buffers and, optionally, the number of LRU latches. |
Parameter class: | Static |
Default value: | None |
在db_block_buffer中,分离出一小部分做为KEEP缓冲池,此参数常与buffer_pool_recycle联合使用。
6、BUFFER_POOL_RECYCLEParameter type: | String |
Syntax: | BUFFER_POOL_RECYCLE = integer | (BUFFERS: integer [, LRU_LATCHES: integer] ) where integer is the number of buffers and, optionally, the number of LRU latches. |
在db_block_buffer中,分离出一小部分做为可重复使用的缓冲池,此参数常与buffer_pool_keep联合使用。
7、LOG_BUFFERParameter type: | Integer |
Parameter class: | Static |
Default value: | Operating system specific. Maximum: 500K or 128K * CPU_COUNT, whichever is greater |
Range of values: | Operating system dependent |
如果系统的事务处理比较繁忙,建议log_buffer取64k或以上。
查询视图V$SYSSTAT,如果redo buffer allocation retries/redo entries > 1%,则增加log_buffer的大小。
二、排序
1、SORT_AREA_SIZEParameter type: | Integer |
Parameter class: | Dynamic. Scope= ALTER SESSION, ALTER SYSTEM ... DEFERRED. |
Default value: | Operating system dependent |
Range of values: | Minimum: the value equivalent of six database blocks Maximum: operating system dependent |
此参数说明了oracle排序的最大内存数。排序完成,当行返回之前,oracle按参数sort_area_retained_size给定的值释放内存;当所有的行全部返回后,oracle将内存全部释放。
查询视图V$SYSSTAT,如果sorts(disk)/sorts(memory) > 5%,则增加sort_area_size的大小。
2、SORT_AREA_RETAINED_SIZE
Parameter type: | Integer |
Parameter class: | Dynamic. Scope= ALTER SESSION, ALTER SYSTEM ... DEFERRED. |
Default value: | Derived from SORT_AREA_SIZE |
Range of values: | from the value equivalent of two database blocks to the value of SORT_AREA_SIZE |
三、回滚段
1、TRANSACTIONSParameter type: | Integer |
Parameter class: | Static |
Default value: | Derived (1.1 * SESSIONS) |
Range of values: | 4 to 232 |
Oracle Parallel Server: | Multiple instances can have different values. |
此参数说明了oracle 服务器允许的最大并发事务数。
2TRANSACTIONS_PER_ROLLBACK_SEGMENTParameter type: | Integer |
Parameter class: | Static |
Default value: | 5 |
Range of values: | 1 to operating system dependent |
Oracle Parallel Server: | Multiple instances can have different values. |
此参数说明了每一回滚段允许的最大并发事务数。
Transactions/transactions_per_rollback_segment的结果取整,即为此数据库服务器所需的回滚段数。
四、I/O的调整
DB_FILE_MULTIBLOCK_READ_COUNTParameter type: | Integer |
Parameter class: | Dynamic. Scope = ALTER SYSTEM, ALTER SESSION. |
Default value: | 8 |
Range of values: | Operating system dependent |
此参数表示在全表扫描中,每一个I/O操作读取的最大数据库块数。
例如:db_file_multibolck_read_count=16 db_block_size=4k
每次I/O读取64k
而系统默认的next extent为5倍的db_block_size
每个extent的大小为20k
所以创建table时,next extent应设为20k和64k的最小公倍数,以减少碎片
更多精彩
赞助商链接