Oracle 10g RAC修改public ip、vip和private ip
1.IP地址规划 Hostname当前IP修改后IPPublic IP node1 192.168.56.20 192.168.100.20
Public IP node2 192.168.56.21 192.168.100.21
VIP node1-vip 192.168.56.98 192.168.100.98
VIP node2-vip 192.168.56.99 192.168.100.99
Private IP node1-priv 10.1.1.1 10.10.10.1
Private IP node1-priv 10.1.1.2 10.10.10.2
2.实施步骤规划
关闭所有crs资源,保留crs进程
备份OCR
修改 Public IP
修改 VIP
修改 tnsnames.ora 和 listener.ora
修改 /etc/hosts
修改操作系统IP
重启crs及crs资源
修改 local_listener
3.详细操作示例 3.1 关闭所有crs资源因为修改Public IP和vip的命令均依赖于crs,所以修改修改Public IP和vip前需要关闭所有的crs资源,保留crs进程。
首先查看集群状态
[root@node1 ~]# crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.iesdb.db application ONLINE ONLINE node1 ora....b1.inst application ONLINE ONLINE node1 ora....b2.inst application ONLINE ONLINE node2 ora....srac.cs application ONLINE ONLINE node2 ora....db1.srv application ONLINE ONLINE node1 ora....db2.srv application ONLINE ONLINE node2 ora....SM1.asm application ONLINE ONLINE node1 ora....E1.lsnr application ONLINE ONLINE node1 ora.node1.gsd application ONLINE ONLINE node1 ora.node1.ons application ONLINE ONLINE node1 ora.node1.vip application ONLINE ONLINE node1 ora....SM2.asm application ONLINE ONLINE node2 ora....E2.lsnr application ONLINE ONLINE node2 ora.node2.gsd application ONLINE ONLINE node2 ora.node2.ons application ONLINE ONLINE node2 ora.node2.vip application ONLINE ONLINE node2
关闭所有的crs资源
oracle 用户登录节点1,依次执行以下命令:
[oracle@node1 ~]$ srvctl stop database -d iesdb [oracle@node1 ~]$ srvctl stop asm -n node1 [oracle@node1 ~]$ srvctl stop asm -n node2 [oracle@node1 ~]$ srvctl stop nodeapps -n node1 [oracle@node1 ~]$ srvctl stop nodeapps -n node2现在查看crs资源已经全部关闭:
[oracle@node1 ~]$ crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.iesdb.db application OFFLINE OFFLINE ora....b1.inst application OFFLINE OFFLINE ora....b2.inst application OFFLINE OFFLINE ora....srac.cs application OFFLINE OFFLINE ora....db1.srv application OFFLINE OFFLINE ora....db2.srv application OFFLINE OFFLINE ora....SM1.asm application OFFLINE OFFLINE ora....E1.lsnr application OFFLINE OFFLINE ora.node1.gsd application OFFLINE OFFLINE ora.node1.ons application OFFLINE OFFLINE ora.node1.vip application OFFLINE OFFLINE ora....SM2.asm application OFFLINE OFFLINE ora....E2.lsnr application OFFLINE OFFLINE ora.node2.gsd application OFFLINE OFFLINE ora.node2.ons application OFFLINE OFFLINE ora.node2.vip application OFFLINE OFFLINE 3.2 备份OCR