how to find oracle listener port in linux

java, linux, oracle11g

Solution

You can typically see the port number you need in `listener.ora`:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = DS-1)(PORT = 1521))
    )
  )

To find you listener.ora, you can use eg

find . -type f -name listener.ora

Problem

I have Oracle 11.2.0 installed in my Linux system, on which we are running one tool(developed in java), which needs as an input the port number where the oracle listener is running. Is there any way to get the port number.

Original source