设为首页 收藏本站
查看: 1257|回复: 0

[经验分享] OCM_Session7_5_修改/etc/security/limits.conf和 /etc/pam.d/login和/etc/profile

[复制链接]

尚未签到

发表于 2015-11-9 11:51:07 | 显示全部楼层 |阅读模式
五、修改/etc/security/limits.conf和 /etc/pam.d/login和/etc/profile 这个在OCM环境已经配置好。
参考官方文档:http://docs.oracle.com/cd/B19306_01/install.102/b14203/prelinux.htm
To increase the shell limits:

  • Add the following lines to the /etc/security/limits.conf file:
    oracle              soft    nproc   2047 oracle               hard    nproc   16384 oracle               soft    nofile  1024 oracle               hard    nofile  65536
  • Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:
    session    required     /lib/security/pam_limits.so
  • Depending on the oracle user's default shell, make the following changes to the default shell startup file:

    • For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the fileon SUSE systems)/etc/profile.local:
      if [ $USER = "oracle" ]; then         if [ $SHELL = "/bin/ksh" ]; then               ulimit -p 16384               ulimit -n 65536         else               ulimit -u 16384 -n 65536         fi fi
    • For the C shell (csh or tcsh), add the following lines to the /etc/csh.login file (or the file on SUSE systems)/etc/csh.login.local:
      if ( $USER == "oracle" ) then         limit maxproc 16384         limit descriptors 65536 endif

  • Repeat this procedure on all other nodes in the cluster.




