本文主要是介绍Oracle 19C RAC 修改public-IP-VIP及scanIP测试,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
欢迎您关注我 视频公众号,后期将给你带来更多精彩内容,请扫码关注:
一、集群环境检查
[grid@oracle-19C-node1 ~]$ crsctl status res -t--------------------------------------------------------------------------------Name Target State Server State details --------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.LISTENER.lsnrONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLEora.chadONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLEora.net1.networkONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLEora.onsONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLE--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 ONLINE OFFLINE STABLEora.CRS.dg(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.DG.dg(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.LISTENER_SCAN1.lsnr1 ONLINE ONLINE oracle-19c-node1 STABLEora.LISTENER_SCAN2.lsnr1 ONLINE ONLINE oracle-19c-node2 STABLEora.asm(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 Started,STABLE2 ONLINE ONLINE oracle-19c-node2 Started,STABLE3 OFFLINE OFFLINE STABLEora.asmnet1.asmnetwork(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.cvu1 ONLINE ONLINE oracle-19c-node2 STABLEora.orcldb.db1 ONLINE ONLINE oracle-19c-node1 Open,HOME=/u01/app/oracle/product/19.3.0/db_1,STABLE2 ONLINE ONLINE oracle-19c-node2 Open,HOME=/u01/app/oracle/product/19.3.0/db_1,STABLEora.orcldb.oratab.hostxxx.svc1 OFFLINE OFFLINE STABLE2 OFFLINE OFFLINE STABLEora.oracle-19c-node1.vip1 ONLINE ONLINE oracle-19c-node1 STABLEora.oracle-19c-node2.vip1 ONLINE ONLINE oracle-19c-node2 STABLEora.qosmserver1 ONLINE ONLINE oracle-19c-node2 STABLEora.scan1.vip1 ONLINE ONLINE oracle-19c-node1 STABLEora.scan2.vip1 ONLINE ONLINE oracle-19c-node2 STABLE--------------------------------------------------------------------------------
二、禁止所有节点自动启动并关闭两边节点监听
# 使用grid用户在其中一节点操作[grid@oracle-19C-node1 ~]$ srvctl disable listener[grid@oracle-19C-node1 ~]$ srvctl stop listener
三、禁止所有节点自动启动并关闭两边节点数据库
# 使用Oracle用户在其中一节点操作[oracle@oracle-19C-node1 ~]$ srvctl disable database -d orcldb[oracle@oracle-19C-node1 ~]$ srvctl stop database -d orcldb-o immediate
四、禁止所有节点自动启动并停止VIP
# 使用root在其中一节点操作禁止自启动VIP[root@oracle-19C-node1 ~]# /u01/app/19.3.0/grid/bin/srvctl disable vip -i oracle-19C-node1-vip[root@oracle-19C-node1 ~]# /u01/app/19.3.0/grid/bin/srvctl disable vip -i oracle-19C-node2-vip################################# 使用grid用户在其中一节点操作停止VIP[grid@oracle-19C-node1 ~]$ srvctl stop vip -n oracle-19C-node1[grid@oracle-19C-node1 ~]$ srvctl stop vip -n oracle-19C-node2
五、禁止并停止所有节点的SCAN和SCAN_LISTENER的启动
# 使用grid用户在其中节点操作禁用并停止scan监听[grid@oracle-19C-node1 ~]$ srvctl disable scan_listener[grid@oracle-19C-node1 ~]$ srvctl stop scan_listener########################## 使用root用户在其中一节点操作停止scan[root@oracle-19C-node1 ~]# /u01/app/19.3.0/grid/bin/srvctl disable scan[root@oracle-19C-node1 ~]# /u01/app/19.3.0/grid/bin/srvctl stop scan
六、停止集群CRS
# 使用root用户分别在两个节点操作[root@oracle-19C-node2 ~]# /u01/app/19.3.0/grid/bin/crsctl stop crs[root@oracle-19C-node1 ~]# /u01/app/19.3.0/grid/bin/crsctl stop crs
七、修改两节点/etc/hosts文件
# 仅需修改public-ip、vip、scan-ip##public-ip192.168.65.41 oracle-19C-node1192.168.65.42 oracle-19C-node2##virtual-ip192.168.65.96 oracle-19C-node1-vip192.168.65.114 oracle-19C-node2-vip##private-ip10.110.4.8 oracle-19C-node1-priv10.110.4.9 oracle-19C-node2-priv##scan-ip192.168.65.234 oratab-scan
八、修改两节点public-IP对应网卡信息
# 修改两节点网卡对应IP信息# 重启网卡,通知网络人员修改vlansystemctl restart network
九、重启两节点CRS
# 使用root用户分别在两个节点操作[root@oracle-19C-node1 ~]# /u01/app/19.3.0/grid/bin/crsctl start crs[root@oracle-19C-node2 ~]# /u01/app/19.3.0/grid/bin/crsctl start crs
十、查看集群状态
[grid@oracle-19C-node1 ~]$ crsctl stat res -t--------------------------------------------------------------------------------Name Target State Server State details --------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.LISTENER.lsnrOFFLINE OFFLINE oracle-19c-node1 STABLEOFFLINE OFFLINE oracle-19c-node2 STABLEora.chadONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLEora.net1.networkONLINE OFFLINE oracle-19c-node1 STABLEONLINE OFFLINE oracle-19c-node2 STABLEora.onsONLINE OFFLINE oracle-19c-node1 STABLEONLINE OFFLINE oracle-19c-node2 STABLE--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 ONLINE OFFLINE STABLEora.CRS.dg(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.DG.dg(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.LISTENER_SCAN1.lsnr1 OFFLINE OFFLINE STABLEora.asm(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 Started,STABLE2 ONLINE ONLINE oracle-19c-node2 Started,STABLE3 OFFLINE OFFLINE STABLEora.asmnet1.asmnetwork(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.cvu1 ONLINE OFFLINE STABLEora.orcldb.db1 OFFLINE OFFLINE STABLE2 OFFLINE OFFLINE STABLEora.orcldb.oratab.hostxxx.svc1 OFFLINE OFFLINE STABLE2 OFFLINE OFFLINE STABLEora.oracle-19c-node1.vip1 OFFLINE OFFLINE STABLEora.oracle-19c-node2.vip1 OFFLINE OFFLINE STABLEora.qosmserver1 ONLINE OFFLINE STABLEora.scan1.vip1 OFFLINE OFFLINE STABLE--------------------------------------------------------------------------------
十一、修改集群public-IP
# 使用root用户分别查看两节点public-IP信息[root@oracle-19C-node1 ~]# cd /u01/app/19.3.0/grid/bin/[root@oracle-19C-node1 bin]# ./oifcfg getifens192 10.110.4.0 global cluster_interconnect,asmens33 10.110.3.0 global public[root@oracle-19C-node2 ~]# cd /u01/app/19.3.0/grid/bin/[root@oracle-19C-node2 bin]# ./oifcfg getifens192 10.110.4.0 global cluster_interconnect,asmens33 10.110.3.0 global public# 从以上信息可以看到public-IP未修改# 使用root用户在其中一节点修改public-IP信息[root@oracle-19C-node1 bin]# ./oifcfg delif -global ens33 [root@oracle-19C-node1 bin]# ./oifcfg getifens192 10.110.4.0 global cluster_interconnect,asm[root@oracle-19C-node1 bin]# ./oifcfg setif -global ens33/192.168.65.0:public[root@oracle-19C-node1 bin]# ./oifcfg getifens192 10.110.4.0 global cluster_interconnect,asmens33 192.168.65.0 global public[root@oracle-19C-node2 bin]# ./oifcfg getifens192 10.110.4.0 global cluster_interconnect,asmens33 192.168.65.0 global public# 以上信息显示两节点public-IP信息已修改
十二、查看并修改集群VIP信息
# 使用root分别查看当前两节点VIP信息[root@oracle-19C-node1 ~]# cd /u01/app/19.3.0/grid/bin[root@oracle-19C-node1 bin]# ./srvctl config vip -n oracle-19C-node1VIP 存在: 网络编号 1, 托管节点 oracle-19c-node1VIP 名称: oracle-19C-node1-vipVIP IPv4 地址: 192.168.65.96VIP IPv6 地址: VIP 已禁用。VIP 已在以下节点上分别启用: VIP 已在以下节点上分别禁用: [root@oracle-19C-node2 ~]# cd /u01/app/19.3.0/grid/bin[root@oracle-19C-node2 bin]# ./srvctl config vip -n oracle-19C-node2VIP 存在: 网络编号 1, 托管节点 oracle-19c-node2VIP 名称: oracle-19C-node2-vipVIP IPv4 地址: 192.168.65.114VIP IPv6 地址: VIP 已禁用。VIP 已在以下节点上分别启用: VIP 已在以下节点上分别禁用:[root@oracle-19C-node1 bin]# ./srvctl config nodeapps -a网络1存在子网 IPv4: 10.110.3.0/255.255.255.0/ens33, static子网 IPv6: 试通目标: 网络已启用网络已在以下节点上分别启用: 网络已在以下节点上分别禁用: VIP 存在: 网络编号 1, 托管节点 oracle-19c-node1VIP 名称: oracle-19C-node1-vipVIP IPv4 地址: 192.168.65.96VIP IPv6 地址: VIP 已禁用。VIP 已在以下节点上分别启用: VIP 已在以下节点上分别禁用: VIP 存在: 网络编号 1, 托管节点 oracle-19c-node2VIP 名称: oracle-19C-node2-vipVIP IPv4 地址: 192.168.65.114VIP IPv6 地址: VIP 已禁用。VIP 已在以下节点上分别启用: VIP 已在以下节点上分别禁用: # 虽然此时显示两个节点VIP信息都是65网段,但其实信息并未修改# 使用root在其中一节点执行修改集群VIP信息[root@oracle-19C-node1 ~]# cd /u01/app/19.3.0/grid/bin[root@oracle-19C-node1 bin]# ./srvctl modify nodeapps -n oracle-19C-node1 -A 192.168.65.96/255.255.255.0/ens33[root@oracle-19C-node1 bin]# ./srvctl modify nodeapps -n oracle-19C-node2 -A 192.168.65.114/255.255.255.0/ens33 [root@oracle-19C-node1 bin]# ./srvctl config nodeapps -a网络1存在子网 IPv4: 192.168.65.0/255.255.255.0/ens33, static子网 IPv6: 试通目标: 网络已启用网络已在以下节点上分别启用: 网络已在以下节点上分别禁用: VIP 存在: 网络编号 1, 托管节点 oracle-19c-node1VIP 名称: oracle-19C-node1-vipVIP IPv4 地址: 192.168.65.96VIP IPv6 地址: VIP 已禁用。VIP 已在以下节点上分别启用: VIP 已在以下节点上分别禁用: VIP 存在: 网络编号 1, 托管节点 oracle-19c-node2VIP 名称: oracle-19C-node2-vipVIP IPv4 地址: 192.168.65.114VIP IPv6 地址: VIP 已禁用。VIP 已在以下节点上分别启用: VIP 已在以下节点上分别禁用:
十三、修改集群scanIP
# 使用root用户在其中一节点操作修改scanIP[root@oracle-19C-node1 ~]# cd /u01/app/19.3.0/grid/bin [root@oracle-19C-node1 bin]# ./srvctl config scanSCAN 名称: oratab-scan, 网络: 1子网 IPv4: 192.168.65.0/255.255.255.0/ens33, static子网 IPv6: SCAN 1 IPv4 VIP: 10.110.3.182SCAN VIP 已禁用。[root@oracle-19C-node1 bin]# ./srvctl modify scan -n 192.168.65.234[root@oracle-19C-node1 bin]# ./srvctl config scan SCAN 名称: 192.168.65.234, 网络: 1子网 IPv4: 192.168.65.0/255.255.255.0/ens33, static子网 IPv6: SCAN 1 IPv4 VIP: 192.168.65.234SCAN VIP 已禁用。# 另一节点查看修改后的scanIP[root@oracle-19C-node2 ~]# cd /u01/app/19.3.0/grid/bin[root@oracle-19C-node2 bin]# ./srvctl config scanSCAN 名称: 192.168.65.234, 网络: 1子网 IPv4: 192.168.65.0/255.255.255.0/ens33, static子网 IPv6: SCAN 1 IPv4 VIP: 192.168.65.234SCAN VIP 已禁用。
十四、启动集群监听和服务
# 使用root用户在其中一节点操作[root@oracle-19C-node1 ~]# cd /u01/app/19.3.0/grid/bin/[root@oracle-19C-node1 bin]# ./srvctl enable listener[root@oracle-19C-node1 bin]# ./srvctl enable vip -i oracle-19C-node1-vip[root@oracle-19C-node1 bin]# ./srvctl enable vip -i oracle-19C-node1-vip[root@oracle-19C-node1 bin]# ./srvctl enable scan_listener[root@oracle-19C-node1 bin]# ./srvctl enable scan[root@oracle-19C-node1 bin]# ./srvctl enable database -d orcldb[root@oracle-19C-node1 bin]# ./srvctl start listener[root@oracle-19C-node1 bin]# ./srvctl start vip -n oracle-19C-node1PRKO-2420 : VIP oracle-19C-node1-vip已在节点oracle-19c-node1上启动[root@oracle-19C-node1 bin]# ./srvctl start scan[root@oracle-19C-node1 bin]# ./srvctl start scan_listener[root@oracle-19C-node1 bin]# ./srvctl start database -d orcldb
十五、查看集群状态
[grid@oracle-19C-node1 ~]$ crsctl stat res -t--------------------------------------------------------------------------------Name Target State Server State details --------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.LISTENER.lsnrONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLEora.chadONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLEora.net1.networkONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLEora.onsONLINE ONLINE oracle-19c-node1 STABLEONLINE ONLINE oracle-19c-node2 STABLE--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 ONLINE OFFLINE STABLEora.CRS.dg(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.DG.dg(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.LISTENER_SCAN1.lsnr1 ONLINE ONLINE oracle-19c-node1 STABLEora.asm(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 Started,STABLE2 ONLINE ONLINE oracle-19c-node2 Started,STABLE3 OFFLINE OFFLINE STABLEora.asmnet1.asmnetwork(ora.asmgroup)1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLE3 OFFLINE OFFLINE STABLEora.cvu1 ONLINE ONLINE oracle-19c-node2 STABLEora.orcldb.db1 ONLINE ONLINE oracle-19c-node1 Open,HOME=/u01/app/oracle/product/19.3.0/db_1,STABLE2 ONLINE ONLINE oracle-19c-node2 Open,HOME=/u01/app/oracle/product/19.3.0/db_1,STABLEora.orcldb.oratab.hostxxx.svc1 ONLINE ONLINE oracle-19c-node1 STABLE2 ONLINE ONLINE oracle-19c-node2 STABLEora.oracle-19c-node1.vip1 ONLINE ONLINE oracle-19c-node1 STABLEora.oracle-19c-node2.vip1 ONLINE ONLINE oracle-19c-node2 STABLEora.qosmserver1 ONLINE ONLINE oracle-19c-node2 STABLEora.scan1.vip1 ONLINE ONLINE oracle-19c-node1 STABLE--------------------------------------------------------------------------------
这篇关于Oracle 19C RAC 修改public-IP-VIP及scanIP测试的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!