Professional Documents
Culture Documents
Database Server
carajandb.com/en/blog/2016/7-easy-steps-to-configure-hugepages-for-your-oracle-database-server
22. September
2016
MemTotal: 132151496 kB
1/5
SQL> select value from v$parameter where name = 'memory_target';
VALUE
---------------------------
0
How big is our SGA? In this example about 40 GB. Important: In the following query we
directly convert into kB (value/1024). With that we can continue to calculate directly:
VALUE
---------------------------
41943040
VALUE
---------------------------
TRUE
3. Check Hugepagesize
In our example we use a x86_64 Red Hat Enterprise Linux Server. So by default
hugepagesize should be set to 2 MB:
Hugepagesize: 2048 kB
4. Calculate Hugepages
For the calculation of the number of hugepages there is a easy way:
If you run more than one database on your server, you should include the SGA of all of
your instances into the calculation:
2/5
instance is down it will be not in the account. That means to adjust your SGA and restart
your database first. Than you can run the script. Result should be the following line.
Maybe you can make your own calculation and than check it with the script:
vi /etc/sysctl.conf
vm.nr_hugepages=20480
vm.nr_hugepages=20480
The next parameter is hard and soft memlock in /etc/security/limits.conf for our oracle
user. This value should be smaller than our available memory but minor to our SGA.
Our hugepages should fit into that by 100 percent. For that following calculation:
vi /etc/security/limits.conf
...
oracle soft memlock 41943040
oracle hard memlock 41943040
As mentioned before we have to disable transparent hugepages from Red Hat Linux
version 6 ongoing:
3/5
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[always] madvise never
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
always madvise [never]
6. Server Reboot
If all parameter are set, make a complete reboot your server. As an alternative you can
reload the parameters with sysctl -p.
7. Check Configuration
Memlock correct?
ulimit -l
41943040
AnonHugePages: 538624 kB
HugePages_Total: 20480
HugePages_Free: 12292
HugePages_Rsvd: 8188
HugePages_Surp: 0
Hugepagesize: 2048 kB
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
Did the database uses HugePages? For that we take a look into the alert log. After
„Starting ORACLE instance (normal)“ following entry „Large Pages Information“ gives us
advise:
4/5
************************ Large Pages Information *******************
********************************************************************
If your configuration is incorrect Oracle delivers recommendation here for the right
setting. In the following example exactly one Page is missing, so 2048 kB memlock to
come to 100% of SGA use of hugepages:
RECOMMENDATION:
********************************************************************
Done!
5/5