Instructions to install the oracle database under Linux kernel parameters

You need to configure the database when you install the following kernel parameters:

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

Quote from: https://docs.oracle.com/cd/E11882_01/install.112/e47689/pre_install.htm#LADBI1187

Semaphores and shared memory are two entirely different operating system resources. Semaphores are Oracle resources for inter-process communication system, they take up a relatively small memory space, and comprising a shared memory for SGA and may occupy most of the physical memory.

aio-max-nr:所有活动异步 I/O 上下文中可允许的最多事件数。默认值为 65536;
file-max:当前内核可以打开的最大的文件句柄数;
shmmax:以字节为单位规定内核可允许的最大共享内存段。64位默认值为 68719476736;32位默认值为 4294967295。注:但内核支持的值比这个值要多得多,oracle中最小配置为536870912,64位最大值为物理内存-1字节,32位最大值为小于4GB-1个字节的值或4294967295,推荐设置为物理内存大小的1/2;
shmall:以字节为单位规定一次在该系统中可以使用的共享内存总量。64位默认值为4294967296;32位默认值为 268435456。oracle推荐的最小值为:2097152,在内存较小时可以使用小于2097152的值,内存较大时(超过8G)需要通过以下公式进行计划:公式1:memtotal/pagesize。公式2:(SHMMAX/getpagesize()*(SHMMNI/16))。
shmmni:系统范围内最大共享内存段数量。在 64 位和 32 位架构机器中的默认值都是 4096
sem:即semaphores缩写。共有四个值与之对应,oracle建议的值为kernel.sem = 250 32000 100 128 ,分别对应:
SEMMSL | maximum number of semaphores in a semphore set   | 250   |定义每个Oracle数据库的最大信号量数。|取值范围1 – 65536
SEMMNS | maximum number of semphores in the system        | 32000 |定义系统上的最大信号量。            |取值范围1 – 2147483647  
SEMOPM | maximum number of operations per semop(P) call   | 100   |定义每个semop调用的最大操作数。     |取值范围100
SEMMNI | maximum number of semaphore sets in system       | 128   |定义整个系统中信号量集的最大数量    |取值范围1 – 32768
规则:
SEMMNI*SEMMSL>=SEMMNS,SEMMNS=系统中每个实例process+10之和+2*max(process)

Correspondence between the operating system parameters in sysctl kernel.sem

$ ipcs -ls

------ Semaphore Limits --------
max number of arrays = 128      // SEMMNI
max semaphores per array = 250      // SEMMSL
max semaphores system wide = 32000     // SEMMNS
max ops per semop call = 100    // SEMOP
semaphore max value = 32767

Associated with the semaphore questions:
Question 1:

SQL> startup nomount
ORA-27154: post/wait create failed
ORA-27300: OS system dependent operation:semget failed with status: 28
ORA-27301: OS failure message: No space left on device
ORA-27302: failure occurred at: sskgpcreates

[root@prodb linux]# ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0x00000000 0          root       600        1         
0x00000000 65537      root       600        1         
0x9a31ff94 1507331    oracle     640        154 
本例中154>max number of arrays = 128需要调整SEMMNI值为200及以上。

Question 2:

Getting ORA-600 [OSDEP_INTERNAL] errors while starting up the database:

ORA-00600: internal error code, arguments: [OSDEP_INTERNAL],
[], [], [], [], [], [], []
ORA-27302: failure occurred at: skgpwreset1
ORA-27303: additional information: invalid shared ctx
ORA-27146: post/wait initialization failed
ORA-27300: OS system dependent operation:semget failed with status: 28
ORA-27301: OS failure message: No space left on device
ORA-27302: failure occurred at: sskgpsemsper

semmns值太小,修改为:kernel.sem = 256 32768 100 228

Semaphore deleted

Semaphores or shared memory error occurs mainly when the instance starts (in particular 'startup nomount' phase). This is the only time Oracle instance attempts to acquire semaphores and shared memory. During normal operation of the database associated with semaphores or shared memory errors rarely occur. The most common of these errors occur is during the creation of a new database. However, sometimes when the Oracle instance crashes, the operating system may not release the shared memory segment. This limits the total amount of shared memory can be used for example to start again. In this case, you need to manually delete these segments.

[oracle@prodb ~]$ $ORACLE_HOME/bin/sysresv

IPC Resources for ORACLE_SID "PROD3" :
Shared Memory:
ID              KEY
1966083         0x00000000
1998852         0x00000000
2031621         0x4db7973c
Semaphores:
ID              KEY
1507331         0x9a31ff94
Oracle Instance alive for sid "PROD3"

Linux: 
% ipcrm shm 2031621 1998852 1966083

Other Unix: 
% ipcrm -m 12189717

Guess you like

Origin blog.51cto.com/hunt1574/2433245