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

How to change the oracle database port

下次还敢
下次还敢Original
2024-04-18 21:03:17911browse

Oracle database port modification guide: Stop the database service; modify the value of PORT in the listener configuration; modify the value of ORACLE_PORT in the database configuration; restart the listener and database; use the netstat command to verify that the port has been changed.

How to change the oracle database port

Oracle Database Port Modification Guide

Question: How to modify the Oracle database port?

Answer:

The steps to modify the Oracle database port are as follows:

Step 1: Stop the database service

<code>systemctl stop oracle-xe</code>

Step 2: Modify the listener configuration

Modify the listener configuration located at /etc/oracle/listener.ora. Find the following line:

<code>LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
  )</code>

Change PORT=1521 to your desired port number.

Step 3: Modify the database configuration

Modify the database configuration located at /etc/sysconfig/oracle-xe. Find the following line:

<code>ORACLE_PORT=1521</code>

Change <code>ORACLE_PORT=1521</code> to the same port number set in step 2.

Step 4: Restart listeners and database

<code>systemctl start oracle-xe-listener
systemctl start oracle-xe</code>

Step 5: Verify changes

Use netstat Command to verify that the port has been changed:

<code>netstat -nlpt | grep oracle</code>

The output should show the new port.

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