分享更有价值
被信任是一种快乐

oracle 11gR2RAC如何修改public ip

文章页正文上

这篇文章给大家分享的是有关oracle 11gR2RAC如何修改public ip的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。Ⅰ修改public 选择一个节点(这里选择rac1)查看hosts设置
[root@rac2 bin]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.215.188 rac1
192.168.215.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.215.120 rac1-vip
192.168.215.121 rac2-vip
#scan
192.168.215.122 scanip

查看crs资源状态
[root@rac2 bin]# ./crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.OCR.dg
ONLINE OFFLINE rac1
ONLINE OFFLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.orcl.ssss.svc
1 ONLINE ONLINE rac2
2 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2
OCR磁盘组是offline,查下ocr状态
grid@rac1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3388
Available space (kbytes) : 258732
ID : 1954953290
Device/File Name : +OCRA
Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check bypassed due to non-privileged user

发现无效的磁盘组OCR免费主机域名,那么删掉 (这一步是我之前做实验替换了ocr的,直接略)
[grid@rac1 ~]$ srvctl remove diskgroup -g OCR
[grid@rac1 ~]$ crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac2
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.orcl.ssss.svc
1 ONLINE ONLINE rac2
2 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac2

查看当前public配置
[root@r免费主机域名ac1 bin]# ./oifcfg getif
eth2 10.0.0.0 global cluster_interconnect
eth0 192.168.215.0 global public
显示为215网段,那么要改为56网段

[root@rac1 bin]# ./oifcfg delif -global eth0/192.168.215.0 #删掉215网段

[root@rac1 bin]# ./oifcfg setif -global eth0/192.168.56.0:public #设置56网段
[root@rac1 bin]# ./oifcfg getif #查看修改情况两个节点都看一下
eth2 10.0.0.0 global cluster_interconnect
eth0 192.168.56.0 global public

[root@rac2 bin]# ./oifcfg getif
eth2 10.0.0.0 global cluster_interconnect
eth0 192.168.56.0 global public
修改两节点hosts文件 只改pubic ip 的网段
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.56.188 rac1
192.168.56.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.215.120 rac1-vip
192.168.215.121 rac2-vip
#scan
192.168.215.122 scanip
修改实际public地址为56网段的,两个节点都要改。
[root@rac1 bin]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:9c:25:21
TYPE=Ethernet
UUID=c2ec39dd-92bf-41fc-8d41-21d78536c9f9
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.56.189
NETMASK=255.255.255.0
GATEWAY=192.168.56.1
IPV6INIT=no
USERCTL=no
修改完后service network restart
Ⅱ修改vip 依然选择rac1(官方文档中是停一个节点修改这个节点,然后启动在修改下一个节点)
停止节点1的实例和vip资源
[root@rac1 bin]# ./srvctl stop instance -d orcl -n rac1
[root@rac1 bin]# ./srvctl stop vip -n rac1 -f
PRCC-1017 : 192.168.215.190 was already stopped on rac1
PRCR-1005 : Resource ora.rac1.vip is already stopped
修改两节点对应的vip
[root@rac1 bin]# ./srvctl modify nodeapps -n rac1 -A 192.168.56.120/255.255.255.0/eth0
[root@rac1 bin]# ./srvctl modify nodeapps -n rac2 -A 192.168.56.121/255.255.255.0/eth0
查看结果
[root@rac1 bin]# ./srvctl config nodeapps -a
Network exists: 1/192.168.56.0/255.255.255.0/eth0, type static
VIP exists: /192.168.56.120/192.168.56.120/192.168.56.0/255.255.255.0/eth0, hosting node rac1
VIP exists: /192.168.56.121/192.168.56.121/192.168.56.0/255.255.255.0/eth0, hosting node rac2
重启vip和instance
[root@rac1 bin]# ./srvctl start vip -n rac1
PRKO-2420 : VIP is already started on node(s): rac1
[root@rac1 bin]# ./srvctl start listener -n rac1
PRCC-1015 : LISTENER was already running on rac1
PRCR-1004 : Resource ora.LISTENER.lsnr is already running

[root@rac1 bin]# ./srvctl start instance -d orcl -n rac1
PRCC-1015 : orcl was already running on rac1
PRCR-1004 : Resource ora.orcl.db is already running
自己重启了?看一下资源状态
[root@rac1 bin]# ./crsctl stat res -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.FRA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
ora.gsd
OFFLINE OFFLINE rac1
OFFLINE OFFLINE rac2
ora.net1.network
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.ons
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.registry.acfs
ONLINE ONLINE rac1
ONLINE ONLINE rac2
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac2
ora.oc4j
1 ONLINE ONLINE rac2
ora.orcl.db
1 ONLINE ONLINE rac1 Open
2 ONLINE ONLINE rac2 Open
ora.orcl.ssss.svc
1 ONLINE ONLINE rac2
2 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 ONLINE ONLINE rac2
ora.scan1.vip
1 ONLINE ONLINE rac1
[root@rac1 bin]#
修改两节点hosts文件
[root@rac1 bin]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.56.188 rac1
192.168.56.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.56.120 rac1-vip
192.168.56.121 rac2-vip
#scan
192.168.215.122 scanip

~
Ⅲ修改scanip (这次选择rac2)
我的scanip 名字就叫scanip

[root@rac2 bin]# ./srvctl config scan
SCAN name: scanip, Network: 1/192.168.56.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scanip/192.168.215.122
#显示还是215网段
停止scan和listener
[root@rac2 bin]# ./srvctl stop scan_listener
[root@rac2 bin]# ./srvctl stop scan
修改两节点hosts文件
[root@rac2 bin]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
#public
192.168.56.188 rac1
192.168.56.189 rac2
#private
10.0.0.118 rac1-priv
10.0.0.119 rac2-priv
#vip
192.168.56.120 rac1-vip
192.168.56.121 rac2-vip
#scan
192.168.56.122 scanip #修改为56网段
修改scanip
[root@rac2 bin]# ./srvctl modify scan -n scanip #刷新scanip,实际上从hosts中读取地址
[root@rac2 bin]# ./srvctl config scan #查看刷新情况
SCAN name: scanip, Network: 1/192.168.56.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scanip/192.168.56.122
修改成功,重启scan和listener
[root@rac2 bin]# ./srvctl start scan
[root@rac2 bin]# ./srvctl start scan_listener
感谢各位的阅读!关于“oracle 11gR2RAC如何修改public ip”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

相关推荐: mysqldumpslow日志分析的案例

小编给大家分享一下mysqldumpslow日志分析的案例,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!一、mysqldumpslow官方文档:http://dev.mysql.com/doc/refman/5.1/en/mysqldumps…

文章页内容下
赞(0) 打赏
版权声明:本站采用知识共享、学习交流,不允许用于商业用途;文章由发布者自行承担一切责任,与本站无关。
文章页正文下
文章页评论上

云服务器、web空间可免费试用

宝塔面板主机、支持php,mysql等,SSL部署;安全高速企业专供99.999%稳定,另有高防主机、不限制内容等类型,具体可咨询QQ:360163164,Tel同微信:18905205712

主机选购导航云服务器试用

登录

找回密码

注册