Oracle-RAC集群PUBLIC网络IPV4转IPV6操作方法

目录

1.概述:

2.环境信息:

        2.1.数据库环境信息:

        2.2.IP地址信息:

3.服务器确认开启IPV6

        3.1.确认网络没有禁用IPV6

        3.2.确认网卡可以支持IPV6

        3.3.确认IPV6防火墙关闭

4.PUBLIC业务网络:IPV4转IPV6

        4.1.关闭数据库集群和监听

        4.2.备份OCR和profile.xml

        4.3.更新集群业务网段的网络配置信息

        4.4.修改两个节点主机网卡的IPV6配置

        4.5.修改两节点主机hosts文件

        4.6.更新集群vip的配置IP

        4.7.删除重建nodeapps的配置

        4.8.启动CVU,LISTENER,SCAN_LISTENER, NODEAPPS组件

        4.9.检查集群网络组件状态

        4.10.重启集群,更新集群的VIP注册信息

        4.11.修改数据库的local_listener(可选)

5.PUBLIC业务网络同时配置IPV4和IPV6

        5.1.关闭数据库集群和监听

        5.2.备份OCR和profile.xml

        5.3.添加集群业务网段IPV6的网络配置信息

        5.4.修改两个节点主机网卡的新增IPV6配置

        5.5.修改两个节点的主机hosts文件

        5.6.集群VIP配置添加IPV6

        5.7.更新集群scan的配置

        5.8.修改network,配置支持IPV4和IPV6

        5.9.启动network,listener相关组件

        5.10.检查集群网络组件状态

        5.11.重启集群

        5.12.修改数据库的local_listener(可选)

6.PUBLIC业务网络:IPV6 TO IPV4

        6.1.关闭数据库集群和监听

        6.2.备份OCR和profile.xml

        6.3.更新集群业务网段的网络配置信息

        6.4.修改两个节点主机网卡的配置,将IPV6地址更新为IPV4

        6.5.修改两个节点主机hosts文件

        6.6.更新集群vip的配置IP

        6.7.删除重建nodeapps的配置

        6.8.启动CVU,LISTENER,SCAN_LISTENER, NODEAPPS组件

        6.9.检查集群网络组件状态

        6.10.重启集群

        6.11.修改数据库的local_listener(可选)

7.PUBLIC业务网络:IPV6+IPV4 TO IPV4

        7.1.关闭数据库集群和监听

        7.2.备份OCR和profile.xml

        7.3.更新集群业务网段的网络配置信息

        7.4.修改两个节点主机网卡的配置,删除IPV6的信息

        7.5.修改两个节点主机hosts文件

        7.6.更新集群vip的配置IP

        7.7.更新集群scan的配置

        7.8.启动CVU,LISTENER,SCAN_LISTENER, NODEAPPS组件

        7.9.检查集群网络组件状态

        7.10.重启集群

        7.11.修改数据库的local_listener(可选)

8.IPV6连接测试

        8.1.TNS方式连接测试

        8.2.easyconnect方式连接测试


1.概述:

        Oracle官方从12.1.0.1版本开始支持RAC集群Public network业务网络使用IPV6,但Private network心跳网络仍然只支持IPV4,直到12.2.0.1版本开始,RAC集群完全支持IPV6,Public network 业务网络和Private network心跳网络都可以使用IPV6。

        本文,主要描述在Oracle RAC 12.2.0.1版本,Public network IPV4转IPV6的操作过程,Public network同时配置IPV4和IPV6的操作过程,Public network IPV6转IPV4的操作过程,Public network 在同时配置了IPV4和IPV6下转IPV4的操作过程以及IPV6的连接测试。

2.环境信息:

        2.1.数据库环境信息:

项目

GI_VERSION

12.2.0.1

RDBMS_VERSION

12.2.0.1

GRID_HOME

/oracle/app/grid_home

ORACLE_HOME

/oracle/app/oracle/product/12.2/db_1

OS_VERSION

Red  Hat Enterprise Linux Server release 6.7 (Santiago)

        2.2.IP地址信息:

网卡信息

IP

IPV4

IPV6

eth0-public

rac1

172.20.10.200

2001:0db8:85a3:0001::200/64

rac2

172.20.10.210

2001:0db8:85a3:0001::210/64

rac1-vip

172.20.10.201

2001:0db8:85a3:0001::201/64

rac2-vip

172.20.10.202

2001:0db8:85a3:0001::202/64

