ORA-12537: TNS:connection closed ORA-00020: maximum number of processes (2000) exceeded

ORA-12537: TNS:connection closed

ORA-00603: ORACLE server session terminated by fatal error

ORA-00020: maximum number of processes (2000) exceeded

1. Problem background

开发说连接数据库报错,监听程序已经关闭

image-20230921095309751

2. Solution

1. I checked the monitoring status according to the prompts and found that one of them was not up. After starting, I still couldn’t connect.

cd $ORACLE_HOME/network/admin/
lsnrctl start listener

启动后我连接了下数据库,不正常,能连接,但是show parameter name都报错,提示没有登

2. Check the alert log and find that a large number of ORA-00020 errors are reported.

cd $ORACLE_BASE/diag/rdbms/orcl/trace/

原来是连接数达到最大限制了,所以才连不上数据库

image-20230921095409707

3. Clean up session

#查看非本地连接进程
ps -ef|grep -v grep|grep LOCAL=NO |wc -l

#杀掉所有非本地连接进程
ps -ef|grep -v grep|grep LOCAL=NO |awk '{print $2}'|xargs kill -9

#查看哪个ip链接数最多
netstat -na|grep "ESTA"|awk '{print $5}'|awk -F ":" '{print $1}'|awk '{++S[$NF]} END {for (a in S) print a, S[a]}'

This depends on the actual situation. In my case, it was caused by application problems, so I had to kill the session. If the normal connection reaches the maximum limit, you can adjust the number of links according to the database configuration.

4. View process related parameters

#查看当前系统允许的进程连接数
show parameter process;

#查看系统允许的会话数
show parameter session;

#查看系统当前进程的连接数
select count(*) from v$process;

#查看系统当前会话的连接数
select count(*) from v$session; 

#查看当前系统活动的连接数
select count(*) from v$session where status='ACTIVE';

#修改process和session
alter system set processes=3000 scope=both;
alter system set sessions=3100 scope=both;

#重启生效
shutdown immediate;
startup;

Guess you like

Origin blog.csdn.net/m0_49562857/article/details/133127131