netstat -tulpn | grep LISTEN | grep tnslsnr | awk '{print $4" - "$7}'
192.168.10.24:12632 - 43885/tnslsnr
192.168.10.101:37980 - 43885/tnslsnr
192.168.10.101:47550 - 43880/tnslsnr
192.168.10.24:13254 - 43882/tnslsnr
192.168.10.23:61803 - 43882/tnslsnr
192.168.10.23:24813 - 43885/tnslsnr
192.168.10.24:34094 - 43880/tnslsnr
10.81.54.124:1521 - 43885/tnslsnr
10.81.54.123:1521 - 43880/tnslsnr
10.80.54.51:1521 - 43880/tnslsnr
192.168.10.101:1522 - 43882/tnslsnr
192.168.10.101:27891 - 43882/tnslsnr
192.168.10.23:1526 - 44007/tnslsnr
192.168.10.101:1526 - 44007/tnslsnr
192.168.10.24:1526 - 44007/tnslsnr
192.168.10.23:46646 - 43880/tnslsnr
192.168.10.23:1527 - 44010/tnslsnr
192.168.10.101:1527 - 44010/tnslsnr
192.168.10.24:1527 - 44010/tnslsnr
will show the ports the listeners are listening on and their pids
Then
~]$ ps -ef | grep tns | awk '{print $2" - "$8" - "$9}'
318 - [netns] -
43880 - /u01/app/19.0.0.0/grid/bin/tnslsnr - LISTENER
43882 - /u01/app/19.0.0.0/grid/bin/tnslsnr - LISTENER_IB
43885 - /u01/app/19.0.0.0/grid/bin/tnslsnr - LISTENER_SCAN1
44007 - /u01/app/19.0.0.0/grid/bin/tnslsnr - ASMNET1LSNR_ASM
44010 - /u01/app/19.0.0.0/grid/bin/tnslsnr - ASMNET2LSNR_ASM
Shows nice listener name the Oracle Home it is coming from and the pid number
of the process
You just need to do a little more work with a script if you wanted to come up
with something really nice like
NAME PORT PID ORACLE_HOME
NETWORK
LISTENER – 1521 – 43880 - /u01/app/19.0.0.0/grid/bin/tnslsnr - 10.80.54.51
From: oracle-l-bounce@xxxxxxxxxxxxx <oracle-l-bounce@xxxxxxxxxxxxx> On Behalf
Of Courtney Llamas
Sent: Wednesday, July 29, 2020 12:32 PM
To: Bala <oratips@xxxxxxxxx>
Cc: oracle-l <oracle-l@xxxxxxxxxxxxx>
Subject: Re: Finding TNS listener ports
Try
netstat -a|grep LISTEN|grep EXTPROC
I don’t have multiple users, so grep oracle for me works but assuming yours
will all be different user there.
Courtney Llamas | Strategic Customer Program | +1.713.374.2102
Oracle <https://www.oracle.com/manageability/> Manageability
On Jul 29, 2020, at 2:28 PM, Bala <oratips@xxxxxxxxx <mailto:oratips@xxxxxxxxx>
wrote:
wrote: