Oracle 11.2 RAC改IP步驟

shytodear發表於2015-12-03
Oracle 11.2 RAC改IP步驟


參考文件:
How to Modify Public Network Information including VIP in Oracle Clusterware (Doc ID 276434.1)
How to update the IP address of the SCAN VIP resources (ora.scan{n}.vip) (Doc ID 952903.1)


一、檢查當前配置:
grid@liuqi2:/home/grid> srvctl config nodeapps
Network exists: 1/132.78.213.0/255.255.255.0/en6, type static
VIP exists: /liuqi1-vip/132.78.213.38/132.78.213.0/255.255.255.0/en6, hosting node liuqi1
VIP exists: /liuqi2-vip/132.78.213.40/132.78.213.0/255.255.255.0/en6, hosting node liuqi2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016


grid@liuqi2:/home/grid> srvctl config scan
SCAN name: liuqi-cluster-scan, Network: 1/132.78.213.0/255.255.255.0/en6
SCAN VIP name: scan1, IP: /liuqi-cluster-scan/132.78.213.41


grid@liuqi2:/home/grid> srvctl config network
Network exists: 1/132.78.213.0/255.255.255.0/en6, type static


grid@liuqi2:/home/grid> oifcfg getif
en6  132.78.213.0  global  public
en7  192.168.1.0  global  cluster_interconnect


grid@liuqi2:/home/grid> cat /etc/hosts
127.0.0.1               loopback localhost      # loopback (lo0) name/address
::1                     loopback localhost      # IPv6 loopback (lo0) name/address


132.78.213.37   liuqi1
132.78.213.38   liuqi1-vip
192.168.1.37    liuqi1-priv


132.78.213.39   liuqi2
132.78.213.40   liuqi2-vip
192.168.1.39    liuqi2-priv


132.78.213.41   liuqi-cluster-scan






-------Netbackup-----/
10.13.107.8     MSSM4KA
10.13.107.9     MSSM4KB
10.13.107.88    MSSM4KC
10.13.107.16    NBUMaster


#######NIM#######
132.77.135.4    DS_NIM




二、檢查當前狀態:
[grid@liuqi1: /home/grid]$crsctl stat res -t
[grid@liuqi1: /home/grid]$cs
確認VIP均ONLINE


grid@liuqi1:/home/grid> ifconfig -a
en5: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.168.128.12 netmask 0xffffff00 broadcast 192.168.128.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en6: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 132.78.213.37 netmask 0xffffff00 broadcast 132.78.213.255
        inet 132.78.213.38 netmask 0xffffff00 broadcast 132.78.213.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en7: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.168.1.37 netmask 0xffffff00 broadcast 192.168.1.255
        inet 169.254.38.160 netmask 0xffff0000 broadcast 169.254.255.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 1
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/0
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1


grid@liuqi2:/home/grid> ifconfig -a
en4: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.1.2.39 netmask 0xffffff00 broadcast 192.1.2.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en5: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.168.128.22 netmask 0xffffff00 broadcast 192.168.128.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en6: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 132.78.213.39 netmask 0xffffff00 broadcast 132.78.213.255
        inet 132.78.213.41 netmask 0xffffff00 broadcast 132.78.213.255
        inet 132.78.213.40 netmask 0xffffff00 broadcast 132.78.213.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 0
en7: flags=1e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),LARGESEND,CHAIN>
        inet 192.168.1.39 netmask 0xffffff00 broadcast 192.168.1.255
        inet 169.254.10.107 netmask 0xffff0000 broadcast 169.254.255.255
         tcp_sendspace 131072 tcp_recvspace 65536 rfc1323 1
lo0: flags=e08084b,c0<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,LARGESEND,CHAIN>
        inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255
        inet6 ::1%1/0
         tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1


三、準備:
停資料庫全部例項(以oracle使用者):
使用srvctl或sqlplus


停SCAN及其LISTENER(以grid使用者):
$GRID_HOME/bin/srvctl stop scan_listener
$GRID_HOME/bin/srvctl stop scan


停VIP及其LISTENER(以grid使用者):
$GRID_HOME/bin/srvctl stop vip -n liuqi1 -f
$GRID_HOME/bin/srvctl stop vip -n liuqi2 -f


確認資料庫已停、SCANIP、VIP、所有LISTENER為offline狀態


修改OCR中的網路卡定義(以grid使用者):
#grid使用者,對於11gR2需要在所有節點CRS均RUNNING狀態下進行,否則會報PRIF-33 and PRIF-32
$GRID_HOME/bin/oifcfg delif -global en6/132.78.213.0
$GRID_HOME/bin/oifcfg delif -global en6/132.77.134.0
$GRID_HOME/bin/oifcfg setif -global en6/132.77.134.128:public




四、作業系統層面修改(以root使用者):
修改網路卡上的IP地址為新地址
修改/etc/hosts,全部對應新地址:
127.0.0.1               loopback localhost      # loopback (lo0) name/address
::1                     loopback localhost      # IPv6 loopback (lo0) name/address


132.77.134.135   liuqi1
132.77.134.136   liuqi1-vip
192.168.1.37    liuqi1-priv


132.77.134.137   liuqi2
132.77.134.138   liuqi2-vip
192.168.1.39    liuqi2-priv


132.77.134.145   liuqi-cluster-scan




-------Netbackup-----/
10.13.107.8     MSSM4KA
10.13.107.9     MSSM4KB
10.13.107.88    MSSM4KC
10.13.107.16    NBUMaster


#######NIM#######
132.77.135.4    DS_NIM




五、修改VIP及SCAN IP (以root使用者):
#srvctl modify nodeapps -n <node> -A <new_vip_address or new_vip_hostname>/<netmask>/<[if1[if2...]]>
srvctl modify nodeapps -n liuqi1 -A liuqi1-vip/255.255.255.128/en6
srvctl modify nodeapps -n liuqi2 -A liuqi2-vip/255.255.255.128/en6
srvctl modify scan -n liuqi-cluster-scan


六、啟動VIP、SCAN等 (以grid使用者):
$GRID_HOME/bin/srvctl start vip -n liuqi1
$GRID_HOME/bin/srvctl start listener -n liuqi1
$GRID_HOME/bin/srvctl start vip -n liuqi2
$GRID_HOME/bin/srvctl start listener -n liuqi2
$GRID_HOME/bin/srvctl start scan
$GRID_HOME/bin/srvctl start scan_listener


檢查確認修改
srvctl config nodeapps -a
lsnrctl stat listener_scan1


七、啟動 (以oracle使用者):
啟動資料庫
檢查local_listener及remote_listener設定,必要的話修改
連線測試

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27126919/viewspace-1852121/,如需轉載,請註明出處,否則將追究法律責任。

相關文章