rac-scan

172.20.10.203

2001:0db8:85a3:0001::203/64


3.服务器确认开启IPV6

        3.1.确认网络没有禁用IPV6

[root@rac1 ~]# sysctl -a |grep -i disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
net.ipv6.conf.eth0.disable_ipv6 = 0
net.ipv6.conf.eth1.disable_ipv6 = 0 

        3.2.确认网卡可以支持IPV6

[root@rac1 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:34:70:86 brd ff:ff:ff:ff:ff:ff
    inet 172.20.10.200/24 brd 172.20.10.255 scope global eth0
    inet 172.20.10.203/24 brd 172.20.10.255 scope global secondary eth0:1
    inet 172.20.10.201/24 brd 172.20.10.255 scope global secondary eth0:2
    inet6 2001:db8:85a3:1::201/64 scope global --->IPV6地址
       valid_lft forever preferred_lft forever
    inet6 2001:db8:85a3:1::203/64 scope global

        3.3.确认IPV6防火墙关闭

[root@rac1 ~]# service ip6tables status 
ip6tables: Firewall is not running.

4.PUBLIC业务网络:IPV4转IPV6

        4.1.关闭数据库集群和监听

--关闭数据库。
(oracle)$ srvctl stop database -d orcl
--关闭scan监听。
(grid)$ srvctl stop scan_listener
--关闭本地监听。
(grid)$ srvctl stop listener

        4.2.备份OCR和profile.xml

--备份profile.xml文件。
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac1/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac1 
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac2/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac2
--备份ocr配置。
(root)$ /oracle/app/grid_home/bin/ocrconfig -manualbackup

        4.3.更新集群业务网段的网络配置信息

--查看集群网络配置信息。
(grid)$  oifcfg getif
eth1  192.168.2.0  global  cluster_interconnect,asm
eth0  172.20.10.0  global  public
--在节点一执行删除旧的public网络配置信息。
(grid)$ oifcfg delif -global eth0/172.20.10.0
--在节点一执行添加新的IPV6-public网络配置信息,对于IPV6全0这里不能使用::写法,可能会出现语法错误。
(grid)$ oifcfg setif -global eth0/2001:db8:85a3:0001:0:0:0:0:public
--查看集群网络配置信息,确认public已经更新。
(grid)$ oifcfg getif
eth1  192.168.2.0  global  cluster_interconnect,asm
eth0  2001:db8:85a3:0001:0:0:0:0  global  public

        4.4.修改两个节点主机网卡的IPV6配置

#IPADDR=172.20.10.200
#NETMASK=255.255.255.0
#GATEWAY=172.20.10.1
#DEFROUTE=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6ADDR="2001:0db8:85a3:0001::200/64"
IPV6_DEFAULTGW="2001:0db8:85a3:0001::1"

        4.5.修改两节点主机hosts文件

--备份hosts文件。
(root)$ cp /etc/hosts /etc/hosts.bak.20240627
--更新hosts文件,更新IPV6地址。
(root)$ vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
​
2001:0db8:85a3:0001::200 rac1
2001:0db8:85a3:0001::210 rac2
​
2001:0db8:85a3:0001::201 rac1-vip
2001:0db8:85a3:0001::202 rac2-vip
​
192.168.2.10  rac1-priv
192.168.2.20  rac2-priv
​
2001:0db8:85a3:0001::203 rac-scan

        4.6.更新集群vip的配置IP

--查看vip配置。
(grid)$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, 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 rac1
VIP Name: rac1-vip
VIP IPv4 Address: 
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:201 (inactive)
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac2
VIP Name: rac2-vip
VIP IPv4 Address: 
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:202 (inactive)
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes:
--停两个节点的vip
(grid)$ srvctl stop vip -n rac1 -f
(grid)$ srvctl stop vip -n rac2 -f
--新增network IPV6的网段信息
(root)$ /oracle/app/grid_home/bin/srvctl modify network -netnum 1 -subnet 2001:db8:85a3:0001:0:0:0:0/64/eth0 -verbose
--修改vip为IPV6。
(root)$ /oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac1 -A rac1-vip/64/eth0
(root)$ /oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac2 -A rac2-vip/64/eth0
--确认修改vip配置,这里可以看到IPV4的网段还在,并且IPV6的状态为INACTIVE。采用直接修改nodeapps里面的VIP方式不行。需要直接重建nodeapps。
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static (inactive)
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:201 (inactive)
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac2
VIP Name: rac2-vip
VIP IPv4 Address: 
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:202 (inactive)
VIP is enabled.
VIP is individually enabled on nodes:
VIP is individually disabled on nodes:

        4.7.删除重建nodeapps的配置

--停止nodeapps相关的组件CVU,LISTENER,SCAN_LISTENER,VIP,nodeapps。
(grid)$ srvctl stop cvu
(grid)$ srvctl stop listener
(grid)$ srvctl stop scan_listener
(grid)$ srvctl stop vip -n rac1 -f 
(grid)$ srvctl stop vip -n rac2 -f 
(grid)$ srvctl stop scan -force
(grid)$ srvctl stop nodeapps -f
--在节点一执行删除nodeapps涉及的组件CVU,LISTENER,SCAN_LISTENER,SCAN,VIP,nodeapps。
(root)$ /oracle/app/grid_home/bin/srvctl remove nodeapps
(root)$ /oracle/app/grid_home/bin/srvctl remove cvu
(grid)$ srvctl remove listener
(grid)$ srvctl remove scan_listener
(root)$ /oracle/app/grid_home/bin/srvctl remove scan
--确认nodeapps,network已经删除,如果检查还是存在资源,则需要之前相关组件是否已经删除完成。
(grid)$ crsctl status resource ora.net1.network
(grid)$ srvctl config nodeapps
--如果network的资源一直存在,可以尝试强制删除network。
/oracle/app/grid_home/bin/srvctl remove network -netnum 1 -f
--在节点一执行重新添加network IPV6组件。
(root)$ /oracle/app/grid_home/bin/srvctl add network -netnum 1 -subnet 2001:0db8:85a3:0001:0:0:0:0/64/eth0
--在节点一执行添加scan。
(root)$ /oracle/app/grid_home/bin/srvctl add scan -scanname rac-scan
--在节点一执行添加vip。
(root)$ /oracle/app/grid_home/bin/srvctl add vip -node rac1 -netnum 1 -address rac1-vip/64/eth0
(root)$ /oracle/app/grid_home/bin/srvctl add vip -node rac2 -netnum 1 -address rac2-vip/64/eth0
--在节点一执行添加监听。
(grid)$ srvctl add listener
(grid)$ srvctl add scan_listener
--在节点一执行添加nodeapps节点信息。
(root)$ /oracle/app/grid_home/bin/srvctl add nodeapps -node rac1 -address rac1-vip/64/eth0
(root)$ /oracle/app/grid_home/bin/srvctl add nodeapps -node rac2 -address rac2-vip/64/eth0
--在节点一执行添加cvu。
(grid)$ srvctl add cvu

        4.8.启动CVU,LISTENER,SCAN_LISTENER, NODEAPPS组件

(grid)$ srvctl start nodeapps
(grid)$ srvctl start listener
(grid)$ srvctl start scan_listener
(grid)$ srvctl start cvu

        4.9.检查集群网络组件状态

--检查nodeapps。
(grid)$ srvctl config nodeapps
Network 1 exists
Subnet IPv4: 
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:201
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac2
VIP Name: rac2-vip
VIP IPv4 Address: 
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:202
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: 
​
--检查network。
(grid)$ srvctl config network
Network 1 exists
Subnet IPv4: 
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
--检查scan。
(grid)$ srvctl config scan
SCAN name: rac-scan, Network: 1
Subnet IPv4: 
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
SCAN 1 IPv6 VIP: 2001:db8:85a3:1:0:0:0:203
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 
--检查监听。
(grid)$ srvctl status listener 
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac1,rac2
(grid)$ lsnrctl status
​
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 27-JUN-2024 16:52:59
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                27-JUN-2024 16:12:16
Uptime                    0 days 0 hr. 40 min. 42 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2001:db8:85a3:1::200)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2001:db8:85a3:1::201)(PORT=1521)))
--检查scan_listener。
(grid)$ lsnrctl  status LISTENER_SCAN1
​
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 27-JUN-2024 16:53:31
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                27-JUN-2024 16:11:31
Uptime                    0 days 0 hr. 41 min. 59 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2001:db8:85a3:1::203)(PORT=1521)))

        4.10.重启集群,更新集群的VIP注册信息

