Home >Database >Oracle >How to check the oracle database port number

How to check the oracle database port number

下次还敢
下次还敢Original
2024-04-18 20:54:181203browse

Oracle database port number query method

Step 1: Use Oracle listener

  • Open the command prompt or terminal window .
  • Enter the following command:
<code>lsnrctl status</code>
  • The output will show the status of the currently running listener, including the port number.

Step 2: Use SQL Query

  • Connect to the database using SQL*Plus or another Oracle client.
  • Enter the following query:
<code>SELECT value FROM v$parameter WHERE name = 'local_listener'</code>
  • The results will display the listener name.

Step 3: Obtain the port number from the listener name

  • Use the LISTEN command to query the listener configuration and obtain the port number:
<code>lsnrctl status <监听器名称></code>
  • The output will show the port number.

Example

If the listener is named LISTENER, the query command is:

<code>lsnrctl status LISTENER</code>

The output is similar to:

<code>Status of the LISTENER listener
--------------------------------
Version             12.1.0.2.0
Start Date          13-MAY-19
Uptime              0 days 16 hours 47 minutes 04 seconds
Trace Level         off
Security             ON: Local OS Authentication
SNMP                 OFF
Default Service     orcl
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
  "DEDICATED" established:10035927 received:14858731401 connect time:2934511431842 sent:0 bytes
  Protocol Address         Connect Data
  TCP     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOSTNAME>)(PORT=1521)))</code>

In this example, the port number of the Oracle database is 1521.

The above is the detailed content of How to check the oracle database port number. 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