Transferred from: http://www.blogjava.net/tbwshc/archive/2012/09/13/387652.html
http://blog.csdn.net/wuweilong/article/details/7420310
Prior to installing Oracle, a key focus was to modify kernel parameters, most notably memory-related parameter settings, in addition to checking that the operating system's hardware and software meet the installation needs.
Shmmax parameter: The maximum value of a separate shared memory segment that the Linux process can allocate. Generally set to half the total memory size. The setting for this value should be greater than the value of Sga_max_target or memory_max_target, so for systems that have an Oracle database installed, the value of Shmmax should be greater than one-second of the memory.
# grep Memtotal/proc/meminfo
# Cat/proc/sys/kernel/shmmax
The above command is to check the size of the system memory and the current Shmmax settings.
# echo 21474836480 >/proc/sys/kernetbl/shmmax
# sysctl-w kernel.shmmax=21474836480
# echo "kernel.shmmax=21474836480" >>/etc/sysctl.conf
Here are several ways to set the Shmmax parameter, which can be set to 20G in all three ways. This parameter can be modified without restarting the database. The method of using the second SYSCTL command is recommended by the individual. A third approach is required to perform a sysctl–t operation or reboot, but the third way is necessary to ensure that the setting value is still in effect after the next reboot. The first two approaches are similar to the alter system set scope = memory, whereas the third way is similar to the alter system set scope = SPFile.
Shmmni parameter: Sets the maximum number of shared memory segments at the system level. ORACLE10G recommended minimum value is 4096, can be appropriate than 4096 to increase some.
# Cat/proc/sys/kernel/shmmni
# echo 4096 >/proc/sys/kernel/shmmni
# sysctl-w kernel.shmmni=4096
# echo "kernel.shmmni=4096" >>/etc/sysctl.conf
Check and set the method as above, this and Shmmax modification way no difference, not repeat.
Shmall parameter: Sets the total number of shared memory pages. This value is too small to cause the database to start an error. Many people only focus on the Shmmax parameter when adjusting the kernel parameters of the system, ignoring the setting of the Shmall parameter. This value is recommended to be set to the physical memory size divided by the paging size.
# getconf Page_size
The size of the paging is obtained by getconf, which is used to calculate the reasonable setting value of the Shmall:
Sql> select 32*1024*1024*1024/4096 from dual;
32*1024*1024*1024/4096
----------------------
8388608
For 32G of memory, the 4K paging-size system, the Shmall value should be set to 8388608.
# Cat/proc/sys/kernel/shmall
# echo 8388608 >/proc/sys/kernel/shmall
# sysctl-w kernel.shmall=8388608
# echo "kernel.shmall=8388608" >>/etc/sysctl.conf
Query and set the method as above.
Beacon Semaphores is a counter that provides synchronization when accessing shared memory between processes or threads.
SEMMSL parameter: Set the maximum number of semaphores in each semaphore group, the recommended minimum value is 250. For systems with a large number of concurrent connections, it is recommended that this value be set to the processes initialization parameter plus 10.
Semmni parameter: Sets the maximum number of semaphore groups in the system. The recommended value for oracle10g and 11g is 142.
Semmns parameter: Sets the maximum number of semaphores in the system. The operating system does not exceed least (Semmns,semmsl*semmni) when assigning semaphores. In fact, if the value of Semmns exceeds Semmsl*semmni is illegal, the recommended Semmns value is set to Semmsl*semmni. Oracle recommended Semmns is set to no less than 32000, if the processes parameter of the database is set to 600, the Semmns setting should be:
Sql> Select (600+10) *142 from dual;
(600+10) *142
------------
86620
SEMOPM parameter: Sets the maximum number of semaphore operations that can be performed at the same time per system call. Since a signal light group has a maximum of SEMMSL semaphores, it is recommended that the SEMOPM be set to the value of SEMMSL. Oracle verifies that the 10.2 and 11.1 semopm are configured with 100.
The following command allows you to check the semaphore related configuration:
# Cat/proc/sys/kernel/sem
250 32000 100 128
The corresponding 4 values are SEMMSL, Semmns, SEMOPM, and Semmni, respectively, from left to right. Modify the method to:
# echo 610 86620 142 >/proc/sys/kernel/sem
# sysctl-w kernel.sem= "610 86620 100 142"
# echo "kernel.sem=610 86620 142" >>/etc/sysctl.conf
(1) Kernel.shmmax: This parameter defines the maximum size, in bytes, of a shared memory segment. The default value for Linux 2.4/2.6 is 32M, which is too low for Oracle, and is usually set to be as large as the actual memory.
(2) Kernel.shmmni: This kernel parameter is used to set the maximum number of shared memory segments in the system range. The default value for this parameter is 4096. It is not usually necessary to change.
(3) Kernel.shmall: This parameter represents the total amount of shared memory (in pages) that the system can use at one time. The default value is 2097152, which is usually not required for modification.
(4) Kernel.sem: This parameter indicates the amount of semaphore set.
(5) Fs.file-max: This parameter represents the maximum number of file handles. The file handle setting indicates the number of files that can be opened on a Linux system.
(6) Net.ipv4.ip_local_port_range: Indicates the range of the port, for the specified content.
(7) Net.core.rmem_default: Represents the default value (in bytes) for receiving the socket buffer size.
(8) Net.core.rmem_max: The maximum value (in bytes) that represents the size of the receiving socket buffer
(9) Net.core.wmem_default: The default value (in bytes) that represents the size of the send socket buffer.
Net.core.wmem_max: The maximum value, in bytes, that represents the size of the send socket buffer.
After modifying the kernel, execute the sysctl-p command to make the new configuration effective.
Attention:
For 32-bit systems, one page =4k, or 4096 bytes
Kernel.shmall = 4096 is 4096*4k/1024/1024 = 15M means that the available shared memory is 15M, the database will certainly not come up.
The original value is Kernel.shmall = 4096
General rules of Setup
Kernel.shmall = 2097152---memory 8G
Kernel.shmall = 4194304---memory 16G
Kernel.shmall = 8388608---memory 32G
Kernel.shmall = 10485760---memory 40G
Kernel.shmall = 12582912---memory 48G
Kernel.shmall = 14680064---memory 56G
Kernel.shmall = 16777216---memory 64G
Kernel.shmall = 20971520---memory 80G
Kernel.shmall = 25165824---memory 96G
Kernel.shmall = 33554432---memory 128G
Kernel.shmall = 50331648---memory 192G
Kernel.shmall = 67108864---memory 256G
What is the meaning of setting kernel parameters on Linux when installing Oracle