--重启集群,更新VIP注册信息,ASM实例,数据库实例的local_listener需要重启后才动态修改。
(root)$ /oracle/app/grid_home/bin/crsctl stop crs 
(root)$ /oracle/app/grid_home/bin/crsctl start crs

        4.11.修改数据库的local_listener(可选)

--如果数据库显式设置过local_listener,数据不会动态更新,需要手动设置为IPV6的地址
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=2001:db8:85a3:1::201)(PORT=1521))' scope=both sid='orcl1';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=2001:db8:85a3:1::202)(PORT=1521))' scope=both sid='orcl2';

5.PUBLIC业务网络同时配置IPV4和IPV6

        5.1.关闭数据库集群和监听

--关闭数据库。
(oracle)$ srvctl stop database -d orcl
--关闭scan监听。
(grid)$ srvctl stop scan_listener
--关闭本地监听。
(grid)$ srvctl stop listener

        5.2.备份OCR和profile.xml

--备份profile.xml文件。
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac1/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac1 
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac2/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac2
--备份ocr配置。
(root)$ /oracle/app/grid_home/bin/ocrconfig -manualbackup

        5.3.添加集群业务网段IPV6的网络配置信息

--查看集群网络配置信息。
(grid)$  oifcfg getif
eth1  192.168.2.0  global  cluster_interconnect,asm
eth0  172.20.10.0  global  public
--在节点一执行添加IPV6的public网络配置信息,对于IPV6全0这里不能使用::写法,可能会出现语法错误。
(grid)$ oifcfg setif -global eth0/2001:db8:85a3:0001:0:0:0:0:public
--查看集群网络配置信息,确认public已经更新。
(grid)$ oifcfg getif
eth1  192.168.2.0  global  cluster_interconnect,asm
eth0  172.20.10.0  global  public
eth0  2001:db8:85a3:0001:0:0:0:0  global  public

        5.4.修改两个节点主机网卡的新增IPV6配置

