Oracle 11gR2 RAC 修改监听器端口号的步骤
说明:
192.168.188.181 为public ip1
192.168.188.182 为public ip2
192.168.188.183 为vip1
192.168.188.184 为vip2
一、修改 DB 监听端口
注意:
1.本文的os是RHEL6.5,DB版本是11.2.0.3.8。
本文非exadata环境,若是Exadata环境,请读Changing Listener Ports On RAC/EXADATA (文档 ID 1473035.1)
2.本文修改了如下监听器的端口号,改为1528
集群监听器的端口号
节点1本地监听器的端口号
节点2本地监听器的端口号
3.根据 Changing Listener Ports On RAC/EXADATA (文档 ID 1473035.1),需要在a quiet time来修改监听器端口号
修改前的检查
[grid@hosta admin]$ srvctl config listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1521
[grid@hosta admin]$
1.仅仅在一个主机上执行
[grid@hosta admin]$ srvctl modify listener -l LISTENER -p "TCP:1528"
2.仅仅在一个主机上执行
[grid@hosta ~]$ srvctl modify scan_listener -p 1528
3.修改LOCAL_LISTENER仅仅在一个主机上执行
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.修改remote_listener
alter system set remote_listener='orcl-scan:1528' scope=both;
5.
在第一个节点关闭本地监听
[grid@hosta ~]$ srvctl stop listener -l LISTENER -n hosta
修改第一个节点的$GI_HOME/network/admin/endpoints_listener.ora文件,将1521改为1528
[grid@hosta admin]$ cat listener.ora--->该文件中不存储端口号,因此不用修改。
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 --->该文件中存储端口号,修改本文件即可。
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]$
启动第一个节点本地监听
[grid@hosta admin]$ srvctl start listener -l LISTENER -n hosta
在第二个节点上进行相同的操作。
[grid@hostb ~]$ srvctl stop listener -l LISTENER -n hostb
修改endpoints_listener.ora文件,不再贴出
[grid@hostb admin]$ srvctl start listener -l LISTENER -n hostb
6.确认修改效果
[grid@hostb admin]$ srvctl config Listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1528
二、 修改 ASM 监听端口
修改 ASM LOCAL_LISTENER 仅仅在一个主机上执行
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';
之后,应用程序连接串以及dblink的定义修改端口号,启动业务进行测试即可。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。