Oracle Listener
Check
Status
lsnrctl status ${LISTENER_NAME}
List
To get a list of running listeners on a UNIX server use:
ps -ef | grep tns | grep oracle | grep -v grep
oracle 16788 1 0 Feb01 ? 00:00:03 /u01/app/oracle/product/122010ORCL1/bin/tnslsnr listener1 -inheritoracle 17996 1 0 Feb01 ? 00:00:02 /u01/app/oracle/product/122010ORCL2/bin/tnslsnr listener2 -inherit
tnsping
tnsping mynetservicename
trcroute
trcroute mynetservicename
Manage
Start
lsnrctl start ${LISTENER_NAME}
Stop
lsnrctl stop ${LISTENER_NAME}
Reload
If you change the LISTENER.ORA you can reload the configuration without a full stop/start...
lsnrctl reload ${LISTENER_NAME}
This minimises any disruption but note that "the database services, instances, service handlers, and listening endpoints that were dynamically registered with the listener will be unregistered and subsequently registered again." (1)
Configure
LOCAL_LISTENER
You should explicitly tell the database which Listener to interact with using the LOCAL_LISTENER parameter...
TCP
ALTER SYSTEM SET LOCAL_LISTENER = "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myhost)(PORT=1521)))" SCOPE=BOTH;
For 11.2.0.4 and above, see COST and VNCR in LISTENER.ORA. For 11.2.0.3 and earlier, consider using PROTOCOL=ipc (see below).You can check what the value should be using...
lsnrctl stat ${LISTENER_NAME} | grep tcp
IPC
ALTER SYSTEM SET LOCAL_LISTENER = "(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))" SCOPE=BOTH;
The benefit of setting LOCAL_LISTENER to use the IPC protocol is that your database will only dynamically register with a listener on the same server. However, this will complicate any Data Guard configuration. This is the recommended mitigation for CVE-2012-1675 in 11.2.0.3 and earlier. For 11.2.0.4 and later, use TCP and see COST and VNCR in LISTENER.ORA.You can check what the value should be using...
lsnrctl stat ${LISTENER_NAME} | grep ipc
REMOTE_LISTENER
This is a CIS Benchmark requirementRecommended value is empty i.e. ''
Check
SELECT UPPER(VALUE)
FROM V$SYSTEM_PARAMETER
WHERE UPPER(NAME)='REMOTE_LISTENER'
AND VALUE IS NOT NULL;
Multi-Tenant Version...
SELECT DISTINCT UPPER(V.VALUE),
DECODE (V.CON_ID,0,(SELECT NAME FROM V$DATABASE),
1,(SELECT NAME FROM V$DATABASE),
(SELECT NAME FROM V$PDBS B WHERE V.CON_ID = B.CON_ID))
FROM V$SYSTEM_PARAMETER V
WHERE UPPER(NAME) = 'REMOTE_LISTENER'
AND VALUE IS NOT NULL;
Change
ALTER SYSTEM SET REMOTE_LISTENER = '' SCOPE = SPFILE;
Troubleshooting
TNS-01106
TNS-01106: Listener Using Listener Name Has Already Been Started
Two listeners cannot have the same port. Check that another listener is not already listening on the port specified.
TNS-01198
TNS-01198: Listener failed to initialize valid node list
Symptom
On 12c...
lsnrctl start
LSNRCTL for IBM/AIX RISC System/6000: Version 12.1.0.2.0 - Production on 18-FEB-2016 12:06:07
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /u01/app/oracle/product/12.1.0.2/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 12.1.0.2.0 - ProductionTNS-01198: Listener failed to initialize valid node listNL-07010: failed to get subnet maskNL-00408: cannot find or read valueNL-00408: cannot find or read valueNL-00408: cannot find or read value
Listener failed to start (see the error message above). Things work fine using 11g listener with the same configuration.
Cause
VALID_NODE_CHECKING_REGISTRATION defaults to ON for 12c, but defaults to OFF for 11g.Solution
In this example case, the issue is suspected to be related to an IPV6 address in the hosts file... but exact root cause not yet confirmed.TNS-12516
TNS-12516: TNS:listener could not find available handler with matching protocol stack
This is often due to hitting the instance PROCESS limit.
TNS-12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
This normally means that the service you are trying to connect to is not running on this server. In a load balanced configuration you might expect this (e.g a setup where the clients are configured to try all Data Guard nodes so that they work without alteration after a failover/switchover).
Warnings
WARNING: Subscription for node down event still pending
Relates to ONS. Set to OFF in non-RAC environments.
Bibliography & References
https://support.oracle.com552765.1 Troubleshooting Guide TNS-12519 TNS-12516 ORA-12519 OR-12516https://dbaclass.com/article/tns-01106-listener-using-listener-name-already-started/
(1) https://docs.oracle.com/cd/B19306_01/network.102/b14213/lsnrctl.htmhttps://docs.oracle.com/cd/E18283_01/network.112/e10836/advcfg.htm (Oracle® Database Net Services Administrator's Guide - 11gR2 - 13 Enabling Advanced Features of Oracle Net Services)
https://dba.stackexchange.com/questions/259204/listener-lsnrctl-reload-vs-stop-start
https://joelitechlife.ca/2020/11/12/dynamic-service-registration-with-ipc-protocol/comment-page-1/
trcroutehttps://docs.oracle.com/cd/E11882_01/network.112/e41945/connect.htm#NETAG383
tnspinghttps://docs.oracle.com/cd/E11882_01/network.112/e41945/connect.htm#NETAG378