Steps for the 11gR2 RAC of Oracle to modify the listener port number
Oracle 11gR2 RAC To modify listener port numbers
Description:
192.168.188.181 is public ip1
192.168.188.182 is public ip2
192.168.188.183 for vip1
192.168.188.184 for vip2
1. Modify DB listening port
Note:
The OS for this article is RHEL 6.5 and DB version is 11.2.0.3.8.
Changing Listener Ports On RAC/EXADATA (Doc ID 1473035.1)
2. This article modified the port number of the following listener to 1528
Port number of cluster listener
Port number of Node 1 local listener
Port number of Node 2 local listener
3. According to Changing Listener Ports On RAC/EXADATA (Doc ID 1473035.1), it takes a quiet time to modify the listener port number.
Check before modification
[grid@hosta admin]$ srvctl config listener
Name: LISTENER
Network: 1, Owner: grid
Home:
End points: TCP:1521
[grid@hosta admin]$
1. Executed on only one host
[grid@hosta admin]$ srvctl modify listener -l LISTENER -p "TCP:1528"
2. Executes on only one host
[grid@hosta ~]$ srvctl modify scan_listener -p 1528
3. Modifying LOCAL_LISTENER is performed on only one host
alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.188.183)(PORT = 1528))' scope=both sid='orcl1';
alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.188.184)(PORT = 1528))' scope=both sid='orcl2';
4. modify remote_listener
alter system set remote_listener='orcl-scan:1528' scope=both;
5.
Turn off local listening at the first node
[grid@hosta ~]$ srvctl stop listener -l LISTENER -n hosta
Modify the $GI_HOME/network/admin/endpoints_listener.ora file for the first node to change 1521 to 1528
[grid@hosta admin]$ cat listener.ora---> This file does not store port numbers, so do not modify them.
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
[grid@hosta admin]$ cat endpoints_listener.ora ---> This file stores port numbers. Modify this file.
LISTENER_HOSTA=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hosta-vip)(PORT=1528))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.188.181)(PORT=1528)(IP=FIRST)))) # line added by Agent
[grid@hosta admin]$
Start local listening on the first node
[grid@hosta admin]$ srvctl start listener -l LISTENER -n hosta
Do the same on the second node.
[grid@hostb ~]$ srvctl stop listener -l LISTENER -n hostb
Modify endpoints_listener.ora file, no longer posted
[grid@hostb admin]$ srvctl start listener -l LISTENER -n hostb
6. Confirm modification effect
[grid@hostb admin]$ srvctl config Listener
Name: LISTENER
Network: 1, Owner: grid
Home:
End points: TCP:1528
II. Modify ASM listening port
Modifying ASM LOCAL_LISTENER is performed on only one host
sqlplus / as sysasm;
alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.188.183)(PORT = 1528))' scope=both sid='asm1';
alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.188.184)(PORT = 1528))' scope=both sid='asm2';
After that, the application connection string and dblink definition modify the port number, and start the service for testing.