listener.ora and tnsnames.ora configuration using netca & netmgr
1. check listneter is running or not using lsnrctl utility
[oracle@rac1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 28-MAY-2020 23:00:21
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@rac1 ~]$
2. Check listener os process is running or not
[oracle@rac1 ~]$ ps -ef|grep tns
root 21 2 0 22:45 ? 00:00:00 [netns]
oracle 5440 4838 0 23:00 pts/1 00:00:00 grep tns
[oracle@rac1 ~]$
3. Check listener.or and tnsnames.ora files are available on TNS_ADMIN locastion or not
[oracle@rac1 ~]$ cd $TNS_ADMIN
[oracle@rac1 admin]$ pwd
/u01/app/oracle/product/11204/dbhome_1/network/admin
[oracle@rac1 admin]$ ls -ltrh
total 16K
-rw-r--r-- 1 oracle oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x 2 oracle oinstall 4.0K May 27 20:41 samples
[oracle@rac1 admin]$
[oracle@rac1 admin]$ In this location there should be tnsnames.ora, listenr.ora and sqlnet.ora file
4. Verify at the database level whether listner is registared or not (remote_listener & local_listener parameter)
[oracle@rac1 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu May 28 23:16:11 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter remote
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode string TIMESTAMP
remote_listener string
remote_login_passwordfile string EXCLUSIVE
remote_os_authent boolean FALSE
remote_os_roles boolean FALSE
result_cache_remote_expiration integer 0
SQL> show parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
log_archive_local_first boolean TRUE
parallel_force_local boolean FALSE
SQL> clear
SQL> exit
[oracle@rac1 admin]$
5. run the netca GUI tool to configure the listner
[oracle@rac1 admin]$ cd $ORACLE_HOME/bin
[oracle@rac1 bin]$ pwd
/u01/app/oracle/product/11204/dbhome_1/bin
[oracle@rac1 bin]$ ll netca
-rwxr-xr-x 1 oracle oinstall 6685 May 27 20:45 netca
[oracle@rac1 bin]$
[oracle@rac1 bin]$ ./netca
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/11204/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Oracle Net Services configuration successful. The exit code is 0
6. Verify the listener up and running after configuration
[oracle@rac1 bin]$ ps -ef|grep tns
root 21 2 0 22:45 ? 00:00:00 [netns]
oracle 5740 1 0 23:20 ? 00:00:00 /u01/app/oracle/product/11204/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle 5790 5548 0 23:24 pts/1 00:00:00 grep tns
7. Verify the listner status using lsnrctl utility
[oracle@rac1 bin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 28-MAY-2020 23:24:50
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 28-MAY-2020 23:20:23
Uptime 0 days 0 hr. 4 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11204/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "DEVDB" has 1 instance(s).
Instance "DEVDB", status READY, has 1 handler(s) for this service...
Service "DEVDBXDB" has 1 instance(s).
Instance "DEVDB", status READY, has 1 handler(s) for this service...
The command completed successfully
8. Verify the listener.ora file create under the TNS_ADMIN location or not
[oracle@rac1 bin]$ cd $TNS_ADMIN
[oracle@rac1 admin]$ ls -ltrh
total 24K
-rw-r--r-- 1 oracle oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x 2 oracle oinstall 4.0K May 27 20:41 samples
-rw-r--r-- 1 oracle oinstall 380 May 28 23:20 listener.ora
[oracle@rac1 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11204/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
[oracle@rac1 admin]$
9. user netmgr tool to create tnsnames.ora file, You can use this netmger tool to create listner as well.
[oracle@rac1 admin]$ cd /u01/app/oracle/product/11204/dbhome_1/bin/
[oracle@rac1 bin]$ pwd
/u01/app/oracle/product/11204/dbhome_1/bin
[oracle@rac1 bin]$ ll netmgr
-rwxr-xr-x 1 oracle oinstall 6464 May 27 20:45 netmgr
[oracle@rac1 bin]$ ./netmgr
10. Verify the tnsnames.ora file create under the TNS_ADMIN location or not
[oracle@rac1 bin]$ cd $TNS_ADMIN
[oracle@rac1 admin]$ ls -ltrh
total 32K
-rw-r--r-- 1 oracle oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x 2 oracle oinstall 4.0K May 27 20:41 samples
-rw-r--r-- 1 oracle oinstall 380 May 28 23:20 listener.ora
-rw-r--r-- 1 oracle oinstall 337 May 28 23:28 tnsnames.ora
[oracle@rac1 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11204/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
DEVDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.localdomain)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = DEVDB)
)
)
11. Verify the listner and registred status at the database;
[oracle@rac1 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu May 28 23:29:00 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
log_archive_local_first boolean TRUE
parallel_force_local boolean FALSE
SQL> alter system register;
System altered.
SQL> show parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
log_archive_local_first boolean TRUE
parallel_force_local boolean FALSE
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining
and Real Application Testing options
[oracle@rac1 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 28-MAY-2020 23:30:56
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 28-MAY-2020 23:20:23
Uptime 0 days 0 hr. 10 min. 32 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11204/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "DEVDB" has 1 instance(s).
Instance "DEVDB", status READY, has 1 handler(s) for this service...
Service "DEVDBXDB" has 1 instance(s).
Instance "DEVDB", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@rac1 admin]$
Regards,
Mallik