IPADDR=172.20.10.200
NETMASK=255.255.255.0
GATEWAY=172.20.10.1
DEFROUTE=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6ADDR="2001:0db8:85a3:0001::200/64"
IPV6_DEFAULTGW="2001:0db8:85a3:0001::1"

        5.5.修改两个节点的主机hosts文件

--备份hosts文件。
(root)$ cp /etc/hosts /etc/hosts.bak.20240627
--更新hosts文件,添加IPV6地址。
(root)$ vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
​
172.20.10.200 rac1
2001:0db8:85a3:0001::200 rac1
172.20.10.210 rac2
2001:0db8:85a3:0001::210 rac2
​
172.20.10.201 rac1-vip
2001:0db8:85a3:0001::201 rac1-vip
172.20.10.202 rac2-vip
2001:0db8:85a3:0001::202 rac2-vip
​
192.168.2.10  rac1-priv
192.168.2.20  rac2-priv
​
172.20.10.203 rac-scan
2001:0db8:85a3:0001::203 rac-scan

        5.6.集群VIP配置添加IPV6

--查看业务网络配置。
(grid)$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, 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 rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:201 (inactive)
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:202 (inactive)
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes:
--停两个节点的vip。
(grid)$ srvctl stop vip -n rac1 -f
(grid)$ srvctl stop vip -n rac2 -f
--在节点一执行新增network IPV6的网段信息。
(root)$ /oracle/app/grid_home/bin/srvctl modify network -netnum 1 -subnet 2001:db8:85a3:0001:0:0:0:0/64/eth0 -verbose
--在节点一执行新增IPV6的VIP。 
(root)$ /oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac1 -A rac1-vip/64/eth0
(root)$ /oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac2 -A rac2-vip/64/eth0
--确认修改vip配置,这里可以看到IPV4+IPV6,但IPV6还处于inactive的状态,后面需要进行激活。
 (grid)$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static (inactive)
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:201 (inactive)
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:202 (inactive)
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes:
(grid)$ srvctl config network
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static (inactive)
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes:

        5.7.更新集群scan的配置

--停止scan ip服务。
(grid)$ srvctl stop scan_listener
(grid)$ /oracle/app/grid_home/bin/srvctl stop scan
(grid)$ /oracle/app/grid_home/bin/srvctl status scan
--在节点一执行更新scan ip。
(root)$ /oracle/app/grid_home/bin/srvctl modify scan -n rac-scan
--确认scan的配置,可以看到IPV4和IPV6,但IPV6还处于inactive的状态,后面需要进行激活。
(grid)$ srvctl config scan
SCAN name: rac-scan, Network: 1
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static (inactive)
SCAN 1 IPv4 VIP: 172.20.10.203
SCAN 1 IPv6 VIP: 2001:db8:85a3:1:0:0:0:203 (inactive)
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes:

        5.8.修改network,配置支持IPV4和IPV6

