Oracle 11gR2 RAC 修改監聽器埠號的步驟
阿新 • • 發佈:2019-01-06
Oracle 11gR2 RAC 修改監聽器埠號的步驟
參考自:
Changing Listener Ports On RAC/EXADATA (文件 ID 1473035.1)
注意:
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來修改監聽器埠號
修改前的檢查
[[email protected] admin]$ srvctl config listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1521
[[email protected] admin]$
1.僅僅在一個主機上執行
[[email protected] admin]$ srvctl modify listener -l LISTENER -p "TCP:1528"
2.僅僅在一個主機上執行
[[email protected] ~]$ 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.
在第一個節點關閉本地監聽
[[email protected] ~]$ srvctl stop listener -l LISTENER -n hosta
修改第一個節點的$GI_HOME/network/admin/endpoints_listener.ora檔案,將1521改為1528
[[email protected] 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
[[email protected] 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
[[email protected] admin]$
啟動第一個節點本地監聽
[[email protected] admin]$ srvctl start listener -l LISTENER -n hosta
在第二個節點上進行相同的操作。
[[email protected] ~]$ srvctl stop listener -l LISTENER -n hostb
修改endpoints_listener.ora檔案,不再貼出
[[email protected] admin]$ srvctl start listener -l LISTENER -n hostb
6.確認修改效果
[[email protected] admin]$ srvctl config Listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1528
之後,應用程式連線串以及dblink的定義修改埠號,啟動業務進行測試即可。