Change the default port 1521 in Oracle Server

There are times when we need to change the default port in which the Oracle server is listening to. In-order to change it, follow the below steps

Step 1. Update the port number in Listener.ora file to your desired port (say 1503)

Here is how your service entry in listener.ora looks like

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = aditya)(PORT = 1503))
)
)

Step 2: make sure that XE (SID_NAME = XE) service is registered by adding it to the listener.ora file as shown below. In this case XE is my service name, change the service name appropriately.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = XE)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
)
)

Step 3:  Reload the listener by using the command “lsnrctl reload” in command prompt.

Step 4: Restart the Service by using the command “net start OracleServiceXE” in command prompt.

Make sure that you restart the listener!

Advertisements