How to change listener password?

We can change the password by executing the change_password & save_config commands from LSNRCTL> prompt.

Make sure $ORACLE_HOME/network/admin/listener.ora exists.

If not, save_config will generate NL-00051 error.

$lsnrctl

LSNRCTL> status
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Solaris: Version 11.1.0.6.0 – Production
Start Date 16-APR-2008 14:50:54
Uptime 55 days 0 hr. 58 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/dev1/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev1)(PORT=1521)))
Services Summary…
Service “TESTDB” has 1 instance(s).
Instance “TESTDB”, status READY, has 1 handler(s) for this service…
Service “TESTDBXDB” has 1 instance(s).
Instance “TESTDB”, status READY, has 1 handler(s) for this service…
Service “TESTDB_XPT” has 1 instance(s).
Instance “TESTDB”, status READY, has 1 handler(s) for this service…
The command completed successfully

NOTE: By default, Old password is blank. So we can just press ENTER.

LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Password changed for LISTENER
The command completed successfully

LSNRCTL> set password
Password:

This is required prior executing privileged lsnrctl commands like save_config, stop. (Thanks to Chris for pointing out the missing bit)

LSNRCTL> save_config
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
NL-00051: internal error code, arguments: [302], [1], [], [], [], [], []
LSNRCTL> exit

Create a dummy listener.ora file as

/u01/app/oracle/product/11.1/network/admin> touch listener.ora

Connect to listener & reload

/u01/app/oracle/product/11.1/network/admin> lsnrctl

LSNRCTL for Solaris: Version 11.1.0.6.0 – Production on 10-JUN-2008 15:50:02
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Welcome to LSNRCTL, type “help” for information.

LSNRCTL> reload
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully

LSNRCTL> status
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
————————
Alias LISTENER
Version TNSLSNR for Solaris: Version 11.1.0.6.0 – Production
Start Date 16-APR-2008 14:50:54
Uptime 55 days 0 hr. 59 min. 22 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/dev1/listener/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dev1)(PORT=1521)))
Services Summary…
Service “TESTDB” has 1 instance(s).
Instance “TESTDB”, status READY, has 1 handler(s) for this service…
Service “TESTDBXDB” has 1 instance(s).
Instance “TESTDB”, status READY, has 1 handler(s) for this service…
Service “TESTDB_XPT” has 1 instance(s).
Instance “TESTDB”, status READY, has 1 handler(s) for this service…
The command completed successfully

LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Password changed for LISTENER
The command completed successfully

LSNRCTL> set password
Password:

LSNRCTL> save_config
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Saved LISTENER configuration parameters.
Listener Parameter File /u01/app/oracle/product/11.1/network/admin/listener.ora
Old Parameter File /u01/app/oracle/product/11.1/network/admin/listener.bak
The command completed successfully

$ ls -al listener.*

-rw-r–r– 1 oracle oinstall 0 Jun 10 15:50 listener.bak
-rw-r–r– 1 oracle oinstall 131 Jun 10 15:50 listener.ora

We can now see the password in the listener.ora file

$ cat listener.ora

#—-ADDED BY TNSLSNR 10-JUN-2008 15:50:34—
PASSWORDS_LISTENER = 76C28548CE30599E
#——————————————–

Note: Password authentication will not be required for OS user who owns the database software.

Another typo mistake many people do (including me), when changing the password. It’s change_password NOT change password.

If we use ‘change password’, lsnrctl will return TNS-01101: Could not find service name password.

Advertisements
This entry was posted in Oracle Connectivity and tagged . Bookmark the permalink.

3 Responses to How to change listener password?

  1. cherdeg says:

    Hey,

    in my opinion you forgot to mention that the user has to enter

    “set password” after

    “change_password” and before

    “save_config”

    Regards,

    Chris

  2. ybhandarkar says:

    Hello Chris,

    Thanks for pointing out the missing bit. I’ve added the step.

    -Yogesh

  3. சீனு says:

    I tried to Change the password for Listener Control. After I set, when I type Status, I am getting the following error:
    “Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=intqa)(PORT=1527)))
    TNS-01169: The listener has not recognized the password”

    What should I do?

    Also, be setting password to the Listener, what will be the impact. Will it change the way the user if logging into SAP?

    Please let me know the answers to srinivasank77@gmail.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s