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

How to query the oracle database port

下次还敢
Release: 2024-04-19 01:03:18
Original
1141 people have browsed it

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>
Copy after login
  • Find output similar to the following:
<code>tcp        0      0 0.0.0.0:1521              0.0.0.0:*               LISTEN</code>
Copy after login
  • 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>
Copy after login
  • The query results will display the port of the listener, similar to the following:
<code>HOST               PORT
---------------- ----------
MYHOSTNAME          1521</code>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template