Oracle Database Listener an Overview

Oracle Listener



What is an Oracle Listener?


The listener is a process that runs on the database server . It receives incoming client connection requests and manages the traffic of these requests to the database server. One Listener can listen incoming Client request for more than one database.

Where is the Listener Configuration file Stored?

Oracle Listener configuration file is always located in ORACLE_HOME/network/admin Directory and named as listener.ora
where  ORACLE_HOME is the Location where you have Oracle Database binaries Installed.

How to Create Listener

Creating of Listener is really easy you just Need to put an Entry like below in your listener.ora file. If the file already does not exists just create it

Note:- use vi on Linux based Server or Notepad on Windows to edit the listener.ora file.

Sample listener.ora

LISTENER01 =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = node1.oracle.com)(PORT = 1521))
      )
    )

Optionally you can tell Listenr for what all database it must listen by entring the respective entries in below Format.

SID_LIST_LISTENER01 =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = DBNAME1)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/db1)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = DBNAME2.oracle.com)
      (ORACLE_HOME =/u01/app/oracle/product/11.2.0.4/db2)
      (SID_NAME = DBNAME2)
    )
  )

Oracle provides another GUI Methode to create Listener and the tool used here is called Oracle Network Configuration Assistence

on Linux based plateform you can invoke the Utility by entring below command, considering Oracle binaries are installed under /u01/app/oracle/product/11.2.0.4/db2

$export ORACLE_HOME==/u01/app/oracle/product/11.2.0.4/db2
$export PATH=$PATH:$ORACLE_HOME/bin
$netca

optionally you can nevigate under $ORACLE_HOME/bin and execute netca command from there

$ cd  /u01/app/oracle/product/11.2.0.4/db2/bin
$./netca

If you use NETCA (recommended) Methode to create the LISTENER it will not only just create the listener but also start it.

How to Start Listener in Oracle

$export ORACLE_HOME==/u01/app/oracle/product/11.2.0.4/db2
$export PATH=$PATH:$ORACLE_HOME/bin
$ lsnrctl start LISTENER01

How to Check the Staus of Listener in Oracle


$export ORACLE_HOME==/u01/app/oracle/product/11.2.0.4/db2
$export PATH=$PATH:$ORACLE_HOME/bin
$ lsnrctl Status LISTENER01

Where to find the Listener Log Oracle.

$ lsnrctl status LISTENER01
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 29-JUL-2017 15:10:56
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER01)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER01
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                29-JUL-2017 15:09:22
Uptime                    0 days 0 hr. 1 min. 34 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/12.2.0.2/grid/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/node2/listener01/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER01)))
The listener supports no services
The command completed successfully



No comments:

Post a Comment