Wednesday, 18 September 2013

Setting listener password in Oracle

Setting listener password in Oracle

There are cases where “oracle” user credential are known to many. At this times we may want the authentication process to work as it was in 8i, 9i. Like ask for credential for any user even for “oracle”. In this case you need to set a parameter in listener.ora i.e. LOCAL_OS_AUTHENTICATION_=OFF. This will disable OS authentication for listener.
# bash-3.00$ cat listener.ora
# listener.ora Network Configuration File: /oracle/ora10203/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER_DBA =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =*.*.*.*)(PORT = 1523))
)
)
)

SID_LIST_LISTENER_DBA =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = DMS)
(ORACLE_HOME = /oracle/ora10g)
(SID_NAME = DMS)
)
)
Setting password for listener
bash-3.00$ lsnrctl

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Production on 20-JUN-2011 19:54:01

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> set current_listener listener_dba
Current Listener is listener_dba

LSNRCTL> show current_listener
Current Listener is listener_dba

LSNRCTL> set password
Password:
The command completed successfully

LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*.*.*.*)(PORT=1523)))
No changes to save for listener_dba.
The command completed successfully

LSNRCTL> change_password
Old password:
New password:
Reenter new password:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*.*.*.*)(PORT=1523)))
Password changed for listener_dba
The command completed successfully

LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*.*.*.*)(PORT=1523)))
Saved listener_dba configuration parameters.
Listener Parameter File   /oracle/ora10g/network/admin/listener.ora
Old Parameter File   /oracle/ora10g/network/admin/listener.bak
The command completed successfully
Lets check the authentication.
LSNRCTL> stop listener_dba
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*.*.*.*)(PORT=1523)))
The command completed successfully

LSNRCTL> start listener_dba
Starting /oracle/ora10g/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Production
System parameter file is /oracle/ora10g/network/admin/listener.ora
Log messages written to /oracle/ora10g/network/log/listener_dba.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=*.*.*.*)(PORT=1523)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*.*.*.*)(PORT=1523)))

STATUS of the LISTENER

------------------------
Alias                     listener_dba
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Production
Start Date                20-JUN-2011 19:55:10
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Password or Local OS Authentication
SNMP                      ON
Listener Parameter File   /oracle/ora10g/network/admin/listener.ora
Listener Log File         /oracle/ora10g/network/log/listener_dba.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=*.*.*.*)(PORT=1523)))
Services Summary...
Service "DMS" has 1 instance(s).
Instance "DMS", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>
I can see that “oracle” as OS user set the listener password and was the one to stop and start the listener. But it didn’t asked for password. Well lets set the parameter and then check.
bash-3.00$ vi listener.ora
"listener.ora" 48 lines, 1011 characters
# listener.ora Network Configuration File: /oracle/ora10203/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER_DBA =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =*.*.*.*)(PORT = 1523))
)
)
)

SID_LIST_LISTENER_DBA =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = DMS)
(ORACLE_HOME = /oracle/ora10g)
(SID_NAME = DMS)
)
)

#----ADDED BY TNSLSNR 20-JUN-2011 19:42:57---
PASSWORDS_listener_dba = FC996BE8FB638140
LOCAL_OS_AUTHENTICATION_LISTENER_DBA=OFF
SAVE_CONFIG_ON_STOP_LISTENER = ON
#--------------------------------------------
Here listener_dba is the current listener.
bash-3.00$ lsnrctl

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Production on 20-JUN-2011 19:57:22

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> stat listener_dba
Starting /oracle/ora10g/bin/tnslsnr: please wait...

TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Production
System parameter file is /oracle/ora10g/network/admin/listener.ora
Log messages written to /oracle/ora10g/network/log/listener_dba.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=*.*.*.*)(PORT=1523)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*.*.*.*)(PORT=1523)))
STATUS of the LISTENER
------------------------
Alias                     listener_dba
Version                   TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Production
Start Date                20-JUN-2011 19:57:48
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Password
SNMP                      ON
Listener Parameter File   /oracle/ora10g/network/admin/listener.ora
Listener Log File         /oracle/ora10g/network/log/listener_dba.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=*.*.*.*)(PORT=1523)))
Services Summary...
Service "DMS" has 1 instance(s).
Instance "DMS", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

LSNRCTL> stop listener_dba
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*.*.*.*)(PORT=1523)))
TNS-01169: The listener has not recognized the password
LSNRCTL>

ref: Setting Listener Passwords With an Oracle 10g or Newer Listener [ID 260986.1]

No comments:

Post a Comment