Posted on 2011-05-18 11:46 
IceWee 阅读(886) 
评论(0)  编辑  收藏  所属分类: 
Database 
			 
			
		 
		
ORA-12516: TNS: 监听程序找不到符合协议堆栈要求的可用处理程
以前没有遇到过这个错误,一般常见的就是ORA-12514,这个错误是第一次遇到,我们是用SSH框架的,数据库链接由spring来管理,所以不担心连接不能及时释放的问题。但是现在数据库不只是我们做web的在使用,还有做通讯的同事,今天上午突然发现PL/SQL连不上数据库了,报的就是这个错误。
网上查找资料发现出现这个问题是由于Oracle的会话数不够导致的,使用命令“show parameter processes;”,返回
 
 NAME                                         TYPE          VALUE
NAME                                         TYPE          VALUE
 -----------------------------------     -------------    ------------
-----------------------------------     -------------    ------------
 aq_tm_processes                       integer          0
aq_tm_processes                       integer          0
 db_writer_processes                  integer           1
db_writer_processes                  integer           1
 gcs_server_processes                 integer          0
gcs_server_processes                 integer          0
 job_queue_processes                 integer          10
job_queue_processes                 integer          10
 log_archive_max_processes        integer          2
log_archive_max_processes        integer          2
 processes                                 integer           150
processes                                 integer           150 
可见当前最大连接数是150,于是我到数据库服务器使用DBA登陆,结果也登陆不上,报错ORA-12520,看来问题很严重啊!我查看了listener.log,发现有个IP创建了很多的链接,最终锁定问题原因,就是因为同事没有及时释放连接导致连接数不够。解决此法最好是程序上注意,使用后及时释放,如果你写的是循环,那就很危险了。也可以修改最大连接数,如果服务器能顶得住。