设为首页 收藏本站
查看: 508|回复: 0

[经验分享] oracle数据库连接hang,出现了两个listener

[复制链接]

尚未签到

发表于 2016-7-28 04:28:23 | 显示全部楼层 |阅读模式
oracle数据库连接hang,出现了两个listener,一个是另一个子进程
处理过程如下
1,出现问题时,用户连接hang住,出现两个listener,现有连接无问题
$ ps -ef|grep lsnr
oracle 26327 1 0 12月 24 ? 5:34 /oracle/product/10.2.0.1/bin/tnslsnr LISTENER -inherit
oracle 16352 12931 1 10:44:26 pts/4 0:00 grep lsnr
oracle 28413 26327 0 21:40:46 ? 0:00 /oracle/product/10.2.0.1/bin/tnslsnr LISTENER -inherit
patrol 29576 29575 0 21:45:19 ? 0:00 /oracle/product/10.2.0.1/bin/lsnrctl stat LISTENER

2,为快速恢复问题,杀掉进程
$ kill -9 26327

3,重启
$ lsnrctl start

LSNRCTL for HPUX: Version 10.2.0.1.0 - Production on 26-DEC-2012 10:44:54

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Starting /oracle/product/10.2.0.1/bin/tnslsnr: please wait...

TNSLSNR for HPUX: Version 10.2.0.1.0 - Production
System parameter file is /oracle/product/10.2.0.1/network/admin/listener.ora
Log messages written to /oracle/product/10.2.0.1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rps02)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rps02)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for HPUX: Version 10.2.0.1.0 - Production
Start Date 26-DEC-2012 10:44:56
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP ON
Listener Parameter File /oracle/product/10.2.0.1/network/admin/listener.ora
Listener Log File /oracle/product/10.2.0.1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rps02)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

4,恢复正常,只有一个listener
$
$ ps -ef|grep lsnr
oracle 16503 1 0 10:44:56 ? 0:00 /oracle/product/10.2.0.1/bin/tnslsnr LISTENER -inherit
oracle 17637 12931 1 10:48:17 pts/4 0:00 grep lsnr
$

5,后续查询metalink,基本确定为bug,需打oracle Patch 4518443
详见文件Intermittent TNS Listener Hang, New Child Listener Process Forked [ID 340091.1]
除了打补丁,oracle给出的其它解决方案是
a,修改listener.ora文件
SUBSCRIBE_FOR_NODE_DOWN_EVENT_<listener_name>=OFF
b,移动ons.config文件
cd $ORACLE_HOME/opmn/conf
mv ons.config ons.config.ori
6,更详细的原因见参考metalink文档
In this Document
Description
Occurrence
Symptoms
Workaround
Patches
History
References

Applies to:
Oracle Net Services - Version 10.1.0.3.0 to 10.2.0.2.0 [Release 10.1 to 10.2]
Information in this document applies to any platform.
All new connections via TNS listener hang, no errors reported

Checked for relevance on 05-FEB-2010.
***Checked for relevance on 27-nov-2012***


Description

Intermittently the TNS listener hangs and new connections to the database are not possible.



Occurrence

The issue is that the TNS listener can hang under load if a second spawned listener process is not closed (remains persistent). Secondary listener processes are not unusual, depending on traffic as well as when the OS grep snapshot is taken. However, a persistentsecondary process (longer than say 5 second) is not normal and may be a result of this referenced problem.

TNS listener can hang at any time and effect standalone or RAC systems
Symptoms

Listener process can also consume high amount of CPU

Child TNS listener process is seen when doing a ps on the listener process, eg.:
$ ps -ef | grep tnslsnr

ora10g 8909 1 0 Sep 15 ? 902:44 /u05/10GHOME/DBHOME/bin/tnslsnr sales -inherit
ora10g 22685 8909 0 14:19:23 ? 0:00 /u05/10GHOME/DBHOME/bin/tnslsnr sales -inherit

Killing the child process allows new connections to work until the problem reoccurs




Workaround


Issue is fixed in 10.2.0.3 Patch Set
Oracle Support recommends patching to 10.2.0.5 as this the lastest release

- OR -

Apply Patch 4518443 for the problem (if a patch is available)

- OR -

As a workaround, two steps should be done:

1. The following parameter can be added to listener.ora
SUBSCRIBE_FOR_NODE_DOWN_EVENT_<listener_name>=OFF

Where <listener_name> should be replaced with the actual listener name configured in the LISTENER.ORA file. This parameter is to be placed by itself on an empty line / at the end of file.

For example, if the listener name is LISTENER (default), the parameter would be:
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF


2. Locate the ons.config file in the 10g(rdbms) home and rename it to something else.
For example:
cd $ORACLE_HOME/opmn/conf
mv ons.config ons.config.orig

The listener needs to be restarted after these changes.

This will both prevent the listener from registering against ONS (Oracle Notification Services), which is the area affected by bug:4518443, as well as disable ONS itself. For more information on ONS, please refer to the specific Oracle documentation, for example,for 10.2, see the Oracle10g Release 2 Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide.

Please note, that adding the SUBSCRIBE_FOR_NODE_DOWN_EVENT_<listener_name> to listener.ora file on RAC and disabling the ONS file, will mean that FAN (fast application notification) will not be possible. See Note 220970.1 RAC: Frequently Asked Questions forfurther information on FAN. Therefore, if you have a RAC configuration, then apply the patch and do not disable ONS or FAN.

Also, please note that this might happen with ANY 10g installation, whether it is RAC related or not, and whether there is an Oracle Application installation or not.



Patches

Apply Patch 4518443 for the problem (if a patch is available)

参考文档:
《Intermittent TNS Listener Hang, New Child Listener Process Forked [ID 340091.1]》

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-250269-1-1.html 上篇帖子: Oracle开发人员应该具备的几个资源-入门基础 下篇帖子: Asp.Net & Oracle 编程一步一步从入门到精通(图解)随笔系列 --- 目录
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表