How do I change the listening port of the Oracle database

Publication Date:  2016-11-11 Views:  315 Downloads:  0
Issue Description
How do I change the listening port of the Oracle database
Solution

1. Log in to the Linux operating system as the oracle user.

2. Check the current listening status.
lsnrctl status esightlistener

3. Stop the listening service.
lsnrctl stop esightlistener

4. Change the port number in the files tnsnames.ora and listener.ora.
cd /opt/oracle/product/11.2.0/db_1/network/admin/The listening file listener.ora is used as an example to describe how to change the listening port, for example, 31521 to a new listening port.

vi listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = esight)
(SID_NAME = esight)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = REGISTER))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.137.59.87)(PORT = 31521))
)
)

SECURE_REGISTER_LISTENER=(IPC)

5. Modify the initialization parameter local_listener.
sqlplus / as sysdba
show parameter local_listener
alter system set local_listener="(address=(protocol=tcp)(host=10.137.59.87)(port=31521))";
exit

6. Start the listening service.
lsnrctl start esightlistener

7. After the change is complete, log in and test the new listening port.
a. Check whether the listening port is changed.
netstat -na | grep "31521"
b. Check the listening status.
lsnrctl status esightlistener

END