大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说oracle 11G rac 环境下修改IP地址「建议收藏」,希望您对编程的造诣更进一步.
[grid@orcl1 ~]$ /u01/app/grid/11.2.0/dbhome_1/bin/oifcfg getif ens33 192.168.133.0 global public
ens38 10.10.1.0 global cluster_interconnect
|
[grid@orcl1 ~]$ srvctl config nodeapps -a
Network exists: 1/192.168.133.0/255.255.255.0/ens33, type static
VIP exists: /orcl1-vip/192.168.133.114/192.168.133.0/255.255.255.0/ens33, hosting node orcl1
VIP exists: /orcl2-vip/192.168.133.115/192.168.133.0/255.255.255.0/ens33, hosting node orcl2
|
[grid@orcl1 ~]$ crsctl stat res ora.orcl1.vip
NAME=ora.orcl1.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=ONLINE on orcl1
[grid@orcl2 ~]$ crsctl stat res ora.orcl2.vip
NAME=ora.orcl2.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=ONLINE on orcl2
|
停掉监听及VIP资源
srvctl stop listener -n orcl1
srvctl stop vip -n orcl1 -f
|
$ srvctl stop instance -d orcl -n orcl1
$ srvctl stop instance -d orcl -n orcl2
|
备份profile.xml文件
cd /u01/app/grid/11.2.0/dbhome_1/gpnp/racdb1/profiles/peer
cp -p profile.xml profile.xml.bak
|
停掉并禁用CRS
/u01/app/grid/11.2.0/dbhome_1/bin/crsctl stop crs
/u01/app/grid/11.2.0/dbhome_1/bin/crsctl disable crs
|
在操作系统上完成网络相关更改
[root@orcl1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public ip
192.168.133.104 orcl1
192.168.133.105 orcl2
#priv ip
10.10.1.14 orcl1-priv
10.10.1.15 orcl2-priv
#vip ip
192.168.133.114 orcl1-vip
192.168.133.115 orcl2-vip
#scan ip
192.168.133.106 orcl-scan
|
[root@orcl1 ~]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 #public ip 192.168.133.154 orcl1 192.168.133.155 orcl2 #priv ip 10.10.1.14 orcl1-priv 10.10.1.15 orcl2-priv #vip ip 192.168.133.164 orcl1-vip 192.168.133.165 orcl2-vip #scan ip
192.168.133.166 orcl-scan
|
修改VIP设置并启动VIP及监听资源
[root@orcl1 ~]# /u01/app/grid/11.2.0/dbhome_1/bin/srvctl modify nodeapps -n orcl1 -A racdb1-vip/255.255.255.0
|
[grid@orcl1 ~]$ srvctl config nodeapps -a
Network exists: 1/192.168.133.0/255.255.255.0/ens33, type static
VIP exists: /orcl1-vip/192.168.133.164/192.168.133.0/255.255.255.0/ens33, hosting node orcl1
VIP exists: /orcl2-vip/192.168.133.165/192.168.133.0/255.255.255.0/ens33, hosting node orcl2
|
$ srvctl start vip -n orcl1
$ srvctl start vip -n orcl2
$ srvctl start listener -n orcl1
$ srvctl start listener -n orcl2
|
$ srvctl start instance -d orcl -n orcl1
$ srvctl start instance -d orcl -n orcl2
|
更改SCAN IP地址
#scan ip
192.168.133.106 orcl-scan
|
#scan ip
192.168.133.166 orcl-scan
|
[grid@orcl1 ~]$ srvctl config scan
SCAN name: orcl-scan, Network: 1/192.168.133.0/255.255.255.0/ens33
SCAN VIP name: scan1, IP: /orcl-scan/192.168.133.106
|
[grid@orcl1 ~]$ srvctl stop scan_listener
|
[grid@orcl1 ~]$ srvctl stop scan
|
[root@orcl1 ~]# /u01/app/grid/11.2.0/dbhome_1/bin/srvctl modify scan -n orcl-scan
|
[grid@orcl1 ~]$ srvctl config scan
SCAN name: orcl-scan, Network: 1/192.168.133.0/255.255.255.0/ens33
SCAN VIP name: scan1, IP: /orcl-scan/192.168.133.166
|
[grid@orcl1 ~]$ srvctl start scan
[grid@orcl1 ~]$ srvctl start scan_listener
|
[grid@orcl1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node orcl2
[grid@orcl1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node orcl2
[grid@orcl1 ~]$ crsctl stat res ora.scan1.vip ora.LISTENER_SCAN1.lsnr
NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on orcl2
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on orcl2
|
启用并启动CRS
/u01/app/grid/11.2.0/dbhome_1/bin/crsctl enable crs
/u01/app/grid/11.2.0/dbhome_1/bin/crsctl start crs
|
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/9947.html