Monday, December 14, 2009

Listener-Broken pipe

I have successfully install Oracle on Linux, installed and configured my all Java and PHP application for a content Server and a SMS Gateway and everything is working fine. After several months later from an angry user saying that he cannot login to the application and the SMS getaway not working.

The error message indicates a problem connecting to the Oracle database. After some troubleshooting (lsntctl status) I have found the Oracle TNS listener is not running, I attempt to start it and get the following stack trace error:
[oracle@contentserver admin]$ lsnrctl start

LSNRCTL for Linux: Version 9.2.0.1.0 - Production on 14-DEC-2009 08:44:43

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Starting /u01/app/oracle/product/9.2.0.1.0/bin/tnslsnr: please wait...

TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
  TNS-00517: Lost contact
   Linux Error: 32: Broken pipe

Then I have check with the SYS admin to only find out that nothing has changed with any of the network settings. Every this is ok.

This is one of those troubleshooting issues that can take several hours to track done. But as it turns out, the most common reason for this stack trace when attempting to start the listener is the log file for the listener ($ORACLE_HOME/network/log/listener.log) has reached its 2GB file size limit on Linux. To alleviate the problem, simply archive or delete the file and restart the listener.

How to solve this problem:


Switch to the network log directory
[oracle@contentserver log]$ cd /u01/app/oracle/product/9.2.0.1.0/network/log

See the size of the listener.log, here I have found 2.1 GB
[oracle@contentserver log]$ du -h listener.log
2.1G    listener.log

Copy the log file to the other directory if you need to backup this file for any kind of troubleshooting task.
[oracle@contentserver log]$ cp listener.log /home/oracle/

Then remove the file using OS command, to do this issue the following command.
[oracle@contentserver log]$ rm listener.log

Now start the listener service.
[oracle@contentserver log]$ lsnrctl start

2 comments:

  1. Thank you very much for posting this fix. You have created very good karma!

    ReplyDelete