Oracle database port number query method
Step 1: Use Oracle listener
<code>lsnrctl status</code>
Step 2: Use SQL Query
<code>SELECT value FROM v$parameter WHERE name = 'local_listener'</code>
Step 3: Obtain the port number from the listener name
<code>lsnrctl status <监听器名称></code>
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!