Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1099529
  • 博文数量: 276
  • 博客积分: 10077
  • 博客等级: 上将
  • 技术积分: 2513
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-24 20:31
文章分类

全部博文(276)

文章存档

2020年(1)

2015年(5)

2012年(2)

2011年(6)

2010年(7)

2009年(224)

2008年(31)

我的朋友

分类: Oracle

2009-05-10 22:52:05

: 317141.1 Type: HOWTO
  Modified Date : 20-FEB-2009 Status: PUBLISHED

In this Document
  
  
  


Applies to:

Oracle Server - Enterprise Edition - Version: 9.2.0.1
Linux Kernel - Version: 2.6.9 to 2.6.9
Linux x86

Goal

This document aims to guide Linux system administrators on RedHat and Oracle Enterprise Linux 4 to configure Very Large Memory and big SGA for Oracle RDBMS with ramfs and hugepages

The configuration provided in this document applies strictly to 32-bit Linux. For HugePages on 64-bit Linux, see

Solution

Follow steps below to perform the configuration:
For 9iR2 unpublished Patch 3318884 (9.2.0.4) and Patch 3566570 (9.2.0.5)are required respectively. Versions starting with 9.2.0.6 and later does not need any patches

1. Logon root
2. Configure Linux to mount ramfs over /dev/shm at every boot. Edit /etc/rc.local and add the following:
umount /dev/shm
mount -t ramfs ramfs /dev/shm
chown oracle:oinstall /dev/shm
where oracle is the Oracle owner and oinstall is the group for Oracle owner account. If with your configuration rc.local is disabled or you are starting your Oracle database instance using a Linux service script (under /etc/init.d) then you can add those lines in your service script.
3. Reboot server
4. Logon as root
5. Check whether /dev/shm is mounted with type ramfs
# mount | grep shm
ramfs on /dev/shm type ramfs (rw)
#
6. Check permissions of /dev/shm
# ls -ld /dev/shm
drwxr-xr-x 3 oracle oinstall 0 Jul 13 12:12 /dev/shm
#

7. Increase max locked memory limit. Edit /etc/security/limits.conf and add
*    soft   memlock 3145728
* hard memlock 3145728
8. Logon to oracle
9. Check max locked mem limit:
$ ulimit -l
3145728
$

11. Configure instance parameters for VLM:
a. ConvertDB_CACHE_SIZE, DB_xK_CACHE_SIZE parameters to DB_BLOCK_BUFFERS
b. Add parameter USE_INDIRECT_DATA_BUFFERS=TRUE
c. Configure SGA size according to the needs
d. Remove SGA_TARGET if set
e. Remove MEMORY_TARGET / MEMORY_MAX_TARGET parameters if set (see )
12. Startup instance
13. Examine the memory allocation:
$ ls -l /dev/shm
...
$ ipcs -m
...
$
14. Configure hugepages
a. Get Hugepagesize from
$ grep Hugepagesize /proc/meminfo
Hugepagesize: ..... kB
$

b. Compute nr_hugepages using
c. Set kernel parameter:
# sysctl -w vm.nr_hugepages=
...
#

d. Set parameter for every boot.Edit/etc/sysctl.conf for vm.nr_hugepages=
15. Check available hugepages:
$ grep Huge /proc/meminfo
HugePages_Total: ...
HugePages_Free: ...
Hugepagesize: ..... kB
$

16. Restart instance
17. Check available hugepages (1 or 2 pages free)
$ grep Huge /proc/meminfo
HugePages_Total: ...
HugePages_Free: ... (1/2)
Hugepagesize: ..... kB
$

If the setting of nr_hugepages is not effective, you might need to reboot the server.

References

- Shell Script to Calculate Values Recommended HugePages / HugeTLB Configuration
阅读(579) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~