Home  >  Article  >  Database  >  How to query the oracle database port

How to query the oracle database port

下次还敢
下次还敢Original
2024-04-19 01:03:181051browse

Oracle database can query the port through the following methods: use the netstat command (such as netstat -an | grep oracle) to find the listening port; use Oracle SQL to query the V$LISTENER view (such as SELECT * FROM V$LISTENER); use Oracle Enterprise Manager View the "Listener Port" value in the "Connections" section. The default port for Oracle database is 1521, but this can be changed if necessary.

How to query the oracle database port

Oracle database port query method

To query the Oracle database port, you can use the following method:

1. Use the command line

  • Enter the following command in the terminal window:
<code>netstat -an | grep oracle</code>
  • Find output similar to the following:
<code>tcp        0      0 0.0.0.0:1521              0.0.0.0:*               LISTEN</code>
  • 1521 is the default port of the Oracle database.

2. Use Oracle SQL query

  • to connect to the Oracle database.
  • Run the following query:
<code>SELECT * FROM V$LISTENER;</code>
  • The query results will display the port of the listener, similar to the following:
<code>HOST               PORT
---------------- ----------
MYHOSTNAME          1521</code>

3. Use Oracle Enterprise Manager (OEM)

  • to open the OEM console.
  • Navigate to the "Database" tab.
  • Select the database to query.
  • Click the "Details" tab.
  • In the "Connection" section, look for the "Listener Port" value.

Tip:

  • The default port for Oracle database is 1521, but it can be changed as needed.
  • To change the port, you need to modify the listener.ora file and it will take effect after the database is restarted.
  • Different operating systems may require different command syntax to execute the netstat command, for example, use netstat -a -o on Windows.

The above is the detailed content of How to query the oracle database 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