修改rac集群各种ip地址

修改不同网段公网,私网,vip,scan ip步骤

修改ip地址: 
1.查看接口配置并修改: 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg getif 
enp0s3 192.168.6.0 global public 公网ip网段 
enp0s8 10.10.10.0 global cluster_interconnect 私网ip网段 
删除原公有,私有IP地址: 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg delif -global enp0s3 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg delif -global enp0s8 
重新设置新Public IP: 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg setif -global enp0s3/192.168.60.0:public 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg setif -global enp0s8/10.10.20.0:cluster_inerconnect 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/oifcfg getif

2.停止has服务: 
/oracle/app/11.2.0/grid/bin/crsctl stop has

3.通过操作系统命令修改公有,私有IP地址 
linux: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 
systemctl restart network 
修改SCAN域名配置(存在DNS域名方式解析,修改域名映射) 
修改hosts文件公共IP地址,VIP地址,SCAN地址 
vi /etc/hosts

4.启动has: 
/oracle/app/11.2.0/grid/bin/crsctl start has

5.查看和修改网络资源 
/oracle/app/11.2.0/grid/bin/srvctl config network 
Network exists: 1/192.168.6.0/255.255.255.0/enp0s3, type static

/oracle/app/11.2.0/grid/bin/srvctl modify network -k 1 -S 192.168.60.0/255.255.255.0/enp0s3 -v

6.重新配置SCAN VIP和SCAN Listener 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan 
SCAN name: rac-scan, Network: 1/192.168.6.0/255.255.255.0/enp0s3 
SCAN VIP name: scan1, IP: /rac-scan/192.168.6.254

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan_listener 
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl stop scan_listener 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl stop scan 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl remove scan_listener 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl remove scan

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl add scan -n scan(新的scan名称) -k 1 -S 192.168.60.0/255.255.255.0/enp0s3 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl add scan_listener 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start scan 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start scan_listener

7.重新配置vip 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config vip -n rac1 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config vip -n rac2 
VIP exists: /rac1-vip/192.168.6.102/192.168.6.0/255.255.255.0/enp0s3, hosting node rac1

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl stop resource ora.rac1.vip -f 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl stop resource ora.rac2.vip -f

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl modify nodeapps -A 192.168.60.101/255.255.255.0/enp0s3 -n rac1 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl modify nodeapps -A 192.168.60.201/255.255.255.0/enp0s3 -n rac2

[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl start resource ora.rac1.vip -f 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/crsctl start resource ora.rac2.vip -f

ps:–crsctl eval stop resource ora.cdbrac.db -unsupported(划重点12c的变化,eval是模拟命令)Doc ID 1966448.1

8.启动本地监听 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start listener -n rac1 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl start listener -n rac2

9.修改数据库实例参数 
alter system set local_listener=’(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.60.101)(PORT=1521))))’ scope=both sid=‘prod1’; 
alter system set local_listener=’(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.60.201)(PORT=1521))))’ scope=both sid=‘prod2’; 
alter system register;

10.检查资源状态 
ifconfig 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan 
[root@rac1 ~]# /oracle/app/11.2.0/grid/bin/srvctl config scan_listener 
grid lsnrctl status grid dlsnrctl status listener_scan1 
grid$crsctl status res –t 

 

原文链接: https://www.modb.pro/db/22925?cyn

http://blog.itpub.net/29715045/viewspace-2681967/

 

posted @ 2020-05-25 14:14  钱若梨花落  阅读(748)  评论(0编辑  收藏  举报