ORA-12518 TNS:监听程序无法分发客户机连接 解决办法

ORA-12518: TNS:listener could not hand off client connection
2008-06-23 08:57

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.

先试试 connect / as sysdba,看行不行,如果行的话,
再试试connect / @ as sysdba看看监听配置是否有问题。
如果这一步有问题,说明监听这块有问题。

1.cmd
2.sqlpls /nolog
3.connect sys/test as sysdba
没有问题
1.cmd
2.sqlplus /nolog
3.connect sys/test@test as sysdba
ORA-12518: TNS:listener could not hand off client connection
说明监听有问题

查到了相关资料如下:
http://www.dba-oracle.com/sf_ora_12518_tns_listener_could_not_hand_off_client_connection.htm

The reason ORA-12518 is being throw may be because of DEDICATED connections because Oracle 10g has a value of PROCESSES is defaulted at 150 which can be lower than necessary in a production system. Also, in pre-9i MTS, ORA-12518 may be thrown in SHARED SERVER because the dispatcher may have reached the maximum connection value, so it denies all other.

There are two solutions for ORA-12518 depending on which symptom you may be experiencing.
a.For the DEDICATED occurrence of ORA-12518, you would need to try increasing the PROCESSES parameter so that it can handle the needed number of processes. You can ensure that you have the needed value by monitoring the listener log for ORA-12518. Also, note that because the PROCESSES parameter is static, the database will need to be bounced.
b.If you are experiencing ORA-12518 because of a shared server issue, you first would need to use the command below to shutdown the dispatcher:
SQL> alter system shutdown immediate 'D001';
Then, add on new dispatchers:
SQL> alter system set DISPATCHERS = '(protocol=tcp)(dispatchers=3)';

通过以上资料分析得出可能出现问题的原因有两种:一是processes值设的过小,二是需要增加参数DISPATCHERS。

考虑到之前经常遇到ora-00020超出最大进程数的问题在安装数据库的时候已经把processes设到800了,为保险起见再show parameter processes

SQL> show parameter process;

NAME                                 TYPE        VALUE
------------------------------------ ----------- -----
aq_tm_processes                      integer     0
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
job_queue_processes                  integer     10
log_archive_max_processes            integer     2
processes                            integer     1000

再查进程数

SQL> select count(*) from v$session;

  COUNT(*)
----------
       224

所以最后得出结论应该不是processes的问题,应该用b方法来解决
1.connect sys/test as sysdba
2.show parameters dispatchers;
NAME                TYPE             VALUE
dispatchers         string           (protocol=tcp)(service=oracle10xdb)
max_dispatchers      integer  
5.SQL>alter system set dispatchers = '(protocol=tcp)(dispatchers=3)(service=oracle10xdb)';
system altered
问题解决。
当然根据实际情况你也可以用a方法解决,

可以用show parameters processes;

命令查看processes的值,数据库在安装时默认为150,对于大型应用,32位的oracle一定要注意这个问题

ORA-12518错误意味着监听程序无法处理客户机连接请求。这个错误通常在数据库服务器上出现,表示数据库监听程序已达到其最大连接限制。 常见的原因是服务器资源不足,例如CPU或内存不足以处理所有连接请求。此外,网络延迟或故障也可能导致该错误。 解决这个问题的方法包括: 1. 增加监听程序的最大连接数:可以通过修改监听程序的配置文件(通常是listener.ora)来增加最大连接数。找到类似“max_connections”的参数并适当增加该值。 2. 增加服务器资源:通过增加服务器的CPU、内存等资源,可以提高服务器的处理能力,从而处理更多的连接请求。 3. 检查网络连接:查看网络连接是否稳定,并确保没有存在网络故障。可以尝试使用网络诊断工具,如ping命令,来检测网络延迟和丢包情况。 4. 优化数据库配置:通过优化数据库的配置参数,如连接池大小或连接超时时间,可以更有效地利用数据库资源,从而减少连接的负担。 5. 分析并限制不必要的连接:检查数据库的连接情况,排查是否有不必要的连接存在。可以通过查询数据库的v$session视图来获取连接信息,并关闭不需要的会话。 需要注意的是,解决ORA-12518错误可能需要一些系统维护和数据库管理的知识。如果没有相关的经验,建议寻求专业人士的帮助来解决这个问题,以防止对系统造成不良影响。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值