Re: Finding TNS listener ports
Date: Thu, 30 Jul 2020 03:34:46 +0300
Message-ID: <CAOVevU5D5t4+41Chidk=pY29TS9xMHTB+mxqjMCG6Ssai4TsJw_at_mail.gmail.com>
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> 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/ {
> > _[$3] = $5
> > } END {
> > for (__ in _) print __, _[__]
> > }'
> > done
> >
> >
> --
> Mladen Gogala
> Database Consultant
> 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-lReceived on Thu Jul 30 2020 - 02:34:46 CEST