run the script once the database is up and running. The reasoning behind allocating huge pages once the database is up and running is to provide a proper number of pages to handle the running shared memory segments. The steps are as follows:1.Copy the bash script found within AppendixE Huge Pages Scriptand save it ashuge_pages_settings.sh2.As the rootuser, ensure the huge_pages_settings.shis executable by running the following command:# chmod +x huge_pages_settings.sh3.As the rootuser, execute the huge_pages_settings.shscript as follows:# ./huge_pages_settings.shRecommended setting within the kernel boot command line: hugepages = <value>Recommended setting within /etc/security/limits.d/99-grid-oracle-limits.conf:oracle soft memlock <value>Recommended setting within /etc/security/limits.d/99-grid-oracle-limits.conf:oracle hard memlock <value>4.Add the number of hugepages provided by the huge_pages_settings.shscript to the kernel boot command line within the /etc/grub.confand disable transparenthugepagespersistently across reboots as follows:title Red Hat Enterprise Linux (2.6.32-431.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/myvg-rootrd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_DM rd_LVM_LV=myvg/root KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=myvg/swap rhgb quiet hugepages=<value-provided-by-script> transparent_hugepage=neverinitrd /initramfs-2.6.32-431.el6.x86_64.img20 ALERT: Disable Transparent HugePages on SLES11,RHEL6,OEL6 and UEK2 Kernels (DOC ID: 1557478.1)58refarch-fee[email protected]
NOTE: Allocating the number of huge pages within the kernel boot command line is the most reliable method due to memory not yet becoming fragmented.215.Oracle requires setting the soft and hard limits to memlock. Setting memlockallows theoracleuser to lock a certain amount of memory from physical RAM that isn't swapped out. The value is expressed in kilobytes and is important from the Oracle perspective because it provides the oracleuser permission to use huge pages. This value should be slightly larger than the largest SGA size of any of the Oracle Databaseinstances installed in an Oracle environment. To set memlock,add within /etc/security/limits.d/99-grid-oracle-limits.conf the following:oracle soft memlock <value-provided-by-script>oracle hard memlock <value-provided-by-script>6.Reboot the system to ensure the huge pages setting takes effect properly. 7.Verify the value provided by the huge_pages_settings.sh matches thetotal number of huge pages available on the system with the following command:# cat /proc/meminfo | grep -i hugepages_totalHugePages_Total: <value-provided-by-script>8.Verify the current status of the transparenthuge pages is set to NEVERvia the following command:# cat /sys/kernel/mm/transparent_hugepage/enabledalways madvise [never]NOTE:Starting with Oracle Database version 11.2.0.2, the initialization parameter “USE_LARGE_PAGES” was introduced to allocate huge pages on a per database use case. The default value for Oracle Database 12.0.1.0 is set to true. Section 5Logging into the Oracle Container Database 12c Release 1 (12.1)