Oracle rac 修改vip & scan ip

背景介绍:

现在有个需求,主机的物理机迁移,为了让业务改动最小,要修改新主库的VIP & SCAN IP,同网段的修改vip & scan比较简单

ps: 过段时间要修改物理机的网段,届时再更新!

修改vip

--修改前VIP & SCAN-IP

修改前vip最后两位为23、24

修改前scan-ip最后两位为25、20

--修改后VIP & SCAN-IP

修改后vip最后两位为248、249

修改后scan-ip最后两位为225、220

--查看修改前的/etc/hosts

[root@d2-dbrac21 ~]# cat /etc/hosts | grep 'vip\|scan'

192.168.10.23 d2-dbrac21-vip

192.168.10.24 d2-dbrac22-vip

192.168.10.25 dbrac-scan

192.168.10.20 dbrac-scan

--查看ip

[root@d2-dbrac21 ~]# ip addr | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.21/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.23/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.25/24 brd 192.168.10.255 scope global secondary ens192:2

--查看集群设置

[root@d2-dbrac21 ~]# srvctl config nodeapps

Network 1 exists

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

Ping Targets:

Network is enabled

Network is individually enabled on nodes:

Network is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac21

VIP Name: d2-dbrac21-vip

VIP IPv4 Address: 192.168.10.23

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac22

VIP Name: d2-dbrac22-vip

VIP IPv4 Address: 192.168.10.24

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false

ONS is enabled

ONS is individually enabled on nodes:

ONS is individually disabled on nodes:

只更改 VIP & SCAN IP 后的/etc/hosts,两个节点都要改

[root@d2-dbrac21 ~]# cat /etc/hosts | grep 'vip\|scan'

192.168.10.248 d2-dbrac21-vip

192.168.10.249 d2-dbrac22-vip

192.168.10.225 dbrac-scan

192.168.10.220 dbrac-scan

--重启集群节点,两个节点,可以轮流重启

crsctl stop crs

crsctl start crs

--查看重启后的节点信息,vip 自动更改了

[root@d2-dbrac21 ~]# ip addr | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.21/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.248/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.20/24 brd 192.168.10.255 scope global secondary ens192:2

[root@d2-dbrac22 ~]# ip ad | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.22/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.249/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.20/24 brd 192.168.10.255 scope global secondary ens192:2

--查看集群中节点信息

[root@d2-dbrac21 ~]# srvctl config nodeapps

Network 1 exists

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

Ping Targets:

Network is enabled

Network is individually enabled on nodes:

Network is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac21

VIP Name: d2-dbrac21-vip

VIP IPv4 Address: 192.168.10.248

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

VIP exists: network number 1, hosting node d2-dbrac22

VIP Name: d2-dbrac22-vip

VIP IPv4 Address: 192.168.10.249

VIP IPv6 Address:

VIP is enabled.

VIP is individually enabled on nodes:

VIP is individually disabled on nodes:

ONS exists: Local port 6100, remote port 6200, EM port 2016, Uses SSL false

ONS is enabled

ONS is individually enabled on nodes:

ONS is individually disabled on nodes:

修改scan-ip

--停止监听

srvctl stop scan_listener

srvctl stop scan

--查看更改前的scan

srvctl config scan

[root@d2-dbrac21 ~]# srvctl config scan

SCAN name: dbrac-scan, Network: 1

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

SCAN 1 IPv4 VIP: 192.168.10.20

SCAN VIP is enabled.

SCAN 2 IPv4 VIP: 192.168.10.25

SCAN VIP is enabled.

--修改在CRS中SCAN的配置

srvctl modify scan -n dbrac-scan

--验证修改结果

srvctl config scan

[root@d2-dbrac21 ~]# srvctl config scan

SCAN name: dbrac-scan, Network: 1

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

SCAN 1 IPv4 VIP: 192.168.10.225

SCAN VIP is enabled.

SCAN 2 IPv4 VIP: 192.168.10.220

SCAN VIP is enabled.

--启动监听,启动scan listener时候,自动把scan也给启动了

srvctl start scan_listener

--查看启动后状态

srvctl status scan_listener

srvctl status scan

[root@d2-dbrac21 ~]# srvctl status scan_listener

SCAN Listener LISTENER_SCAN1 is enabled

SCAN listener LISTENER_SCAN1 is running on node d2-dbrac22

SCAN Listener LISTENER_SCAN2 is enabled

SCAN listener LISTENER_SCAN2 is running on node d2-dbrac21

[root@d2-dbrac21 ~]# srvctl status scan

SCAN VIP scan1 is enabled

SCAN VIP scan1 is running on node d2-dbrac22

SCAN VIP scan2 is enabled

SCAN VIP scan2 is running on node d2-dbrac21

--查看ip

ip addr | grep ens192

[root@d2-dbrac21 ~]# ip addr | grep ens192

2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

inet 192.168.10.21/24 brd 192.168.10.255 scope global noprefixroute ens192

inet 192.168.10.248/24 brd 192.168.10.255 scope global secondary ens192:1

inet 192.168.10.220/24 brd 192.168.10.255 scope global secondary ens192:2

--查看集群中scan信息

[root@d2-dbrac21 ~]# srvctl config scan

SCAN name: dbrac-scan, Network: 1

Subnet IPv4: 192.168.10.0/255.255.255.0/ens192, static

Subnet IPv6:

SCAN 1 IPv4 VIP: 192.168.10.225

SCAN VIP is enabled.

SCAN 2 IPv4 VIP: 192.168.10.220

SCAN VIP is enabled.

相关推荐
荒川之神6 小时前
ORACLE _11G_R2_ASM 常用命令
数据库·oracle
IT培训中心-竺老师6 小时前
Oracle 23AI创建示例库
数据库·oracle
time never ceases7 小时前
使用docker方式进行Oracle数据库的物理迁移(helowin/oracle_11g)
数据库·docker·oracle
成富12 小时前
文本转SQL(Text-to-SQL),场景介绍与 Spring AI 实现
数据库·人工智能·sql·spring·oracle
荒川之神14 小时前
ORACLE 闪回技术简介
数据库·oracle
Mephisto.java16 小时前
【大数据学习 | kafka高级部分】kafka的优化参数整理
大数据·sql·oracle·kafka·json·database
BearHan18 小时前
Sqlsugar调用Oracle的存储过程
oracle·存储过程·orm
superman超哥18 小时前
04 深入 Oracle 并发世界:MVCC、锁、闩锁、事务隔离与并发性能优化的探索
数据库·oracle·性能优化·dba
Mephisto.java20 小时前
【大数据学习 | kafka高级部分】kafka的kraft集群
大数据·sql·oracle·kafka·json·hbase
Mephisto.java20 小时前
【大数据学习 | kafka高级部分】kafka的文件存储原理
大数据·sql·oracle·kafka·json