原创 转载请注明出处
公司的新服务器到了内存24GB预装 LINUX AS 5.1 64BIT,我正在对其进行安装,同时需要部署DATA GUARD 最大性能模式。我准备未SGA分配
15GB空间,PGA无所谓了分给4GB好了,反正PGA也是
按需分配的,不像SGA实例一启动就分配了,当然设置包括几个重要的内核参数,主要涉及到LINUX共享内存,重要的2个内核参数是SHMMAX和
SHMALL,
SHMMAX:表示任意时刻系统可以分配一个共享内存段的最大值,当然我们希望SGA包含在一个共享段里面,所以这个值要设置外>15G,设置为
16G好了。
SHMALL: 表示任意时刻系统可以分配给共享内存段页数的最大值,同样这个值至少不能小于我们最大的共享内存段的大小SHMMAX吧,这个值
是以内存页为单位的,查看内存页大小使用getconf PAGE_SIZE
一般都4096,所以是16GB/4KB=16777216KB/4KB=4194304
所以内核参数修改为
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
kernel.shmall = 4194304
kernel.shmmax = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
下面的文档取自METALINK
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.4 to 11.1.0.6
SUSE \ UnitedLinux x86-64
Red Hat Enterprise Linux Advanced Server x86-64 (AMD Opteron Architecture)
x86 64 bit (for Enterprise Linux only)
Symptoms
When trying to increase the SGA to approach half available RAM with an Oracle 64bit version on a Linux 64bit operating
system, even though shmmax is set to match half the amount of RAM, you get the following error when trying to start the
instance:
SQL> startup nomount
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device
Changes
shmall is too small, most likely is set to the default setting of 2097152
$ cat /proc/sys/kernel/shmall
2097152
Cause
shmall is the total amount of shared memory, in pages, that the system can use at one time.
Solution
Set shmall equal to the sum of all the SGAs on the system, divided by the page size.
The page size can be determined using the following command:
$ getconf PAGE_SIZE
4096
For example, if the sum of all the SGAs on the system is 16Gb and the result of '$ getconf PAGE_SIZE' is 4096 (4Kb) then set
shmall to 4194304 pages
As the root user set the shmall to 4194304 in the /etc/sysctl.conf file:
kernel.shmall = 4194304
then run the following command:
# sysctl -p
# cat /proc/sys/kernel/shmall
4194304