Re: Finding TNS listener ports

From: Tim Gorman <tim.evdbt_at_gmail.com>
Date: Wed, 29 Jul 2020 19:04:01 -0700
Message-ID: <9b4b9785-afcf-af70-d815-8e982f160b9d_at_gmail.com>



Some 20 years ago, wrote this shell-script (http://evdbt.com/download/tnsprobe-sh/) named "tnsprobe.sh" to kind of brute-force search for TNS ports. Essentially, it tries each port in a specified range and tests it.

On 7/29/2020 5:34 PM, Sayan Malakshinov wrote:
> 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_at_gmail.com
> <mailto:gogala.mladen_at_gmail.com>> wrote:
>
> That is still much more cumbersome than nmap:
>
> [root_at_ora19c oracle]# nmap localhost|grep oracle
> 1521/tcp open  oracle
> [root_at_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/ <http://0.0.0.0/> {
> >            _[$3] = $5
> >          } END {
> >          for (__ in _) print __, _[__]
> >          }'
> >   done
> >
> >
> --
> Mladen Gogala
> Database Consultant
class="quotelev1">> Tel: (347) 321-1217
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>
>
> --
> Best regards,
> Sayan Malakshinov
> Oracle performance tuning engineer
> Oracle ACE Associate
> http://orasql.org

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jul 30 2020 - 04:04:01 CEST

Original text of this message