--在节点一执行激活同时支持IPV4和IPV6。
(root)$ /oracle/app/grid_home/bin/srvctl modify network -iptype both

        5.9.启动network,listener相关组件

(grid)$ srvctl start nodeapps
(grid)$ srvctl start scan
(grid)$ srvctl start listener
(grid)$ srvctl start scan_listener

        5.10.检查集群网络组件状态

--检查nodeapps。
(grid)$ srvctl config nodeapps
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:201
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
VIP IPv6 Address: 2001:db8:85a3:1:0:0:0:202
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:
--检查network。
(grid)$ srvctl config network
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
--检查scan。
(grid)$ srvctl config scan
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
SCAN 1 IPv4 VIP: 172.20.10.203
SCAN 1 IPv6 VIP: 2001:db8:85a3:1:0:0:0:203
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes: 
--检查监听。
(grid)$ srvctl status listener 
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac1,rac2
(grid)$ lsnrctl status
​
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 01-JUL-2024 17:19:34
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                01-JUL-2024 17:18:20
Uptime                    0 days 0 hr. 1 min. 13 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2001:db8:85a3:1::200)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.200)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2001:db8:85a3:1::201)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.201)(PORT=1521))) 
--检查scan_listener。
(grid)$ lsnrctl  status LISTENER_SCAN1
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 01-JUL-2024 17:20:02
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                01-JUL-2024 17:17:50
Uptime                    0 days 0 hr. 2 min. 12 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac2/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=2001:db8:85a3:1::203)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.203)(PORT=1521)))

        5.11.重启集群

--重启集群,更新VIP注册信息。
(root)$ /oracle/app/grid_home/bin/crsctl stop crs 
(root)$ /oracle/app/grid_home/bin/crsctl start crs
--启动数据库。
(oracle)$ srvctl start database -d orcl

        5.12.修改数据库的local_listener(可选)

如果数据库显式设置过local_listener,数据不会动态更新,需要手动设置同时注册IPV4,IPV6的地址。
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.10.201)(PORT=1521))','(ADDRESS=(PROTOCOL=TCP)(HOST=2001:db8:85a3:1::201)(PORT=1521))' scope=both sid='orcl1';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.10.202)(PORT=1521))','(ADDRESS=(PROTOCOL=TCP)(HOST=2001:db8:85a3:1::202)(PORT=1521))' scope=both sid='orcl2';

6.PUBLIC业务网络:IPV6 TO IPV4

        6.1.关闭数据库集群和监听

--关闭数据库。
(oracle)$ srvctl stop database -d orcl
--关闭scan监听。
(grid)$ srvctl stop scan_listener
--关闭本地监听。
(grid)$ srvctl stop listener

        6.2.备份OCR和profile.xml

--备份profile.xml文件。
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac1/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac1 
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac2/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac2
--备份ocr配置。
(root)$ /oracle/app/grid_home/bin/ocrconfig -manualbackup

        6.3.更新集群业务网段的网络配置信息

--查看集群网络配置信息。
(grid)$  oifcfg getif
eth1  2001:db8:85a3:0002:0:0:0:0  global  cluster_interconnect,asm
eth0  2001:db8:85a3:0001:0:0:0:0  global  public
--在节点一执行删除旧的IPV6 的public网络配置信息。
(grid)$ oifcfg delif -global eth0/2001:db8:85a3:0001:0:0:0:0
--在节点一执行添加IPV4的public网络配置信息。
(grid)$ oifcfg setif -global eth0/172.20.10.0:public
--查看集群网络配置信息,确认public已经更新。
(grid)$ oifcfg getif
eth1  2001:db8:85a3:0002:0:0:0:0  global  cluster_interconnect,asm
eth0  172.20.10.0  global  public

        6.4.修改两个节点主机网卡的配置,将IPV6地址更新为IPV4

IPADDR=172.20.10.200
NETMASK=255.255.255.0
GATEWAY=172.20.10.1
DEFROUTE=yes
#IPV6INIT=yes
#IPV6_AUTOCONF=no
#IPV6_DEFROUTE=yes
#IPV6_FAILURE_FATAL=no
#IPV6ADDR="2001:0db8:85a3:0001::200/64"
#IPV6_DEFAULTGW="2001:0db8:85a3:0001::1"

        6.5.修改两个节点主机hosts文件

