数据库启动后出现如下错误,文件打开过多
SQL> alter
database open;
alter database open
*
ERROR at line 1:
ORA-00313: open
failed for members of log group 2 of thread 1
ORA-00312: online
log 2 thread 1: '/db/oracle10g/oradata/benguo/redo02.log'
ORA-27041: unable
to open file
Linux-x86_64 Error:
23: Too many open files in system
Additional
information: 2
先对oracle用户环境的limits.conf做修改,将nofile soft和hard分别增加,但是还是报上述同样的错误。可能是system的文件数量过多了,而不仅仅只是oracle用户的限制。
[root@server119
security]# vi /etc/security/limits.conf
oracle soft
nproc 2047
oracle hard
nproc 16384
oracle soft
nofile 40960
oracle hard
nofile 655360
hadoop soft
nofile 4096
hadoop hard
nofile 65536
[root@server119
security]# vi /etc/sysctl.conf
# Kernel sysctl
configuration file for Red Hat Linux
#
# For binary
values, 0 is disabled, 1 is enabled. See
sysctl(8) and
# sysctl.conf(5)
for more details.
# Controls IP
packet forwarding
net.ipv4.ip_forward
= 0
# Controls source
route verification
net.ipv4.conf.default.rp_filter
= 1
# Do not accept
source routing
net.ipv4.conf.default.accept_source_route
= 0
# Controls the
System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether
core dumps will append the PID to the core filename
# Useful for
debugging multi-threaded applications
kernel.core_uses_pid
= 1
# Controls the use
of TCP syncookies
net.ipv4.tcp_syncookies
= 1
# Controls the
maximum size of a message, in bytes
kernel.msgmnb =
65536
# Controls the
default maxmimum size of a mesage queue
kernel.msgmax =
65536
# Controls the
maximum shared segment size, in bytes
kernel.shmmax =
68719476736
# Controls the
maximum number of shared memory segments, in pages
kernel.shmall
= 4294967296
kernel.shmmni
= 4096
kernel.sem
= 250 32000 100
128
fs.file-max =
655360
net.ipv4.ip_local_port_range
= 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144
"/etc/sysctl.conf"
44L, 1225C written
修改上述的fs.file-max=655360为1310720,适当增加这个参数。
[root@server119
security]# 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.shmmni
= 4096
kernel.sem
= 250 32000 100
128
fs.file-max =
1310720
net.ipv4.ip_local_port_range
= 1024 65000
net.core.rmem_default
= 262144
net.core.rmem_max =
262144
net.core.wmem_default
= 262144
net.core.wmem_max =
262144
而后可以正常打开数据库。
SQL> alter
database open;
Database altered.
[@more@]