Re: Finding TNS listener ports

  • From: Sayan Malakshinov <xt.and.r@xxxxxxxxx>
  • To: Mladen Gogala <gogala.mladen@xxxxxxxxx>
  • Date: Thu, 30 Jul 2020 03:34:46 +0300

Hi Mladen,

nmap thinks that only 1521 is an Oracle port, so in case of several
listeners on different ports it can't determine real service behind them.
For example, I have 2 different listeners on 1521 and 1522, but nmap
returns only 1521 as an Oracle service. Moreover, by default nmap scans
just the most common 1,000 ports for each protocol, so with default
parameters it will not find 1522. The same thing with sshd - I reconfigured
it to 1122 and nmap returns 'availant-mgr' for it.

On Thu, Jul 30, 2020 at 3:21 AM Mladen Gogala <gogala.mladen@xxxxxxxxx>
wrote:

That is still much more cumbersome than nmap:

[root@ora19c oracle]# nmap localhost|grep oracle
1521/tcp open  oracle
[root@ora19c oracle]#

On 7/29/20 4:34 PM, Radoulov, Dimitre wrote:

On Solaris I would use something like this:

pgrep -lf '[t]nslsnr' |
  while read p x l x; do
    printf 'listener %s is listening on the following
interfaces/ports:\n' "$l"
    pfiles "$p" |
       nawk '/sockname: AF_INET / && !/0.0.0.0/ {
           _[$3] = $5
         } END {
         for (__ in _) print __, _[__]
         }'
  done


--
Mladen Gogala
Database Consultant
Tel: (347) 321-1217

--
//www.freelists.org/webpage/oracle-l




-- 
Best regards,
Sayan Malakshinov
Oracle performance tuning engineer
Oracle ACE Associate
http://orasql.org

Other related posts: