How to change the Oracle database port number? Stop the database service. Edit the listener configuration file and replace the old port number with the new port number. Edit the database configuration file and replace the old port number with the new port number. Start the database service. Test whether the new port number was changed successfully.
Change the Oracle database port number
How to change the Oracle database port number?
Changing the Oracle database port number involves the following steps:
Step 1: Stop the Oracle database service
<code class="bash">lsnrctl stop</code>
Step 2: Edit the listener configuration file
Open the listener configuration file listener.ora. It is usually located in the following directory:
ORACLE_HOME\network\admin
/etc/oracle/listener.ora
<code class="text">LISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = old_port)) )</code>
old_port
with the new port number. Step 3: Edit the database configuration file
Open the database configuration file init.ora or spfile. They are typically located in the following directories:
ORACLE_HOME\database
/etc/oracle/init.ora
<code class="text"># LISTENER ADDRESS LISTENER = (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = old_port))</code>
old_port
with the new port number. Step 4: Start the Oracle database service
<code class="bash">lsnrctl start</code>
Step 5: Test the new port number
<code class="bash">tnsping hostname:<new_port></code>
If the connection is successful, the port number has been changed successfully. Otherwise, check that all settings are configured correctly.
The above is the detailed content of How to modify the oracle database port number. For more information, please follow other related articles on the PHP Chinese website!