博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
RHEL5中安装Oracle11gR2修改用户SHELL限制、环境配置、内核参数
阅读量:7058 次
发布时间:2019-06-28

本文共 4276 字,大约阅读时间需要 14 分钟。

修改用户的SHELL的限制

[root@localhost ~]# 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:
#        - "soft" for enforcing the soft limits
#        - "hard" 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
# End of file

<domain>      <type>  <item>         <value>

oracle          soft    nproc           2047
oracle          hard    nproc           16384
oracle          soft    nofile          1024
oracle          hard    nofile          65536

修改过程:按i键进入insert状态,编辑完成后esc退出,然后按:输入wq保存并退出。

同样的如下进行操作:

编辑login文件:[root@localhost ~]# vi /etc/pam.d/login

session    required     /lib/security/pam_limits.so

修改profile文件:[root@localhost ~]# vi /etc/profile

        if[$user="oracle"];then

        if[$user="/bin/ksh"];then
        ulimit -p 16384
        ulimit -n 65535
        else
        ulimit -u 16384 -n 65535
        fi
        fi

修改内核参数

[root@localhost ~]# vi /etc/sysctl.conf

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
net.ipv4.ip_local_port_range = 9000 65500
fs.aio-max-nr = 1048576
fs.file-max = 6815744
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

可以是内核参数马上生效:
[root@localhost /]# /sbin/sysctl -p

查看内核参数的值:[root@localhost ~]# /sbin/sysctl -a |grep kernel.shmmax

kernel.shmmax = 536870912
 

修改用户的环境配置

以oracle身份登录:

[root@localhost ~]# cd /
[root@localhost /]# su - oracle

[oracle@localhost ~]$

此时变成了美元$哦。

查看当前目录是否在操作系统用户oracle的主目录:

[oracle@localhost ~]$ pwd
/home/oracle

找到环境配置文件.bash.profile:

[oracle@localhost ~]$ ls -a

.   .bash_history  .bash_profile  .emacs    .viminfo
..  .bash_logout   .bashrc        .mozilla
修改环境配置文件:[oracle@localhost ~]$ vi .bash_profile

export ORACLE_bASE=/myoracle/app //设置oracle根目录
export ORACLE_HOME=/myoracle/app/product/11.2.0/db_1//设置oracle主目录
export ORACLE_SID=dbalala//实例名
export umask=022
export PATH=$PATH:$ORACLE_HOME/bin//命令的搜索路径
可以查看环境变量:[oracle@localhost ~]$ env
HOSTNAME=localhost.localdomain
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
USER=oracle
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
MAIL=/var/spool/mail/oracle
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
INPUTRC=/etc/inputrc
PWD=/home/oracle
LANG=zh_CN.UTF-8
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/home/oracle
LOGNAME=oracle
CVS_RSH=ssh
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY=:0.0
G_BROKEN_FILENAMES=1
_=/bin/env

这回着实遇到了很多的问题:

1、先是修改limits文件的时候,因为我本人的愚钝,一直导致所有的文件都修改好了,我却还是一直是语法错误。后来,limits文件是书上表述的不够明晰,我自己又看了下别人的文档,重新尝试后行了。但是在这尝试之前我又修改了内核参数的配置文件sysctl.conf。

2、在修改profile文件的时候,一直包错.profile.swap存在,而我一直不懂得这些原理来自何方。在经过多方求证后,山掉了此处的swap文件才得以顺利进行。

至此,终于准备好了操作系统。

 

转载地址:http://scrol.baihongyu.com/

你可能感兴趣的文章
sql server 2005 外围应用配置器
查看>>
[MODx] 9. Real Example
查看>>
健康饮食
查看>>
Visual Studio 2015年预览设置: 辅助安装程序说明
查看>>
(转)在NGUI使用图片文字(数字、美术字)(直接可用于UILable)
查看>>
javascript动态创建script标签,加载完成后调用回调
查看>>
Linq 实现两个对象实例List之间的赋值
查看>>
B&#233;zier curve
查看>>
七天学会ASP.NET MVC (一)——深入理解ASP.NET MVC
查看>>
中国目前拥有的物种和人造卫星的作用
查看>>
7 Tools for Data Visualization in R, Python, and Julia
查看>>
【转】ubuntu apt-get update 失败解决
查看>>
ubuntu12.04 安装CS:APP Y86模拟器
查看>>
[LeetCode] Majority Element II 求众数之二
查看>>
android如何在代码中设置margin
查看>>
spring 定义自己的标签 学习
查看>>
hdu2899 Strange fuction
查看>>
【C/C++】快速排序的两种实现思路
查看>>
T-SQL:毕业生出门需知系列(五)
查看>>
教程-Delphi操作快捷键
查看>>