su: /bin/bash: Too many open files in system错误

切换到oracle的时候出错:
[root@test ~]# su - oracle
su: /bin/bash: Too many open files in system
[root@test ~]#


 


下面只说解决成功的过程
[root@test ~]# cat /proc/sys/fs/file-max
512
[root@test ~]#

发现文件限制数太少

查看/etc/sysctl.conf发现:

fs.file-max = 512 * PROCESSES

这个直接按照oracle的安装说明复制粘贴上去了,没有改动,修改为:

kernel.sem=1055 32000 100 128
kernel.shmmax=2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000


运行:
[root@test ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
kernel.sem = 1055 32000 100 128
kernel.shmmax = 2147483648
kernel.shmall = 2097152
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0
net.ipv4.conf.default.rp_filter = 0
net.core.optmem_max = 65535
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144
fs.file-max = 6553600
net.ipv4.ip_local_port_range = 1024 65000
[root@test ~]# cat /proc/sys/fs/file-max
6553600
[root@test ~]#


然后就可以切换过去了


还有一种方法,
echo "10240" >/proc/sys/fs/file-max
重启后就失效了。

 

你可能感兴趣的:(oracle,.net,bash)