--备份hosts文件。
(root)$ cp /etc/hosts /etc/hosts.bak.20240627
--更新hosts文件IPV4地址。
(root)$ vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
​
172.20.10.200 rac1
172.20.10.210 rac2
​
172.20.10.201 rac1-vip
172.20.10.202 rac2-vip
​
172.20.10.203 rac-scan

        6.6.更新集群vip的配置IP

--查看vip配置。
(grid)$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
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 rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
VIP IPv6 Address: 
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes:
--停两个节点的vip
(grid)$ srvctl stop vip -n rac1 -f
(grid)$ srvctl stop vip -n rac2 -f
--修改vip为IPV4。
/oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac1 -A rac1-vip/255.255.255.0/eth0
/oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac2 -A rac2-vip/255.255.255.0/eth0
--修改network只支持ipv4,这一步会报错PRCT-1306 : Setting the address type to "ipv4" is an not allowed because the existing network address type is "ipv6"
(root)$ /oracle/app/grid_home/bin/srvctl modify network -iptype ipv4
--确认修改vip配置。可以看到IPV4为inactive,只能直接重建nodeapps。
(grid)$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static (inactive)
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201 (inactive)
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 rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202 (inactive)
VIP IPv6 Address: 
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes:

        6.7.删除重建nodeapps的配置

--停止nodeapps相关的组件CVU,LISTENER,SCAN_LISTENER,VIP,nodeapps。
(grid)$ srvctl stop cvu
(grid)$ srvctl stop listener
(grid)$ srvctl stop scan_listener
(grid)$ srvctl stop vip -n rac1 -f 
(grid)$ srvctl stop vip -n rac2 -f 
(grid)$ srvctl stop scan -force
(grid)$ srvctl stop nodeapps -f
--在节点一执行删除nodeapps涉及的组件CVU,LISTENER,SCAN_LISTENER,SCAN,VIP,nodeapps。
(root)$ /oracle/app/grid_home/bin/srvctl remove nodeapps
(root)$ /oracle/app/grid_home/bin/srvctl remove cvu
(grid)$ srvctl remove listener
(grid)$ srvctl remove scan_listener
(root)$ /oracle/app/grid_home/bin/srvctl remove scan
--确认nodeapps,network已经删除,如果检查还是存在资源,则需要之前相关组件是否已经删除完成。
(grid)$ crsctl status resource ora.net1.network
(grid)$ srvctl config nodeapps
--如果network的资源一直存在,可以尝试强制删除network。
/oracle/app/grid_home/bin/srvctl remove network -netnum 1 -f
--在节点一执行重新添加network组件。
(root)$ /oracle/app/grid_home/bin/srvctl add network -netnum 1 -subnet 172.20.10.0/255.255.255.0/eth0
--在节点一执行添加scan。
(root)$ /oracle/app/grid_home/bin/srvctl add scan -scanname rac-scan
--在节点一执行添加vip。
(root)$ /oracle/app/grid_home/bin/srvctl add vip -node rac1 -netnum 1 -address rac1-vip/255.255.255.0/eth0
(root)$ /oracle/app/grid_home/bin/srvctl add vip -node rac2 -netnum 1 -address rac2-vip/255.255.255.0/eth0
--在节点一执行添加监听。
(grid)$ srvctl add listener
(grid)$ srvctl add scan_listener
--在节点一执行添加nodeapps节点信息。
(root)$ /oracle/app/grid_home/bin/srvctl add nodeapps -node rac1 -address rac1-vip/255.255.255.0/eth0
(root)$ /oracle/app/grid_home/bin/srvctl add nodeapps -node rac2 -address rac2-vip/255.255.255.0/eth0
--在节点一执行添加cvu。
(grid)$ srvctl add cvu

        6.8.启动CVU,LISTENER,SCAN_LISTENER, NODEAPPS组件

(grid)$ srvctl start nodeapps
(grid)$ srvctl start listener
(grid)$ srvctl start scan_listener
(grid)$ srvctl start cvu

        6.9.检查集群网络组件状态

