时间:2021-07-01 10:21:17 帮助过:11人阅读
shmall是全部允许使用的共享内存大小,单位是页,可以通过getconfPAGESIZE来获取每页的大小,一般为4096字节shmmax是单个段允许使用的最大共享内存大小可以使用ip
shmall是全部允许使用的共享内存大小,单位是页,可以通过getconf PAGESIZE来获取每页的大小,一般为4096字节
shmmax是单个段允许使用的最大共享内存大小
可以使用 ipcs -l 看到shmall,shmmax设置的值。ipcs -u可以看到实际使用的情况。
下面为shmall和shmmax参数相关的案例
环境介绍:
操作系统:suse 11 sp1 64bit 数据库版本:oracle 11g R1 64bit 主机内存:94G1、主机内存94G,更改数据库的sga_target为40G,重启数据库生效该参数,在启动过程报ORA-27102: out of memory错误:
SQL> alter system set sga_target=40G scope=spfile; System altered. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORA-27102: out of memory Linux-x86_64 Error: 28: No space left on device2、当前的shmall和shmmax参数设置如下:
fly007:~ # cat /etc/sysctl.conf | grep -E 'shmall|shmmax' kernel.shmall = 4194304 kernel.shmmax = 507089285123、shmmax是单个段允许使用的最大共享内存大小,单位是字节,一般shmmax>sga_target的大小,这样整个sga就在一个共享内存段,这是推荐的做法,我们这设置的shmmax为物理内存的一半,也就是47G,大于sga_target=40G,该参数设置正确
fly007:~ # cat /etc/sysctl.conf | grep shmmax kernel.shmmax = 50708928512 fly007:~ # echo "50708928512/1024/1024/1024" | bc 474、shmall是全部允许使用的共享内存大小,注意单位是页,通过getconf PAGESIZE命令得到每页的大小为4096字节,也是就4194304*4096/1024/1024/1024=16G
fly007:~ # getconf PAGESIZE 4096 fly007:~ # cat /etc/sysctl.conf | grep shmall kernel.shmall = 4194304 fly007:~ # echo "4194304*4096/1024/1024/1024" | bc 16 5、全部允许使用的共享内存大小为16G<40G,所以启动数据库报错了,shmall参数可以这样设置,shmall=shmmax/4096=50708928512/4096=12380109
6、设置shmall参数为12380109,,生效该设置,启动数据库,正常启动
以下关于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”.