首页 > 代码库 > Linux下安裝Oracle database內核參數設置
Linux下安裝Oracle database內核參數設置
參考:1529864.1
**************************************************
RAM Swap Space
Between 1 GB and 2 GB 1.5 times the size of RAM
Between 2 GB and 16 GB Equal to the size of RAM
More than 16 GB 16 GB
**************************************************
1.設置內核參數/etc/sysctl.conf
III. Environment:
1. Below are the Minmum Recommended Kernel Parameter settings required for Database Software Installation. Modify your kernel settings in /etc/sysctl.conf as follows.
NOTE: If the current value for any parameter is higher than the value listed, do not change the value of that parameter.
這裡注意如果參數已經比下面的大了,就不要改該參數了
kernel.shmall = 1/2 of physical memory in pages, this will be the value 2097152. See Note 301830.1 for more information.
該參數的確定是根據如下確認的
Set SHMALL equal to the sum of all the SGAs on the system, divided by the page size
即SHMALL=SGA(BYTES)/PAGE_SIZE
$ 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
這裡假設SGA=16G
那麼SHMALL=16*1024*1024/4096=4194304
自動SGA管理設置為物理內存的0.4(oracle默認為物理內存40%)
我們的系統常見的物理內存由24GB 32GB
24GB SHMALL=24*1024*1024*1024*0.4/4096=2516582
32GB SHMALL=32*1024*1024*1024*0.4/4096=3355443
kernel.shmmax = 1/2 of physical memory in bytes. This would be the value 2147483648 for a system with 4GB of physical RAM.
這裡設置為物理內存的一半,或者稍大
For 64-bit Linux Systems :
Minimum: 536870912 (512 MB)
Maximum: A value that is 1 byte less than the physical memory
Recommended: More than half the physical memory
See My Oracle Support Note 567506.1 for additional information about configuring shmmax.
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
Note: This value limits concurrent outstanding requests and should be set to avoid I/O subsystem failures.
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
Note: The below Kernel Parameter "panic_on_oops=1" is being Introduced and required from 12.1.0.2.0 onwards.
12.1.0.2.0以後的參數
kernel.panic_on_oops=1
****************************************
2.激活內核參數
sysctl -p
3.設置用戶限制
a) /etc/security/limits.conf
************************************************
用法如下:
#<domain> <type> <item> <value>
#<domain> can be:
# - an user name
# - a group name, with @group syntax
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#<item> can be one of the following:
# - nproc - max number of processes
# - nofile - max number of open files
# - stack - max stack size (KB)
**********************************************
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
或者
@dba soft nproc 2047
@dba hard nproc 16384
@dba soft nofile 4096
@dba hard nofile 65536
@dba soft stack 10240
@dba hard stack 32768
修改后立即生效
b) /etc/pam.d/login
session required pam_limits.so
c)/etc/profile
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -u 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
文中第8點提到默認情況SELinux是enforcing,這個在12c安裝是可以不用再修改為disable了。
8. By default, RHEL 6 x86_64 Linux is installed with SELinux as "enforcing". This is fine for the Oracle Database 12.1 installation process.
Linux下安裝Oracle database內核參數設置