您好,欢迎访问一九零五行业门户网

shmall参数设置不当引起数据库启动时报out of memory报错

shmall是全部允许使用的共享内存大小,单位是页,可以通过getconfpagesize来获取每页的大小,一般为4096字节shmmax是单个段允许使用的最大共享内存大小可以使用ip
shmall是全部允许使用的共享内存大小,单位是页,可以通过getconf pagesize来获取每页的大小,一般为4096字节
shmmax是单个段允许使用的最大共享内存大小
可以使用 ipcs -l 看到shmall,shmmax设置的值。ipcs -u可以看到实际使用的情况。
oracle@fly007:~> ipcs -l------ shared memory limits --------max number of segments = 4096max seg size (kbytes) = 4194304 //shmmax为4gmax total shared memory (kbytes) = 8388608 //shmall为8gmin seg size (bytes) = 1------ semaphore limits --------max number of arrays = 128max semaphores per array = 250max semaphores system wide = 32000max ops per semop call = 100semaphore max value = 32767------ messages: limits --------max queues system wide = 16max size of message (bytes) = 65536default max size of queue (bytes) = 65536oracle@fly007:~> ipcs -u------ shared memory status --------segments allocated 3pages allocated 3pages resident 3pages swapped 0swap performance: 0 attempts0 successes------ semaphore status --------used arrays = 4allocated semaphores = 488------ messages: status --------allocated queues = 0used headers = 0下面为shmall和shmmax参数相关的案例
环境介绍:
操作系统:suse 11 sp1 64bit数据库版本:oracle 11g r1 64bit主机内存:94g      1、主机内存94g,更改数据库的sga_target为40g,重启数据库生效该参数,在启动过程报ora-27102: out of memory错误:
sql> alter system set sga_target=40g scope=spfile;system altered.sql> shutdown immediatedatabase closed.database dismounted.oracle instance shut down.sql> startupora-27102: out of memorylinux-x86_64 error: 28: no space left on device     2、当前的shmall和shmmax参数设置如下:
fly007:~ # cat /etc/sysctl.conf | grep -e 'shmall|shmmax'kernel.shmall = 4194304kernel.shmmax = 50708928512     3、shmmax是单个段允许使用的最大共享内存大小,单位是字节,一般shmmax>sga_target的大小,这样整个sga就在一个共享内存段,这是推荐的做法,我们这设置的shmmax为物理内存的一半,也就是47g,大于sga_target=40g,该参数设置正确
fly007:~ # cat /etc/sysctl.conf | grep shmmaxkernel.shmmax = 50708928512fly007:~ # echo 50708928512/1024/1024/1024 | bc47     4、shmall是全部允许使用的共享内存大小,注意单位是页,通过getconf pagesize命令得到每页的大小为4096字节,也是就4194304*4096/1024/1024/1024=16g
fly007:~ # getconf pagesize4096fly007:~ # cat /etc/sysctl.conf | grep shmallkernel.shmall = 4194304fly007:~ # echo 4194304*4096/1024/1024/1024 | bc16    5、全部允许使用的共享内存大小为16g    6、设置shmall参数为12380109,,生效该设置,启动数据库,正常启动
fly007:~ # cat /etc/sysctl.conf | grep shmallkernel.shmall = 12380109fly007:~ # sysctl -pfly007:~ # su - oracleoracle@fly007:~> sqlplus /nologsql*plus: release 11.1.0.7.0 - production on wed dec 25 23:45:04 2013copyright (c) 1982, 2008, oracle. all rights reserved.sql> conn /as sysdbaconnected to an idle instance.sql> startuporacle instance started.total system global area 4.8103e+10 bytesfixed size2170704 bytesvariable size1.9998e+10 bytesdatabase buffers2.8052e+10 bytesredo buffers50548736 bytesdatabase mounted.database opened.sql>       以下关于shmall和shmmax内容来自:+and+shmall
configuring shmmax and shmall for oracle in linux
======
shmmax and shmall are two key shared memory parameters that directly impact’s the way by which oracle creates an sga. shared memory is nothing but part of unix ipc system (inter process communication) maintained by kernel where multiple processes share a single chunk of memory to communicate with each other.
while trying to create an sga during a database startup, oracle chooses from one of the 3 memory management models a) one-segment or b) contiguous-multi segment or c) non-contiguous multi segment. adoption of any of these models is dependent on the size of sga and values defined for the shared memory parameters in the linux kernel, most importantly shmmax.
shmmax and shmall -
shmmax is the maximum size of a single shared memory segment set in “bytes”.
其它类似信息

推荐信息