--检查nodeapps。
(grid)$ srvctl config nodeapps
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, 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 rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
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 rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
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: 
--检查监听。
(grid)$ srvctl status listener 
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac1,rac2
(grid)$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 01-JUL-2024 15:14:39
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                01-JUL-2024 15:13:12
Uptime                    0 days 0 hr. 1 min. 26 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.200)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.201)(PORT=1521)))
Services Summary...
--检查scan_listener。
(grid)$ lsnrctl  status LISTENER_SCAN1
​
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 01-JUL-2024 15:14:59
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                01-JUL-2024 15:13:18
Uptime                    0 days 0 hr. 1 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.203)(PORT=1521)))

        6.10.重启集群

--重启集群,更新VIP注册信息。
(root)$ /oracle/app/grid_home/bin/crsctl stop crs 
(root)$ /oracle/app/grid_home/bin/crsctl start crs

        6.11.修改数据库的local_listener(可选)

如果数据库显式设置过local_listener,数据不会动态更新,需要手动设置为IPV4的地址。
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.10.201)(PORT=1521))' scope=both sid='orcl1';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.10.202)(PORT=1521))' scope=both sid='orcl2';

7.PUBLIC业务网络:IPV6+IPV4 TO IPV4

        7.1.关闭数据库集群和监听

--关闭数据库。
(oracle)$ srvctl stop database -d orcl
--关闭scan监听。
(grid)$ srvctl stop scan_listener
--关闭本地监听。
(grid)$ srvctl stop listener

        7.2.备份OCR和profile.xml

--备份profile.xml文件。
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac1/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac1 
(grid)$ cp -p /oracle/app/grid_home/gpnp/rac2/profiles/peer/profile.xml /home/grid/profile.xml.bak.rac2
--备份ocr配置。
(root)$ /oracle/app/grid_home/bin/ocrconfig -manualbackup

        7.3.更新集群业务网段的网络配置信息

--查看集群网络配置信息。
(grid)$  oifcfg getif
eth0  2001:db8:85a3:0001:0:0:0:0  global  public
eth0  172.20.10.0  global  public
eth1  2001:db8:85a3:0002:0:0:0:0  global  cluster_interconnect,asm
--在节点一执行删除旧的public网络配置信息。
(grid)$ oifcfg delif -global eth0/2001:db8:85a3:0001:0:0:0:0
--查看集群网络配置信息,确认public已经更新
(grid)$ oifcfg getif
eth1  2001:db8:85a3:0002:0:0:0:0  global  cluster_interconnect,asm
eth0  172.20.10.0  global  public

        7.4.修改两个节点主机网卡的配置,删除IPV6的信息

IPADDR=172.20.10.200
NETMASK=255.255.255.0
GATEWAY=172.20.10.1
DEFROUTE=yes
#IPV6INIT=yes
#IPV6_AUTOCONF=no
#IPV6_DEFROUTE=yes
#IPV6_FAILURE_FATAL=no
#IPV6ADDR="2001:0db8:85a3:0001::200/64"
#IPV6_DEFAULTGW="2001:0db8:85a3:0001::1"

        7.5.修改两个节点主机hosts文件

--备份hosts文件
(root)$ cp /etc/hosts /etc/hosts.bak.20240627
--更新hosts文件,删除IPV6地址
(root)$ vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
​
172.20.10.200 rac1
172.20.10.210 rac2
​
172.20.10.201 rac1-vip
172.20.10.202 rac2-vip
​
172.20.10.203 rac-scan

        7.6.更新集群vip的配置IP

--查看vip配置。
(grid)$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 2001:db8:85a3:1:0:0:0:0/64/eth0, static
Ping Targets: 
Network is enabled
Network is individually enabled on nodes: 
Network is individually disabled on nodes: 
VIP exists: network number 1, hosting node rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
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 rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
VIP IPv6 Address: 
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes:
--停两个节点的vip。
(grid)$ srvctl stop vip -n rac1 -f
(grid)$ srvctl stop vip -n rac2 -f
--在节点一执行修改vip为IPV4。
/oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac1 -A rac1-vip/255.255.255.0/eth0
/oracle/app/grid_home/bin/srvctl modify  nodeapps -n rac2 -A rac2-vip/255.255.255.0/eth0
--在节点一执行修改network只支持ipv4,这一步会清空network里面的IPV6的信息。
(root)$ /oracle/app/grid_home/bin/srvctl modify network -iptype ipv4
--确认修改vip配置。
(grid)$ srvctl config nodeapps -a
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, 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 rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
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 rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
VIP IPv6 Address: 
VIP is enabled.
VIP is individually enabled on nodes: 
VIP is individually disabled on nodes:

        7.7.更新集群scan的配置

