一、创建用户、组
[root@localhost~]# groupadd oinstall
[root@localhost~]# groupadd dba
[root@localhost~]# useradd -g oinstall oracle
[root@localhost~]# usermod -G dba oracle
[root@localhost~]# id oracle
[root@localhost~]# passwd oracle
二、配置内核参数
1、[root@localhost~]#vi /etc/sysctl.conf
kernel.sem = 25032000 100128 ##修改,增加本行
kernel.shmall =2097152 ##满足,无需增加或修改
kernel.shmmax =536870912 ##满足,无需增加或修改
kernel.shmmni =4096 ##满足,无需增加或修改
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 =1048586 ##修改,增加本行
fs.aio-max-nr =1048576 ##修改,增加本行
2、修改后,使设置生效:
[root@localhost~]#/sbin/sysctl -p
3、执行生效命令后,再次检查确认参数设置:
[root@localhost~]#/sbin/sysctl -a
三、用户限制设置
1、在文件/etc/security/limits.conf中加入以下内容:
[root@localhost~]# vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
2、在/etc/pam.d/login中增加以下内容:
[root@localhost~]# vi /etc/pam.d/login
session required /lib/security/pam_limits.so //注意linux系统位数 64位时改为/lib64/security/pam_limits.so
session required pam_limits.so
3、在/etc/profile中加入以下内容:
[root@localhost~]#vi /etc/profile
if [ $USER ="oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
四、关闭SELINUX
[root@localhost~]#