How to change the port number for Oracle database?

To modify the port number of the Oracle database, you can follow these steps:

  1. Access the listener configuration file for the Oracle database. Locate the listener.ora file in the Oracle database installation directory, usually found under the $ORACLE_HOME/network/admin directory.
  2. Open the listener.ora file and locate the line that contains the port number for the listener. The port number is usually defined in a line similar to the following format:
  3. LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = port_number))
    )
    )
  4. The port_number is the port number of the listener.
  5. Change the port number to the desired new port number.
  6. Save the file and then close it.
  7. Restart the Oracle listener by entering the following command in the command line.
  8. Stop the listener
    Start the listener
  9. Confirm if the port number change was successful. You can use the telnet command to test if the new port can be connected to.
  10. Connect to the specified hostname using the new port number with telnet.

Before changing the Oracle database port number, make sure to backup the data and related configuration files to prevent any accidents that could result in data loss.

bannerAds