在linux上安装oracle时的limit设定

oracle 10g database在linux安装时,设定oracle用户limit时:为何在pam模组里面添加了limit限制然后又要在login shell里面修改呢,这样相互的设定会被影响。经过测试login shell的设定会覆盖pam模组的设定


以下是询问oracle support的结果

 The simple way to adjust resource limits is to set the same hard/soft limit only in /etc/security/limits.conf and ignore /etc/profile; This is the recommended way, used by oracle-validated as well. 

In some notes, ie Note 419646.1 and Note 421308.1 ,there is another procedure to set resource limits for the user "oracle". 
Normally, when a user logs in, /etc/security/limits.conf is first loaded by the PAM module pam_limits, and then login shell does the initialization from /etc/profile . 
In the notes, first set the different soft/hard values for the oracle user, in /etc/security/limits.conf: 
# cat /etc/security/limits.conf 
... 
oracle soft nproc 2047 
oracle hard nproc 16384 
oracle soft nofile 1024 
oracle hard nofile 65536 

Once you set the hard limits in this example, the maximum open files are 65536, and the maximum user processes are 16384, you can not increase the hard limit threshold value any more from /etc/profile. But, you may raise soft limit to the maximum value(hard) in /etc/profile: 
# cat /etc/profile 
... 
if [ $USER = "oracle" ]; then 
ulimit -u 16384 
ulimit -n 65536 
fi 

In this case, the soft & hard limits are the same finally. 

You need notice two points if setting different soft/hard limit: 
1. If you have set different soft/hard values in /etc/security/limits.conf and /etc/profile, upon the oracle user login, the user's initial nofile/nproc limit value in the /etc/security/limits.conf, is overrwritten by the /etc/profile script. 
2. /etc/profile is only invoked for the login shell. For any non-login shell, the setting in /etc/profile, are skipped. 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值