参考文章:
https://blog.csdn.net/study_gis/article/details/79103951
https://blog.csdn.net/qq_38161040/article/details/118798430
ora-12518:tns listener could not hand off client connection:tns侦听器无法切换客户端连接
原因:
访问量大,数据库无法分发连接数
初级解决方法:
1.利用管理员身份登录数据库,
如无法登录,ora-00020: maximum number of processes (XXX) exceeded(超过了最大进程数(XXX))
需要释放数据库连接进程,或者排队尝试登录
2.查看process、session数据库默认连接和已使用连接
3.如果连接数量接近设置数量则增加连接数
4.重启数据库生效
5.持续监测process、session,观察更改后的变化
--sql命令如下
--登录
sqlplus / as sysdba
--查看最大进程数
show parameter processes;
--查看最大线程数
show parameter sessions;
--统计进程使用量
select count(*) from v$process;
--统计线程使用量
select count(*) from v$session;
--更改进程最大数为1000
alter system set processes=1000 scope=spfile;
--更改线程最大数1500
alter system set sessions=1500 scope=spfile;
--立即关闭数据库
shutdown immediate;
--启动数据库
startup;
ORA-00020: maximum number of processes (string) exceeded
Cause: All process state objects are in use.
Action: Increase the value of the PROCESSES initialization parameter.
ORA-00020:超过最大进程数(字符串)
原因:所有进程状态对象都在使用中。
措施:增加PROCESSES初始化参数的值。
ORA-12518: TNS:listener could not hand off client connection
Cause: The process of handing off a client connection to another process failed.
Action: Turn on listener tracing and re-execute the operation. Verify that the listener and database instance are properly configured for direct handoff. If problem persists, call Oracle Support.
ORA-12158:TNS:侦听器无法切换客户端连接
原因:将客户端连接切换到另一个进程的过程失败。
操作:打开侦听器跟踪并重新执行操作。验证侦听器和数据库实例是否已正确配置为直接切换。如果问题仍然存在,请致电Oracle支持部门。