天萃荷净
用户现场有一套Oracle 11G数据库,专用和共享模式两套,应用为浪潮财务系统,产品结构为C/S,操作系统为Redhat
客户端连接数据库服务器报错:
ORA-12518: TNS:listener could not hand off client connection
Oracle研究中心分析原因为客户端增多,原有数据库设置不够,导致连接出现:无法分发客户端连接的异常。
查到官方相关资料如下:
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)';
解决方案:
第一步:调整process和session值
1. 检查process和session是否够用。
a)使用plsql连接到oracle,查看process进程数:
select count(*) from v$process; --取得数据库目前的进程数。
select value from v$parameter where name = 'processes'; --取得进程数的上限。
b)查看session会话数:
select count(*) from v$session; --取得数据库目前的会话数。
select value from v$parameter where name = 'sessions'; --取得会话数的上限。
查看当前process和sessions是否接近上限值。若接近,可以将其增大。
2. 调整这两个参数值大小。
系统进程数process和系统会话数session之间存在一个关系:
process数=session数*1.1+5
我们在配置时参考该规律进行设定。
a) 修改process值
alter system set processes=1000 scope=spfile; --将process值改为1000
b) 修改session值
alter system set sessions=1105 scope=spfile; --将sessions值改为1105
3. 备份pfile,重启oracle
a) 修改完成后,备份pfile
create pfile from spfile; --从spfile(运行时配置)创建pfile(系统配置)
c) 重启oracle
重启的方法有很多种,可以重启oracle服务,或者重启数据库。Windows下可以直接重启服务。
第二步:修改dispatchers个数
如果第一步解决不了问题。可以进行第二步的操作。
查看当前dispatchers个数,和dispatchers使用率
select name,busy,status,accept,idle from v$dispatcher; --查看当前dispatchers个数和部分信息。一般默认安装的库只有一个。
select name,(busy/(busy+idle))*100 "busy rate%" from v$dispatcher; --查看dispatchers使用率
如果使用率大于50%,则要考虑增加dispatchers个数。
调整dispatchers个数
alter system set dispatchers='(protocol=tcp)(dispatchers=3)(service=youroracleservicenameXDB)';
--修改dispatchers个数为3.
3. 重启oracle。
-----------------温馨提示--------------------
操作有风险,动手需谨慎
Oracle研究中心
www.oracleplus.net
本文由Oracle研究中心分享,转载请尽量保留本站网址。
--------------------------------------ORACLE-DBA----------------------------------------
最权威、专业的Oracle案例资源汇总之C/S结构案例分析 ORA-12518: TNS:listener could not hand off c