|Lesson 3||Finding the listener service (Windows only)|
|Objective||View the current status of the listener service.|
Finding Oracle listener Service
How do I view the current status of the listener service in Oracle 11g on a Windows operating system?
To view the current status of the Oracle Net Listener service (OracleTNSListener) in Oracle 11g on a Windows operating system, you will use the lsnrctl command line utility. Here are the step-by-step instructions:
- Open a Windows Command Prompt: You can do this by pressing the Windows key + R, typing cmd into the Run dialog box, and hitting Enter.
- Set the ORACLE_HOME environment variable: The Oracle home directory is the directory where your Oracle software is installed. You can set the ORACLE_HOME environment variable by executing the command:
Make sure to replace C:\your\path\to\oracle\home with the actual path to your Oracle home directory.
- Set the PATH environment variable: Append the ORACLE_HOME\bin directory to your PATH environment variable:
- Navigate to the Oracle home's BIN directory: You can do this by typing cd %ORACLE_HOME%\bin into the command prompt and hitting Enter.
- Check the status of the Oracle listener: In the command prompt, type lsnrctl status and hit Enter.
Upon executing the lsnrctl status command, the utility will display the current status of the OracleTNSListener. If the listener is running, you will see information about the listener’s name, start date, and endpoint summary, as well as the services summary which includes the services that the listener is listening for. If the listener is not running, you will receive a message indicating that the TNS-12541: TNS:no listener error.
Please note that to execute these steps, you must have the necessary administrative privileges on your Windows server.
Under Windows, the Oracle Net Listener is implemented as a Windows Service.
The following simulation will show you how to stop, start, and view the current status of this service.
If you are running Unix, you should still do this simulation for the sake of general knowledge
Default listener service for an Oracle database on a Windows Server after installation
Question: What is the name of the default listener service for an Oracle database on a Windows Server after installation?
The default listener service for an Oracle database installed on a Windows Server is known as "OracleTNSListener".
Upon the successful installation of an Oracle database, the Oracle Net Listener service, commonly referred to as OracleTNSListener, is automatically configured. This listener service plays a vital role in the network communication between a client and an Oracle server.
The OracleTNSListener service is specifically designed to handle incoming client connection requests for Oracle server processes over Oracle Net. It listens for and manages traffic over the designated network protocols, thus providing seamless connectivity between the client and the Oracle database.
This service can typically be found running as a background process on the Windows Server, allowing Oracle databases to receive and respond to requests from remote locations. It is crucial for database administrators to ensure that the OracleTNSListener service is always running, as its unavailability may disrupt the connectivity, causing potential disruptions in database services.
If you have done a default Oracle install on Windows Server, you should have a listener service named
OracleOraHome11TNSListener, it should be started, and the startup mode should be automatic.
Under Unix, to see the status of the listener, you would run listener control, and issue the status command.
Go ahead and look for the listener service on your system right now.
Listener Direct Hand-Off Information
Example: shows a direct hand-off event in the log file.
The listener records direct hand-off events to dispatchers. These events are formatted into the following fields:
Timestamp * Presentation * Handoff * Error Code
Properties of direct hand-off fields are as follows:
- Each field is delimited by an asterisk (*).
- A successful connection or command returns a code of zero.
- A failure produces a code that maps to an error message.
Example Listener Log Event for Direct Hand-Off
21-MAY-2012 10:54:55 * oracle.aurora.net.SALESHttp2 * handoff * 0
Listener Subscription for ONS Node Down Event Information
The listener subscribes to the Oracle Notification Service (ONS) node down event on startup if the ONS configuration file is available.
This subscription enables the listener to remove the affected service when it receives node down event notification from ONS.
The listener uses asynchronous subscription for the event notification. The following warning message is recorded to the listener log file on each STATUS command if the subscription has not completed, such as the ONS daemon is not
running on the host.
Subscription for node down event still pending and the listener cannot receive the ONS event while subscription is pending.
Other than that, no other listener functionality is affected.
Listener Oracle Clusterware Notification Information
If the required Oracle Clusterware (shown as CRS in the following log messages)
libraries are installed and Oracle Clusterware is started on the host, then Oracle
Listener will notify Oracle Clusterware about its status during start and stop
processes. After successful notification, listeners record the event in the log and no message is recorded if the notification fails.
Listener completed notification to CRS on start
Listener completed notification to CRS on stop