Visit Counter

Monday, January 11, 2021

Change the listening port of the Oracle database



I changed Oracle database listener default port 1521 to 1529.


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


2. Check the current listening status.
lsnrctl status PROD

3. Stop the listening service.
lsnrctl stop PROD

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, 1529 to a new listening port.

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

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = REGISTER))
(ADDRESS = (PROTOCOL = TCP)(HOST = test12.com)(PORT = 1529))
)
)

SECURE_REGISTER_LISTENER=(IPC)

Note: (Make Sure you are using SPFILE....if you pfile then edit pfile save it restart the database)

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

6. Start the listening service.
lsnrctl start PROD

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 "1521"
b. Check the listening status.
lsnrctl status PROD

No comments:

Post a Comment