Home  >  Article  >  Database  >  How to check the oracle database listening port

How to check the oracle database listening port

下次还敢
下次还敢Original
2024-04-07 16:33:231205browse

To view the Oracle database listening port, perform the following steps: Connect to the database server and find the listener process. Identifies the port number the listener process is listening on. Use the lsnrctl status command to list listener details, including port number, status, and number of connections.

How to check the oracle database listening port

How to check the Oracle database listening port

Oracle database listening is a background process that listens for requests from the client Connect requests and route them to the appropriate database instance. To view the Oracle Database listening port, follow these steps:

1. Connect to the database server

Use SSH or other secure method to connect to the server running the Oracle Database.

2. Find the listener process

Execute the following command to find the listener process:

<code>ps -ef | grep tnslsnr</code>

This will return all running listeners List of processes.

3. Identify the listener port

In the output, find the line that matches the following header:

<code>-p <port></code>

<port> is the port number the listener is listening on.

4. List listener details

To get more details about the listener, execute the following command:

<code>lsnrctl status</code>

This will display various information about the listener, including port number, status, and number of connections.

Example output:

<code>LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-JUN-2021 17:07:23

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host.example.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                16-JUN-2021 17:07:23
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           orcl
Listener Parameter File   /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/12.2.0/dbhome_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host.example.com)(PORT=1521)))
The listener supports no services</code>

In this example, the listener is listening on port 1521.

The above is the detailed content of How to check the oracle database listening port. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn