11G_rac 修改public IP、VIP、scan-IP

2013年8月12日,客户有一套AIX 7.1 + oracle 11.2.0.3 的RAC数据库,现客户要求该数据库只在内网访问,需要修改public IP、VIP和scan-IP。参考了mos上的两篇文档,按文档进行了修改,过程如下:

修改前IP                    修改后IP
192.168.156.211          10.3.1.211         db1
192.168.156.212          10.3.1.212         db2
192.168.156.213          10.3.1.213         db1-vip
192.168.156.214          10.3.1.214         db1-vip
172.16.156.211            172.16.156.211   db1-priv   #不需要修改
172.16.156.212            172.16.156.212   db2-priv   #不需要修改
192.168.156.215          10.3.1.215         db-scan

一、停止CRS相关资源的启动

1、禁止所有节点自启动及停止节点数据库、监听(在一个节点执行)

[root@db1 bin]# ./srvctl disable listener -n db1
[root@db1 bin]# ./srvctl disable listener -n db2
[root@db1 bin]# ./srvctl stop listener -n db1
[root@db1 bin]# ./srvctl stop listener -n db2
[root@db1 bin]# ./srvctl disable database -d prudb
[root@db1 bin]# ./srvctl stop database -d prudb -o immediate

2、禁止所有节点自启动并停止vip(必须与/etc/hosts文件中的vip名称)(在一个节点执行)

[root@db1 bin]# ./srvctl disable vip -i db1-vip
[root@db1 bin]# ./srvctl disable vip -i db2-vip
[root@db1 bin]# ./srvctl stop vip -n db1
[root@db1 bin]# ./srvctl stop vip -n db2

3、禁止所有节点自启动并停止scan_listener(在一个节点执行)

[root@db1 bin]# ./srvctl disable scan_listener
[root@db1 bin]# ./srvctl disable scan
[root@db1 bin]# ./srvctl stop scan_listener
[root@db1 bin]# ./srvctl stop scan

4、停止节点的crs

[root@db1 bin]# ./crsctl stop crs           (所有节点执行)
CRS-2791: Starting shutdown of Oracle High Availability
…… CRS-4133: Oracle High Availability Services has been stopped.

二、修改public IP、VIP、scan_IP

1、修改/etc/hosts文件

修改public IP、VIP、scan-IP

2、修改网卡IP地址

smitty tcpip -> minimum configuration & startup -> en0

3、检查网卡配置是否生效

Ifconfig -a

4、启动crs(所有节点执行)

[root@db1 bin]# ./crsctl start crs

5、集群public IP重新设置

  • 查看public IP
[root@db1 bin]# ./oifcfg getif
en1  172.16.156.0        global  cluster_interconnect
en0  192.168.156.0       global  public
  • 删除旧配置
[root@db1 bin]# ./oifcfg delif -global en0/192.168.156.0
  • 重新配置
[root@db1 bin]# ./oifcfg setif -global en0/10.3.1.0:public
  • 验证
[root@db1 bin]# ./oifcfg getif
en1  172.16.156.0  global  cluster_interconnect
en0  10.3.1.0  global  public

6、集群vip重新设置

  • 查看集群VIP
[root@db1 bin]# ./srvctl config vip -n db1
VIP exists: /db1-vip/192.168.156.213/192.168.156.0/255.255.255.0/en0, hosting node db1
[root@db1 bin]# ./srvctl config vip -n db2
VIP exists: /db2-vip/192.168.156.214/192.168.156.0/255.255.255.0/en0, hosting node db2
  • 进行修改
[root@db1 bin]# ./srvctl modify nodeapps -n db1 -A 10.3.1.213/255.255.255.0/en0
[root@db1 bin]# ./srvctl modify nodeapps -n db2 -A 10.3.1.214/255.255.255.0/en0
  • 验证
[root@db1 bin]# ./srvctl config vip -n db1
VIP exists: /db1-vip/10.3.1.213/10.3.1.0/255.255.255.0/en0, hosting node db1
[root@db1 bin]# ./srvctl config vip -n db2
VIP exists: /db2-vip/10.3.1.214/10.3.1.0/255.255.255.0/en0, hosting node db2

7、集群scan IP重新设置

  • 查看scan IP
[root@db1 bin]# ./srvctl config scan
SCAN name: 192.168.156.215, Network: 1/192.168.156.0/255.255.255.0/en0
SCAN VIP name: scan1, IP: /192.168.156.215/192.168.156.215
  • 修改scan IP
[root@db1 bin]# ./srvctl modify scan -n 10.3.1.215
  • 验证
[root@db1 bin]# ./srvctl config scan
SCAN name: 10.3.1.215, Network: 1/10.3.1.0/255.255.255.0/en0
SCAN VIP name: scan1, IP: /10.3.1.215/10.3.1.215
  • 更新scan_listener
[root@db1 bin]# ./srvctl modify scan_listener -u

三、启动并开启CRS资源的自启动

1、启动listener

[root@db1 bin]# ./srvctl enable listener -n db1
[root@db1 bin]# ./srvctl enable listener -n db2
[root@db1 bin]# ./srvctl enable vip -i db1-vip
[root@db1 bin]# ./srvctl enable vip -i db2-vip
[root@db1 bin]# ./srvctl start listener -n db1
[root@db1 bin]# ./srvctl start listener -n db2

2、启动scan_listener

[root@db1 bin]# ./srvctl enable scan_listener
[root@db1 bin]# ./srvctl enable scan
[root@db1 bin]# ./srvctl start scan_listener

3、启动数据库

[root@db1 bin]# ./srvctl enable database -d prudb
[root@db1 bin]# ./srvctl start database -d prudb

4、在节点中修改local_listener参数

alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST =db1-vip)(PORT = 1521))' scope=both sid='prudb1';
alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST =db2-vip)(PORT = 1521))' scope=both sid='prudb2';

四、关于RAC环境下,修改hostname

hostname在安装好了以后就不能修改了。如果要修改,只能通过”删除节点->新建节点“的方式修改

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值