©2015 - 2022 Chad’s Technoworks. Disclaimer and Terms of Use

Chad’s TechnoWorks My Journal On Technology

Information Technology

Oracle Database Listener Configuration

The Oracle Database Listener, officially known as Oracle Net Listener, is a running process that serves as the door for all external client connection. In order for remote users and applications to be able to connect to an Oracle database, it has to connect to an Oracle Net listener which is configured to receive connection requests of various protocols (TCP, TCPS, IPC). Each supported protocol had an assigned port ready to receive connection requests. Once the connection request has been validated, the client would then be routed to an existing database server process to begin its transaction. This is the most basic explanation I can give of the role of an Oracle Net listener. If you need to go deeper on underlying components, read the administrator’s guide for Oracle Net Services.


Okay, now here’s how to configure an Oracle Net listener using a tool called netca (network configuration assistant).


To begin with, it is assumed that the Oracle database software has been installed and that the basic environment variables ORACLE_BASE and ORACLE_HOME are set and so does the PATH variable that should include the entry $ORACLE_HOME/bin.


1. Become an Oracle user and run the command netca from the terminal.


2. Select the Listener Configuration option.


  

 




3. Since this is the first time to configure the Net Listener, the only option in this case is add. Click next.

5. Select the protocols which your listener will support.

    Default is TCP. If you wish to use SSL or native encryption, you may select TCPS.

4. Enter the name of your listener.

    In this example, I had named it MYDB_LISTENER.

6. Enter the port number you wish to use for the TCP protocol. Default is 1521.

7. If you had also added previously the TCPS protocol you will also be prompted to enter the port to use such as the ones below.

8. Now that we had entered the necessary details, just move on with the succeeding prompts to finish the setup.

The resulting configuration is stored on a file with in the following path: $ORACLE_HOME/network/admin/listener.ora


The contents of the file will look something like this:


# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0.4/db/network/admin/listener.ora

# Generated by Oracle configuration tools.


ADR_BASE_MYDB_LISTENER = /u01/app/oracle


MYDB_LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = labserver)(PORT = 1601))

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1601))

    )

  )


Note: An alternative way to configure a listener is to create the listener.ora file with the entries above thus forgoing the use of the tool netca. But this method requires knowledge of the use of parameters to build a listener.


To start a Net Listener using the command line:

Unix> lsnrctl start MYDB_LISTENER


To stop a Net Listener using the command line:

Unix> lsnrctl stop MYDB_LISTENER


To check for the status of the Net Listener:

Unix> lsnrctl status MYDB_LISTENER