The contents are of my own testing and deployments. Not guaranteed that these might work in your environment. Please test before usage.
Summary: in this tutorial, you will learn what a listener is in the Oracle database, and How to start and stop the listener.
What is Listener?
- When a client request comes, the listener first receives it and then establishes the connection between the client and the database.
- Once the Client connect the database successfully the listener hand over the client's conception to the server process
- If the listener stops running, you can no longer connect to the Oracle Database. However, all the existing connections will not be affected.
How to find the listener directory?
[oracle@ltitest ~]$ cd $ORACLE_HOME/network/admin
[oracle@ltitest admin]$ pwd
/u01/app/oracle/product/12.1.0/dbhome_1/network/admin
[oracle@ltitest admin]$
How to start the listener?
[oracle@ltitest admin]$ . oraenv
ORACLE_SID = [ltitest1] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ltitest admin]$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 28-FEB-2023 12:42:16
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /u01/app/oracle/product/12.1.0/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/ltitest/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ltitest.localdomain)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 28-FEB-2023 12:42:16
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/ltitest/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ltitest.localdomain)(PORT=1521)))
The listener supports no services
The command completed successfully
How to stop the Listener?
[oracle@ltitest admin]$ . oraenv
ORACLE_SID = [ltitest1] ?
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ltitest admin]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 28-FEB-2023 12:42:07
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
How to Confirm the listener is Up and running at the OS level?
[oracle@ltitest admin]$ ps -ef |grep tns
root 30 2 0 12:25 ? 00:00:00 [netns]
oracle 4018 1 0 12:42 ? 00:00:00 /u01/app/oracle/product/12.1.0/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle 4080 3220 0 12:48 pts/0 00:00:00 grep --color=auto tns
Note: As per the above command The listener process is up and running..
0 Comments