--执行停止scan ip服务。
(grid)$ srvctl stop scan_listener
(grid)$ /oracle/app/grid_home/bin/srvctl stop scan
(grid)$ /oracle/app/grid_home/bin/srvctl status scan
--在节点一执行更新scan ip。
(root)$ /oracle/app/grid_home/bin/srvctl modify scan -n rac-scan
--确认scan的配置。
(grid)$ srvctl config scan
SCAN name: rac-scan, Network: 1
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, static
Subnet IPv6: 
SCAN 1 IPv4 VIP: 172.20.10.203
SCAN VIP is enabled.
SCAN VIP is individually enabled on nodes: 
SCAN VIP is individually disabled on nodes:

        7.8.启动CVU,LISTENER,SCAN_LISTENER, NODEAPPS组件

(grid)$ srvctl start nodeapps
(grid)$ srvctl start scan
(grid)$ srvctl start listener
(grid)$ srvctl start scan_listener

        7.9.检查集群网络组件状态

--检查nodeapps。
(grid)$ srvctl config nodeapps
Network 1 exists
Subnet IPv4: 172.20.10.0/255.255.255.0/eth0, 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 rac1
VIP Name: rac1-vip
VIP IPv4 Address: 172.20.10.201
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 rac2
VIP Name: rac2-vip
VIP IPv4 Address: 172.20.10.202
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: 
--检查监听。
(grid)$ srvctl status listener 
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac1,rac2
(grid)$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 01-JUL-2024 15:14:39
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                01-JUL-2024 15:13:12
Uptime                    0 days 0 hr. 1 min. 26 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.200)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.201)(PORT=1521)))
Services Summary...
--检查scan_listener。
(grid)$ lsnrctl  status LISTENER_SCAN1
​
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 01-JUL-2024 15:14:59
​
Copyright (c) 1991, 2016, Oracle.  All rights reserved.
​
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                01-JUL-2024 15:13:18
Uptime                    0 days 0 hr. 1 min. 41 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/grid_home/network/admin/listener.ora
Listener Log File         /oracle/app/grid_base/diag/tnslsnr/rac1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.20.10.203)(PORT=1521)))

        7.10.重启集群

--重启集群,更新VIP注册信息。
(root)$ /oracle/app/grid_home/bin/crsctl stop crs 
(root)$ /oracle/app/grid_home/bin/crsctl start crs

        7.11.修改数据库的local_listener(可选)

如果数据库显式设置过local_listener,数据不会动态更新,需要手动设置为IPV4的地址
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.10.201)(PORT=1521))' scope=both sid='orcl1';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.10.202)(PORT=1521))' scope=both sid='orcl2';

8.IPV6连接测试

        8.1.TNS方式连接测试

--tnsnames.ora配置IPV6 TNS
IPV6_TEST=
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 2001:db8:85a3:1::203)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = testpdb1)
    )
 )
--通过sqlplus测试连接
[oracle@rac1 admin]$ sqlplus test/oracle@ipv6_test
​
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 2 11:08:31 2024
​
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
​
Last Successful login time: Mon Jul 01 2024 11:00:21 +08:00
​
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
​
SQL>

        8.2.easyconnect方式连接测试

--直接写IPV6 IP方式连接不行
[oracle@rac1 ~]$ sqlplus test/oracle@2001:0db8:85a3:0001::203:1521/testpdb1 
​
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 2 11:21:30 2024
​
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
​
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
--写IPV6对应的域名可以连接
[oracle@rac1 ~]$ ping6 rac-scan-ipv6
PING rac-scan-ipv6(rac-scan) 56 data bytes
64 bytes from rac-scan: icmp_seq=1 ttl=64 time=0.441 ms
64 bytes from rac-scan: icmp_seq=2 ttl=64 time=0.310 ms
64 bytes from rac-scan: icmp_seq=3 ttl=64 time=0.273 ms
​
[oracle@rac1 ~]$ sqlplus test/oracle@rac-scan-ipv6:1521/testpdb1
​
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jul 2 11:23:29 2024
​
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
​
Last Successful login time: Tue Jul 02 2024 11:22:24 +08:00
​
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
​
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@rac1 ~]$

Tip:欢迎关注公众号:勇敢牛牛的笔记,超140+的原创内容,每周不定期更新数据库技术文章。

  • 14
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值