Here we will look at the configuration and administration of the listener.
First we have to configure the listener.ora in the $ORACLE_HOME/network/admin directory
LISTENER=
(DESCRIPTION=
(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc_(KEY=EXTPROC))
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=ocm11g)
(ORACLE_HOME=/oracle/product/11.2.0/dbhome_1)
)
(SID_DESC=
(SID_NAME=PLSExtProc)
(ORACLE_HOME=/oracle/product/11.2.0/dbhome_1)
(PROGRAM=extproc)
)
)
[oracle@ocm11g admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:28:13
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is /oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /oracle/diag/tnslsnr/ocm11g/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm11g.localdomain)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 22-AUG-2011 10:28:14
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /oracle/diag/tnslsnr/ocm11g/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm11g.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ocm11g" has 1 instance(s).
Instance "ocm11g", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@ocm11g admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:28:29
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 22-AUG-2011 10:28:14
Uptime 0 days 0 hr. 0 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /oracle/diag/tnslsnr/ocm11g/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm11g.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ocm11g" has 1 instance(s).
Instance "ocm11g", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@ocm11g admin]$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:28:46
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "ocm11g" has 2 instance(s).
Instance "ocm11g", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "ocm11g", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
UNKNOWN - Statically defined services. You are able to connect to the database as sys user even when the database is down.
READY - Dinamically registered service. Database was automatically registered to listener (PMON process).
Listener trace:
TRACE_LEVEL_LISTENER=16
TRACE_FILE_LISTENER=listener.trc (listener.trc is the default)
TRACE_DIRECTORY_LISTENER=$ORACLE_HOME/network/trace
[oracle@ocm11g trace]$ lsnrctl reload
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:37:27
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
The command completed successfully
LISTENER=
(DESCRIPTION=
(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc_(KEY=EXTPROC))
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=ocm11g)
(ORACLE_HOME=/oracle/product/11.2.0/dbhome_1)
)
(SID_DESC=
(SID_NAME=PLSExtProc)
(ORACLE_HOME=/oracle/product/11.2.0/dbhome_1)
(PROGRAM=extproc)
)
)
[oracle@ocm11g admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:28:13
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Starting /oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.2.0 - Production
System parameter file is /oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /oracle/diag/tnslsnr/ocm11g/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm11g.localdomain)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 22-AUG-2011 10:28:14
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /oracle/diag/tnslsnr/ocm11g/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm11g.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ocm11g" has 1 instance(s).
Instance "ocm11g", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@ocm11g admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:28:29
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date 22-AUG-2011 10:28:14
Uptime 0 days 0 hr. 0 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /oracle/diag/tnslsnr/ocm11g/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm11g.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ocm11g" has 1 instance(s).
Instance "ocm11g", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@ocm11g admin]$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:28:46
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "ocm11g" has 2 instance(s).
Instance "ocm11g", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Instance "ocm11g", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
UNKNOWN - Statically defined services. You are able to connect to the database as sys user even when the database is down.
READY - Dinamically registered service. Database was automatically registered to listener (PMON process).
Listener trace:
TRACE_LEVEL_LISTENER=16
TRACE_FILE_LISTENER=listener.trc (listener.trc is the default)
TRACE_DIRECTORY_LISTENER=$ORACLE_HOME/network/trace
[oracle@ocm11g trace]$ lsnrctl reload
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2011 10:37:27
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(HOST=localhost)(PROTOCOL=tcp)(PORT=1521)))
The command completed successfully