这篇文章讨论Oracle数据库初始化参数use_large_pages的使用。
SQL> show parameter use_large_pages
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
use_large_pages string
TRUE
在11gR2版本的数据库,use_large_pages的默认值是TRUE。
SQL> alter system set use_large_pages=xxx scope=spfile;
alter system set use_large_pages=xxx scope=spfile
*
第 1 行出现错误:
ORA-00096: 值 XXX 对参数 use_large_pages 无效, 它必须来自 FALSE, ONLY, AUTO,TRUE 之间
use_large_pages可设置的值包括:FALSE,ONLY,AUTO,TRUE。
下面通过摘取官方文档讨论ONLY和TRUE之间的区别:
5.1.9 Use Automatic Shared Memory Management and Avoid Memory Paging
For any systems with 4 GB or more memory, disable Automatic Memory Management by setting MEMORY_TARGET=0 and enable Automatic Shared Memory Management by setting SGA_TARGET.
The sum of SGA and PGA memory allocations on the database server should always be less than your system's physical memory, and conservatively should be less than 75% of total system memory. However, PGA_AGGREGATE_TARGET is not a hard limit, and for some Data Warehouse or reporting applications, the PGA memory can grow to be 3 X PGA_AGGREGATE_TARGET.
Monitor PGA memory and host-based memory utilization using Oracle Enterprise Manager, or by querying v$pgastat and operating systems statistics, to get an accurate understanding of memory utilization.
Avoid memory paging by adjusting the number of databases and applications, or reducing the allocated memory settings.
On Linux Operating systems it is recommended that you configure HugePages so that ASM and database instances can use it for their SGA.
在Linux操作系统推荐配置HugePages,以至于ASM和数据库实例的SGA都能使用HugePage来提高性能。ASM实例的SGA同样有必要使用HugePage来提高性能。
HugePages is a feature integrated into the Linux kernel from release 2.6. This feature provides the alternative to the 4K page size providing bigger pages. Using HugePages has the benefit of saving memory resources by decreasing page table overhead while making sure the memory is not paged to disk. This contributes to faster overall memory performance. Next to this overall node stability will benefit from using HugePages.
Ensuring the entire SGA of a database instance is stored in HugePages can be accomplished by setting the init.ora parameter use_large_pages=only. Setting this parameter will ensure that an instance will start only when it can get all of its memory for SGA from HugePages. For this reason the settinguse_large_pages=only is recommended for database instances.
设置初始化参数中的use_large_pages=only能够确保数据库实例的整个SGA存放在HugePages中。设置这个参数将确保只有当数据库实例的SGA从HugePages中获得所有的内存才能被启动。基于这个原因,use_large_pages=only是数据库实例推荐的设置。
For ASM instances leave use_large_pages=true (the default value). This setting still ensures that HugePages are used when available, but also ensures that ASM as part of Grid Infrastructure starts when HugePages are not or insufficiently configured.
针对ASM实例,保留use_large_pages=true(默认值),这个设置确保在Hugepage活动的情况下仍然能够使用,但是也确保当HugePages不活动或者没有足够配置的情况下,作为GI一部分的ASM能够被启动。
Use Automatic Shared Memory Management, as HugePages are not compatible with Automatic Memory Management.
--end--