ORACLE之RAC搭建过程8-设置内核参数和资源限制

ORACLE之RAC搭建过程8-设置内核参数和资源限制

1、设置内核参数

在集群中的两个 Oracle RAC 节点上执行以下配置过程。
要检查已拥有的内存容量,键入以下命令:

[root@rac1 ~]# cat /proc/meminfo | grep MemTotal

要检查已分配的交换容量,键入以下命令:

[root@rac1 ~]# cat /proc/meminfo | grep SwapTotal

本节中出现的内核参数只是用于 Oracle 文档的建议值。
对于生产数据库系统,Oracle 建议您对这些值进行调整,以优化系统性能。
在两个 Oracle RAC 节点上,验证本节所述的内核参数的设置值大于或等于推荐值。

[root@rac1 ~]# cat >> /etc/sysctl.conf <<EOF
#add for oracle
kernel.shmmax = 4294967295
kernel.shmall = 268435456
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
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
fs.aio-max-nr = 1048576
EOF

要在当前运行的系统中激活新的内核参数值,在集群中的两个 Oracle RAC 节点上,以 root 用户身份运行以下命令:

[root@rac1 ~]# sysctl -p

通过在集群中的两个 Oracle RAC 节点上运行以下命令来验证新的内核参数值:

[root@rac1 ~]# /sbin/sysctl -a | grep shm
[root@rac1 ~]# /sbin/sysctl -a | grep 'core\.[rw]mem'
[root@rac1 ~]# /sbin/sysctl -a | grep sem
[root@rac1 ~]# /sbin/sysctl -a | grep file-max
[root@rac1 ~]# /sbin/sysctl -a | grep ip_local_port_range

2、设置用户oracle和grid的资源限制

要改善 Linux 系统上的软件性能,必须对 Oracle 软件所有者用户(grid、oracle)增加以下资源限制:
• 打开文件描述符的最大数 nofile
• 可用于单个用户的最大进程数 nproc
• 进程堆栈段的最大大小 stack

在每个 Oracle RAC 节点上,以 root 用户身份运行以下命令:

[root@rac1 ~]# cat >> /etc/security/limits.conf <<EOF
# add for oracle and grid
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240
grid hard stack 32768
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
EOF

查看设定值

[root@rac1 ~]# tail -n 15 /etc/security/limits.conf

在每个 Oracle RAC 节点上,在 /etc/pam.d/login 文件中添加或编辑下面一行内容(如果不存在此行):

[root@rac1 ~]# cat >> /etc/pam.d/login <<EOF
session required pam_limits.so
EOF

以oracle或grid用户登录,检查设定的值:

1)nproc:Check the soft and hard limits for the number of processes available to a user.

$ ulimit -Su
$ ulimit -Hu

2)nofile:Check the soft and hard limits for the file descriptor setting.

$ ulimit -Sn
$ ulimit -Hn

3)stack:Check the soft limit for the stack setting.

$ ulimit -Ss
$ ulimit -Hs

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值