sitemap

RSS地图

收藏本站

设为首页

Oracle研究中心

当前位置:Oracle研究中心 > 运维DBA >

【学习笔记】Oracle数据库安装时Linux内核参数配置项

时间:2016-11-06 10:34   来源:Oracle研究中心   作者:HTZ   点击:

天萃荷净 Oracle研究中心学习笔记:分享一篇关于Oracle数据库FOR linux系统安装时的配置,详细介绍每一项关于内核参数配置的数值。

下面列出ORACLE安装时,sysctl.conf需要更改的参数。
#modify vm
echo "vm.dirty_ratio=5
vm.dirty_background_ratio=1
vm.dirty_writeback_centisecs=100
vm.dirty_expire_centisecs=500
vm.drop_caches=3
vm.swappiness=100
vm.vfs_cache_pressure=163">>/etc/sysctl.conf

#modify net
echo "net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=2097152
net.ipv4.ip_local_port_range = 9000 65500" >>/etc/sysctl.conf

#modify kerneOracle oracleplus.netl
echo "fs.aio-max-nr = 1048576
fs.file-max = 1536000
kernel.shmall = 7864320
kernel.shmmax = 32212254720
kernel.shmmni = 4096
kernel.sem=3000 1536000 3000 512 ">> /etc/sysctl.conf
#modify private network rp_filter
echo "net.ipv4.conf.eth3.rp_filter = 0
net.ipv4.conf.eth2.rp_filter = 0
net.ipv4.conf.bond1.rp_filter = 0">>/etc/sysctl.conf && tail -3 /etc/sysctl.conf

#modify big page
echo "vm.nr_hugepages = 23100">>/etc/sysctl.conf && tail -1 /etc/sysctl.conf

1,shmmax

说明

The maximum size(in bytes) of a single shared memory segment(sga).

配置

通过介绍是配置操作系统上所有的SGA内存的和,也就是所有共享内存的和,如果此参数小于共享内存的和,那么会出现下面的情况:
SHMMAX is the maximum size of a single shared memory segment set in bytes.. Ideally, we would like SGA_TARGET to fit in one shared memory segment at startup by having SGA_TARGET < SHMMAX . If SGA_TARGET > SHMMAX , then Oracle will try to use contiguous multi-segment to use to fit the SGA_TARGET. If it is not able to do so, then it will use non-contiguous multi-segment allocation and in this Oracle has to grab the free memory segments fragmented between used spaces.

kernel.shmmax = nnnnn

2,shmall

说明

This parameter sets the total amount of shared memory pages that can be used system wide. Hence, shmall should always be at least ceil(shmmax/page_size).如果直接大页,可以不需要配置此参数

配置

$ getconf PAGE_SIZE
4096
SHMMAX/PAGE_SIZE

kernel.shmall = 2097152

3,shmmin

说明

The minimum size(in bytes) of a single shared memory segment.

配置

默认值就可以了

kernel.shmmin = 4096

4,file-max


说明

所有进程能同时打开的文件总数

配置

512 x processes

fs.file-max = 6815744

5,ip_local_port_range

说明

端口号范围

配置

11G环境
ip_local_port_range = 9000 65500
11G之前环境
ip_local_port_range = 1024 65000

net.ipv4.ip_local_port_range = 9000 65500

6,aio-max-nr

说明:

异常的IO最大大小,MOS说在rhel 4,5已经取消此参数,但是在rhel 6与rhel 5里面肯定有此参数

配置:
ORACLE建议配置为1048576

fs.aio-max-nr = 1048576

7,sem信号量参数

说明:

kernel.sem = SEMMSL_value SEMMNS_value SEMOPM_value SEMMNI_value

NAME | DESCRIPTION | MIN VALUE
——-+————————————————–+————-
SEMMSL | maximum number of semaphores in a semphore set | 250(process+10)
SEMMNS | maximum number of semphores in the system | 32000(semmsl*semmni)
SEMOPM | maximum number of operations per semop(P) call | 100(process+10)
SEMMNI | maximum number of semaphore sets in system | 128
配置

kernel.sem=3000 1536000 3000 512

8,配置参数

These values determine how much kernel buffer memory is allocated per socket opened for network reads and writes:

* The _default values determine how much memory is consumed per socket immediately at socket creation.
* The _max values determine how much memory each socket is allowed to consume dynamically, if the memory requirements grow beyond the defaults.

Therefore, the best practice recommendation is to define lower default values (i.e. 256k) in order to conserve memory when possible, but have larger max values (1MB or greater) to allow for network performance gains if more memory is needed for a given socket.


#modify net
echo "net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=2097152 " >>/etc/sysctl.conf

9,虚拟内存

文件系统一些参数配置
vm.dirty_ratio=5 文件系统缓存占内存的百分比
vm.dirty_background_ratio=3 当脏数据达到内存百分之多少时,开始写出
vm.dirty_writeback_centisecs=100 写出唤醒的时间间隔,单位毫秒
vm.dirty_expire_centisecs=500 缓冲区数据被LRU考虑写出的时间,单位毫秒
vm.drop_caches=3 释放已经使用的cache
vm.swappiness=100 表示系统进行交换行为的程度,数值(0-100)越高,越可能发生磁盘交换
vm.vfs_cache_pressure=163 表示内核回收用于directory和inode cache内存的倾向,这个值越大,回收的倾向越严重 。

#modify vm
echo "vm.dirty_ratio=5
vm.dirty_background_ratio=1
vm.dirty_writeback_centisecs=100
vm.dirty_expire_centisecs=500
vm.drop_caches=3
vm.swappiness=100
vm.vfs_cache_pressure=163">>/etc/sysctl.conf

9,私有网卡

RAC私有网络配置
echo "net.ipv4.conf.eth3.rp_filter = 0
net.ipv4.conf.eth2.rp_filter = 0
net.ipv4.conf.bond1.rp_filter = 0">>/etc/sysctl.conf && tail -3 /etc/sysctl.conf

10,大页配置

大页配置
#这个是配置大页使用的(值为sga(M)/2+1)
#注意这里SGA为主机上所有实例的SGA,LINUX每一个大页支持2M。大页不支持AMM配置内存方式
vm.nr_hugepages=23100
本文固定链接: http://www.htz.pw/2015/03/20/oracle%e5%ae%89%e8%a3%85%e5%86%85%e6%a0%b8%e5%8f%82%e6%95%b0%e9%85%8d%e7%bd%ae_linux%e5%b9%b3%e5%8f%b0.html | 认真就输

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle数据库安装时Linux内核参数配置项

本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/1184.html

Oracle研究中心

关键词:

ORACLE安装内核参数配置FOR linux平台

Linux内核参数