溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

oracle 11gr2rac如何修改ip地址

發(fā)布時(shí)間:2021-11-09 11:08:42 來(lái)源:億速云 閱讀:153 作者:小新 欄目:關(guān)系型數(shù)據(jù)庫(kù)

這篇文章主要介紹了oracle 11gr2rac如何修改ip地址,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

oracle 11g rac 修改IP

在一套R(shí)AC上修改了IP。包括pub,vip,scan5個(gè)IP。借鑒的文檔如下:

11GR2 RAC modify vip,public ip,private ip,scan vip
實(shí)施步驟
1 修改目的
根據(jù)業(yè)務(wù)的需求,需要由原來(lái)的臨時(shí)IP改為生產(chǎn)ip,以下為調(diào)整前后對(duì)應(yīng)的IP表
調(diào)整前對(duì)應(yīng)ip表

主機(jī)名          類型         IP 地址         網(wǎng)卡端口
P570a    public ip   192.168.128.10  en0
p570a-vip vip         192.168.128.12  en0
p570a-priv private ip 172.168.128.10 en2
p570b    public ip   192.168.128.11 en0
p570b-vip  vip        192.168.128.13  en0
p570b-priv private ip  172.168.128.11 en2
scan-vip scan  192.168.128.100  en0
調(diào)整后對(duì)應(yīng)ip表
主機(jī)名      類型       IP 地址     網(wǎng)卡端口
P570a  public ip   10.76.31.112  en0
p570a-vip   vip  10.76.31.113     en0
p570a-priv  private ip  192.76.31.113  en8
p570b  public ip  10.76.31.114   en0
p570b-vip  vip   10.76.31.115   en0
p570b-priv  private ip  192.76.31.115  en8
scan-vip   scan    10.76.31.111  en0
網(wǎng)卡端口可以用ifconfig -a 顯示出來(lái)
2 修改public ip,vip,scan vip
2.1 停止兩邊節(jié)點(diǎn)數(shù)據(jù)庫(kù),監(jiān)聽(tīng),并且停止crs
grid用戶
srvctl stop database -d gdcdc -o immediate
srvctl stop listener -n p570a
srvctl stop listener -n p570b
root用戶
cd /grid/app/11.2.0/grid/bin
./crsctl stop crs
可以用ps –ef|grep grid看進(jìn)程是否完全關(guān)閉
2.2 修改兩邊節(jié)點(diǎn)的/etc/hosts文件
修改前先做個(gè)備份
cp /etc/hosts /etc/hosts.bak
修改后如下所示:
10.76.31.112 p570a
10.76.31.113 p570a-vip
172.168.128.10 p570a-priv
10.76.31.114 p570b
10.76.31.115 p570b-vip
172.168.128.11 p570b-priv
10.76.31.111 scan-vip
注意這里私網(wǎng)ip地址暫時(shí)先不做修改,修改private ip時(shí)再修改
2.3 修改兩個(gè)節(jié)點(diǎn)上的public ip,vip,scan vip
2.3.1修改p570a節(jié)點(diǎn) public ip
用smitty命令修改物理ip
smitty tcpip
選擇en0
修改ip為 10.76.31.112,網(wǎng)關(guān)為10.76.31.1
掩碼為 255.255.255.0
2.3.2修改P570b節(jié)點(diǎn) public ip
用smitty命令修改物理ip
smitty tcpip
選擇en0
修改ip為 10.76.31.114,網(wǎng)關(guān)為10.76.31.1
掩碼為255.255.255.0
2.3.3兩邊節(jié)點(diǎn)啟動(dòng)crs,用oifcfg 命令修改public ip
一邊節(jié)點(diǎn)做即可
cd /grid/app/11.2.0/grid/bin
./crsctl start crs
root用戶
先用oifcfg getif查看當(dāng)前設(shè)置
./oifcfg getif
en0 192.168.128.0 global public
en2 172.168.128.0 global cluster_interconnect
修改
./oifcfg delif -global en0
./oifcfg setif -global en0/10.76.31.0:public
兩邊節(jié)點(diǎn)確認(rèn)
./oifcfg getif
en0 10.76.31.0 global public
en2 172.168.128.0 global cluster_interconnect
2.3.4修改VIP
關(guān)閉database
root用戶下運(yùn)行以下命令
cd /grid/app/11.2.0/grid/bin
./srvctl stop database -d gdcdc -o immediate
用srvctl config vip 檢查vip設(shè)置
$ srvctl config vip -n p570a
VIP exists.:p570a
VIP exists.: /p570a-vip/192.168.128.12/255.255.255.0/eth0
$ srvctl config vip -n p570b
VIP exists.:p570b
VIP exists.: /p570b-vip/192.168.128.13/255.255.255.0/eth0
停止vip 服務(wù)和修改vip
./srvctl stop listener -n p570a
./srvctl stop listener -n p570b
./srvctl stop vip -n p570a
./srvctl stop vip -n p570b
./srvctl modify nodeapps -n p570a -A 10.76.31.113/255.255.255.0/en0
./srvctl modify nodeapps -n p570b -A 10.76.31.115/255.255.255.0/en0
確認(rèn)是否修改成功
./srvctl config vip -n p570a
VIP exists.:p570a
VIP exists.:/p570a-vip/10.76.31.113/255.255.255.0/en0
./srvctl config vip -n p570b
VIP exists.:p570b
VIP exists.:/p570b-vip/10.76.31.115/255.255.255.0/en0
啟動(dòng)vip服務(wù),監(jiān)聽(tīng),數(shù)據(jù)庫(kù)
./srvctl start vip -n p570a
./srvctl start vip -n p570b
./srvctl start listener -n p570a
./srvctl start listener -n p570b
./srvctl start database –d gdcdc
2.3.5 兩邊節(jié)點(diǎn)修改local_listener參數(shù)
Show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=192.
168.128.12)(PORT=1521))))
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.76.31.113)(PORT=1521))))' scope=both sid='gdcdc1';
alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.76.31.115)(PORT=1521))))' scope=both sid='gdcdc2'; 第6頁(yè)共11頁(yè)
2.3.6修改SCAN VIP
1.srvctl config scan 查看當(dāng)前vip設(shè)置
config scan SCAN name: 192.168.128.100, Network: 1/192.168.128.0/255.255.255.0/en0 SCAN VIP name: scan1, IP: /scan-vip/192.168.128.100
2.用root用戶停止scan_listener 和sacn vip
$GRID_HOME/bin/srvctl stop scan_listener $GRID_HOME/bin/srvctl stop scan $GRID_HOME/bin/srvctl status scan
SCAN VIP scan1 is enabled SCAN VIP scan1 is not running
$GRID_HOME/bin/srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is not running
3.用root用戶修改scan vip
$GRID_HOME/bin/srvctl modify scan -n10.76.31.111
4.檢查是否修改成功
config scan SCAN name: 10.76.31.111 , Network: 1/10.76.31.0/255.255.255.0/en0 SCAN VIP name: scan1, IP: /scan-vip/10.76.31.111
5.啟動(dòng)scan和scan_listener
$GRID_HOME/bin/srvctl start scan $GRID_HOME/bin/srvctl start scan_listener
3 修改 private ip
3.1 確保crs集群是打開(kāi)的
可以用olsnodes –s 檢查集群的狀態(tài)
./olsnodes -s
P570a Active
P570b Active
3.2 用oifcfg getif 檢查和oifcfg setif修改當(dāng)前private 設(shè)置
修改前設(shè)置
./oifcfg getif
en0 10.76.31.0 global public
en2 172.168.128.0 global cluster_interconnect
修改private ip,新網(wǎng)絡(luò)端口號(hào)為en8,如果沒(méi)有修改端口號(hào),則設(shè)置的值
還是為en2
./oifcfg setif -global en8/192.76.31.0:cluster_interconnect
./oifcfg delif -global en2
修改后設(shè)置
./oifcfg getif
en0 10.76.31.0 global public
en8 192.76.31.0 global cluster_interconnect
3.3 兩邊節(jié)點(diǎn)停止database和crs
./srvctl stop database -d gdcdc -o immedate
./crsctl stop crs
檢查是否關(guān)閉
ps -ef|grep grid
ps -ef|grep oracle
3.4 修改兩邊節(jié)點(diǎn)/etc/hosts表
172.168.128.10 p570a-priv
172.168.128.11 p570b-priv
修改為
192.76.31.113 p570a-priv
192.76.31.115 p570b-priv
3.5 修改p570a節(jié)點(diǎn) private ip
用smitty命令修改物理私網(wǎng)ip
smitty tcpip
選擇en8
修改ip為 192.76.31.113 掩碼為 255.255.255.0
3.6 修改P570b節(jié)點(diǎn) private ip
用smitty命令修改物理私網(wǎng)ip
smitty tcpip
選擇en8
修改ip為 192.76.31.115 掩碼為 255.255.255.0
3.7 兩邊節(jié)點(diǎn)啟動(dòng)crs
crsctl start crs
檢查資源組狀態(tài)
crsctl status resource –t
如果都o(jì)nline,則沒(méi)問(wèn)題。
4 實(shí)施總結(jié)
1. 在修改public ip時(shí)注意修改對(duì)應(yīng)的正確網(wǎng)關(guān),如果不修改,有可能導(dǎo)致vip服務(wù)起不來(lái)。
2. 注意檢查修改hosts文件,因?yàn)楦膇p后,hosts文件會(huì)增加記錄。
public ip對(duì)應(yīng)的掩碼也要修改正確,
3. 主機(jī)名在安裝crs時(shí)要規(guī)劃好,一旦裝好后,就不能修改,否則要重新安裝crs。
4. 11GR2 srvctl 新增 config vip命令
5. 修改private ip的順序剛好和10gR2相反,10gR2是先關(guān)閉crs,然后修改hosts表和物理ip,再啟動(dòng)crs,用oifcfg 設(shè)置新私網(wǎng)ip,這點(diǎn)要注意,否則按10gR2修改私網(wǎng)的方法,會(huì)導(dǎo)致CRS集群起不來(lái),所以做之前先做好備份。
6. 如果兩邊節(jié)點(diǎn)local_listener參數(shù)沒(méi)修改的話,會(huì)導(dǎo)致客戶端連接不到數(shù)據(jù)庫(kù)報(bào)ERROR:ORA-12516: TNS: 監(jiān)聽(tīng)程序找不到符合協(xié)議堆棧要求的可用處理程序,這是因?yàn)閟can_listener 認(rèn)到的還是修改前的vip
[grid@p570b:/grid/app]$lsnrctl
LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production on 18-MAR-2010 14:19:15
Copyright (c) 1991, 2009, Oracle. All rights reserved.
LSNRCTL> set current listener_scan1
Current Listener is listener_scan1
LSNRCTL> services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
Services Summary...
Service "gdcdc" has 2 instance(s).
Instance "gdcdc1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0 state:blocked
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.128.12)(PORT=1521)))
Instance "gdcdc2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)( HOST=192.168.128.13)(PORT=1521)))
修改local_listener參數(shù)后
[grid@p570a:/grid/app]$lsnrctl services listener_scan1
LSNRCTL for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production on 19-MAR-2010 09:47:50
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
Services Summary...
Service "gdcdc" has 2 instance(s).
Instance "gdcdc1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.76.31.113)(PORT=1521)))
Instance "gdcdc2", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.76.31.115)(PORT=1521)))

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“oracle 11gr2rac如何修改ip地址”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI