Listener hang issue

Listener fails to process any new connections for some reason multiple listeners start up listening on the same port and running for the same service, this new listener is started by already running listener process which can be checked by looking at the parent process id of the new listener. This issue so far we have seen on and

$ ps -ef | grep tnslsnr

oracle 8909 1 0 Sep 15 ? 902:44 /u01/oracle/db_1/bin/tnslsnr LISTENER
# the parent process id (bold) in the line below is the listener’s process id that started it
oracle 22685 8909 0 14:19:23 ? 0:00 /u01/oracle/db_1/bin/tnslsnr LISTENER

To fix this issue add the following parameter to listener.ora:


How to password protect your listener?

To avoid inadvertent stopping of your listener or to prevent unauthorized access to your listener, you may set up password protection for your listener.

If you forget the password, do the worst.
– hard kill the listener process from the OS
– modify the listener.ora file by taking out the “PASSWORDS_LISTENER” parameter.
– Restart the listener
– Proceed with one of the following methods

1. Cleartext Password
– Add PASSWORDS_<your_listener_name> entry to your existing listener.ora file. e.g. PASSWORDS_listener1 = (p1,p2)
– Stop your listener, and restart it.
Now passwords are in effect.

To stop the listener, set password command must be used.
e.g. lsnrctl
LSNRCTL> set current_listener listener1
LSNRCTL> set password p1

2. Encrypted Password
– Comment out PASSWORD_ line if cleartext password is set.
– Restart listener.
– Run lsnrctl
LSNRCTL> set current_listener <your_listener_name>
LSNRCTL> set save_config_on_stop on
LSNRCTL> change_password
Old password: <enter>
New password: <enter_your_password>
Reenter new password: <reenter_your_password>

LSNRCTL> change_password
Old password: <enter>
New password: dummy
Reenter new password: dummy

Just hit <enter> key for old password since no previuos password is set. The passwords you entered will not be echoed.

– Stop the listener
LSNRCTL> set password
Password: <enter_your_password_here>

LSNRCTL> set password Password: e1
LSNRCTL> stop – Check your listener.ora file

Entries similar to the following should have been added to your listener.ora automatically.


How to re-establish logging if the listener.log isn’t logging without restarting listener?

For some reason if the listener.log was renamed (mv) or removed and listener will stop logging information to the logfile, one way to fix this issue is to restart the listener but it would require taking an outage. If one can’t restart the listener you can work around this issue by turning off log and turning it back on.

$ rm listener.log
$ touch listener.log
$ ls -l listener.log
-rw-r–r– 1 oracle oinstall 0 Mar 26 18:46 listener.log
$ ORACLE_HOME/bin/lsnrctl
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.01)(PORT=1521)))
LISTENER parameter “log_status” set to OFF
The command completed successfully
LSNRCTL> set log_status on
LISTENER parameter “log_status” set to ON
The command completed successfully
$ ls -l listener.log
-rw-r–r– 1 oracle oinstall 553 Mar 26 18:53 listener.log

Archiving/Purge listener logfile

The listener log file can grow over time and archive the listener log file one can’t move the file and create a new file using touch as the listener has a open/active file handle to log file causes the listener to no longer update the log file. So work around this issue one would need to do the following steps to archive the file and so listener can still continue writing to the log file.

# change directory to location where the listener log file resides
$ cd $ORACLE_HOME/network/log
# display inode of the file to show it doesn’t change during echo
$ ls -i listener.log
220993 listener.log
# copy the listener log file
$ cp -p listener.log listener.log.1
# erase contents of the current log file
$ echo “” > listener.log
# inode is the same as before which shows the listener will continue to able to write to this file
$ ls -i listener.log
220993 listener.log

To purge the listener log file without restarting the listener
$ cd $ORACLE_HOME/network/log
$ echo “” > listener.log