Create and configure a listener

Oracle reads from listener.ora from $ORACLE_HOME/network/admin for defined listeners on the host.

You can create listener via command line or netmgr and netca utilities which are graphics utilities for managing listener.ora file.

[oracle@ed02pc admin]$ cat listener.ora

LISTENER2 =
  (DESCRIPTION =
        (ADDRESS_LIST=
                (ADDRESS=(PROTOCOL=tcp)(HOST=ed02pc.example.com)(PORT=12012))))

ADR_BASE_LISTENER2=/u01/app/oracle


Start the listener

[oracle@ed02pc admin]$ lsnrctl start listener2

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-MAR-2013 12:43:37

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/ed02pc/listener2/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ed02pc.example.com)(PORT=12012)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ed02pc.example.com)(PORT=12012)))
STATUS of the LISTENER
------------------------
Alias                     listener2
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                29-MAR-2013 12:43:37
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ed02pc/listener2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ed02pc.example.com)(PORT=12012)))
The listener supports no services
The command completed successfully

List listener services

[oracle@ed02pc admin]$ lsnrctl

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-MAR-2013 12:44:52

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL>
LSNRCTL> service listener2
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ed02pc.example.com)(PORT=12012)))
The listener supports no services
The command completed successfully

You can execute “help” command from lsnrctl and see all available options

LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:

start               stop                status              
services            version             reload              
save_config         trace               spawn               
change_password     quit                exit                
set*                show*               

Stop the listener

[oracle@ed02pc admin]$ lsnrctl stop listener2

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-MAR-2013 12:47:13

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ed02pc.example.com)(PORT=12012)))
The command completed successfully

Leave a Reply