------------------------------------------------------------------------------------------------------------------------------------------------------------------------我的修改如下:
rac1节点
[iyunv@rac1 ~]# cp  /etc/security/limits.conf  /etc/security/limits.conf.bak[iyunv@rac1 ~]# vi  /etc/security/limits.conf# /etc/security/limits.conf##Each line describes a limit for a user in the form:##<domain>        <type>  <item>  <value>##Where:#<domain> can be:#        - an user name#        - a group name, with @group syntax#        - the wildcard *, for default entry#        - the wildcard %, can be also used with %group syntax,#                 for maxlogin limit##<type> can have the two values:#        - &quot;soft&quot; for enforcing the soft limits#        - &quot;hard&quot; for enforcing hard limits##<item> can be one of the following:#        - core - limits the core file size (KB)#        - data - max data size (KB)#        - fsize - maximum filesize (KB)#        - memlock - max locked-in-memory address space (KB)#        - nofile - max number of open files#        - rss - max resident set size (KB)#        - stack - max stack size (KB)#        - cpu - max CPU time (MIN)#        - nproc - max number of processes#        - as - address space limit#        - maxlogins - max number of logins for this user#        - maxsyslogins - max number of logins on the system#        - priority - the priority to run user process with#        - locks - max number of file locks the user can hold#        - sigpending - max number of pending signals#        - msgqueue - max memory used by POSIX message queues (bytes)#        - nice - max nice priority allowed to raise to#        - rtprio - max realtime priority##<domain>      <type>  <item>         <value>#
#*               soft    core            0#*               hard    rss             10000#@student        hard    nproc           20#@faculty        soft    nproc           20#@faculty        hard    nproc           50#ftp             hard    nproc           0#@student        -       maxlogins       4
oracle              soft    nproc   2047oracle               hard    nproc   16384oracle               soft    nofile  1024oracle               hard    nofile  65536&quot;/etc/security/limits.conf&quot; 58L, 1975C written[iyunv@rac1 ~]#  cp /etc/pam.d/login /etc/pam.d/login.bak[iyunv@rac1 ~]# vi /etc/pam.d/login#%PAM-1.0auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.soauth       include      system-authaccount    required     pam_nologin.soaccount    include      system-authpassword   include      system-auth# pam_selinux.so close should be the first session rulesession    required     pam_selinux.so closesession    optional     pam_keyinit.so force revokesession    required     pam_loginuid.sosession    include      system-authsession    optional     pam_console.so# pam_selinux.so open should only be followed by sessions to be executed in the user contextsession    required     pam_selinux.so opensession    required     /lib/security/pam_limits.so~~~~~~~&quot;/etc/pam.d/login&quot; 15L, 695C written[iyunv@rac1 ~]#
[iyunv@rac1 ~]#  cp /etc/profile /etc/profile.bak[iyunv@rac1 ~]# vi /etc/profile# /etc/profile
# System wide environment and startup programs, for login setup# Functions and aliases go in /etc/bashrc
pathmunge () {        if ! echo $PATH | /bin/egrep -q &quot;(^|:)$1($|:)&quot; ; then           if [ &quot;$2&quot; = &quot;after&quot; ] ; then              PATH=$PATH:$1           else              PATH=$1:$PATH           fi        fi}
# ksh workaroundif [ -z &quot;$EUID&quot; -a -x /usr/bin/id ]; then        EUID=`id -u`        UID=`id -ru`fi
# Path manipulationif [ &quot;$EUID&quot; = &quot;0&quot; ]; then        pathmunge /sbin        pathmunge /usr/sbin        pathmunge /usr/local/sbinfi
# No core files by defaultulimit -S -c 0 > /dev/null 2>&1
if [ -x /usr/bin/id ]; then        USER=&quot;`id -un`&quot;        LOGNAME=$USER        MAIL=&quot;/var/spool/mail/$USER&quot;fi
HOSTNAME=`/bin/hostname`HISTSIZE=1000
if [ -z &quot;$INPUTRC&quot; -a ! -f &quot;$HOME/.inputrc&quot; ]; then    INPUTRC=/etc/inputrcfi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do    if [ -r &quot;$i&quot; ]; then        if [ &quot;$PS1&quot; ]; then            . $i        else            . $i >/dev/null 2>&1        fi    fidone
unset iunset pathmunge
if [ $USER = &quot;oracle&quot; ]; then        if [ $SHELL = &quot;/bin/ksh&quot; ]; then              ulimit -p 16384              ulimit -n 65536        else              ulimit -u 16384 -n 65536        fifi&quot;/etc/profile&quot; 74L, 1234C written[iyunv@rac1 ~]
---------------------------------------------------------------------------------------------------------------------rac2节点:
[iyunv@rac2 ~]# cp  /etc/security/limits.conf  /etc/security/limits.conf.bak[iyunv@rac2 ~]#  vi  /etc/security/limits.conf # /etc/security/limits.conf##Each line describes a limit for a user in the form:##<domain>        <type>  <item>  <value>##Where:#<domain> can be:#        - an user name#        - a group name, with @group syntax#        - the wildcard *, for default entry#        - the wildcard %, can be also used with %group syntax,#                 for maxlogin limit##<type> can have the two values:#        - &quot;soft&quot; for enforcing the soft limits#        - &quot;hard&quot; for enforcing hard limits##<item> can be one of the following:#        - core - limits the core file size (KB)#        - data - max data size (KB)#        - fsize - maximum filesize (KB)#        - memlock - max locked-in-memory address space (KB)#        - nofile - max number of open files#        - rss - max resident set size (KB)#        - stack - max stack size (KB)#        - cpu - max CPU time (MIN)#        - nproc - max number of processes#        - as - address space limit#        - maxlogins - max number of logins for this user#        - maxsyslogins - max number of logins on the system#        - priority - the priority to run user process with#        - locks - max number of file locks the user can hold#        - sigpending - max number of pending signals#        - msgqueue - max memory used by POSIX message queues (bytes)#        - nice - max nice priority allowed to raise to#        - rtprio - max realtime priority##<domain>      <type>  <item>         <value>#
#*               soft    core            0#*               hard    rss             10000#@student        hard    nproc           20#@faculty        soft    nproc           20#@faculty        hard    nproc           50#ftp             hard    nproc           0#@student        -       maxlogins       4
oracle              soft    nproc   2047oracle               hard    nproc   16384oracle               soft    nofile  1024oracle               hard    nofile  65536&quot;/etc/security/limits.conf&quot; 58L, 1975C written[iyunv@rac2 ~]#  cp /etc/pam.d/login /etc/pam.d/login.bak[iyunv@rac2 ~]# vi /etc/pam.d/login#%PAM-1.0auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.soauth       include      system-authaccount    required     pam_nologin.soaccount    include      system-authpassword   include      system-auth# pam_selinux.so close should be the first session rulesession    required     pam_selinux.so closesession    optional     pam_keyinit.so force revokesession    required     pam_loginuid.sosession    include      system-authsession    optional     pam_console.so# pam_selinux.so open should only be followed by sessions to be executed in the user contextsession    required     pam_selinux.so opensession    required     /lib/security/pam_limits.so~~~~~~~&quot;/etc/pam.d/login&quot; 15L, 695C written[iyunv@rac2 ~]#
[iyunv@rac2 ~]# cp /etc/profile /etc/profile.bak[iyunv@rac2 ~]# vi /etc/profile# /etc/profile
# System wide environment and startup programs, for login setup# Functions and aliases go in /etc/bashrc
pathmunge () {        if ! echo $PATH | /bin/egrep -q &quot;(^|:)$1($|:)&quot; ; then           if [ &quot;$2&quot; = &quot;after&quot; ] ; then              PATH=$PATH:$1           else              PATH=$1:$PATH           fi        fi}
# ksh workaroundif [ -z &quot;$EUID&quot; -a -x /usr/bin/id ]; then        EUID=`id -u`        UID=`id -ru`fi
# Path manipulationif [ &quot;$EUID&quot; = &quot;0&quot; ]; then        pathmunge /sbin        pathmunge /usr/sbin        pathmunge /usr/local/sbinfi
# No core files by defaultulimit -S -c 0 > /dev/null 2>&1
if [ -x /usr/bin/id ]; then        USER=&quot;`id -un`&quot;        LOGNAME=$USER        MAIL=&quot;/var/spool/mail/$USER&quot;fi
HOSTNAME=`/bin/hostname`HISTSIZE=1000
if [ -z &quot;$INPUTRC&quot; -a ! -f &quot;$HOME/.inputrc&quot; ]; then    INPUTRC=/etc/inputrcfi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
for i in /etc/profile.d/*.sh ; do    if [ -r &quot;$i&quot; ]; then        if [ &quot;$PS1&quot; ]; then            . $i        else            . $i >/dev/null 2>&1        fi    fidone
unset iunset pathmunge
if [ $USER = &quot;oracle&quot; ]; then
        if [ $SHELL = &quot;/bin/ksh&quot; ]; then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi
fi&quot;/etc/profile&quot; 74L, 1234C written[iyunv@rac2 ~]#
----------------------------------------------------------------------------------------------------------------------------------------------
         版权声明:本文为博主原创文章,未经博主允许不得转载。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-136992-1-1.html 上篇帖子: ORA-04063: ORA-04063: package body "ORACLE_OCM.MGMT_DB_LL_METRICS" has errors 下篇帖子: OCM 11g升级考试第二场搭建DataGuard遇到: prod
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表