oracle 更改ip

 RAC IP 但是它涉及到OCR 稳定第一。在做之前,要手动的进行一个备份, OCRBlog的备份与恢复

http://blog.csdn.net/tianlesoftware/archive/2010/04/09/5467273.aspx

另外Public/PrivateCRS

实验平台:

一. 停止oracle相关的所有进程, 包括数据库, asm, node application, crs本身.

1.1
[root@raw1 bin]# ./crs_stat -t

------------------------------------------------------------

ora.raw.dmm.cs applicationOFFLINEOFFLINE

ora....w1.inst applicationOFFLINEOFFLINE

ora....SM1.asm applicationOFFLINEOFFLINE

ora.raw1.gsdapplicationOFFLINEOFFLINE

ora.raw1.vipapplicationOFFLINEOFFLINE

ora....W2.lsnr applicationOFFLINEOFFLINE

ora.raw2.onsapplicationOFFLINEOFFLINE

1.2
  1.3 [root@raw1 bin]# ./srvctl stop asm -n raw1

1.4
[root@raw1 bin]# ./srvctl stop nodeapps -n raw2

1.5
[root@raw1 bin]# /etc/init.d/init.crs stop

Stopping resources.

Stopping CSSD.

Shutdown request successfully issued.

Shutting down Oracle Cluster Ready Services (CRS):

Successfully stopped CRS resources

Shutting down CSS daemon.

Shutdown has begun. The daemons should exit soon.

2.1 [root@raw1 bin]# vi /etc/hosts

# that require network functionality will fail.

10.85.10.221 raw2

192.168.1.221 raw2-priv

10.85.10.223 raw2-vip

在两个节点上分别修改eth0和eth1地址:

DEVICE=eth0

IPADDR=10.85.10.219

ONBOOT=yes

[root@raw2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0

BOOTPROTO=static

NETMASK=255.255.255.0

GATEWAY=10.85.10.253

DEVICE=eth1

IPADDR=192.168.1.219

ONBOOT=yes

[root@raw2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth1

BOOTPROTO=static

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

2.3 [root@raw1 ~]# service network restart


  在两个节点启动crs, 并关闭随crs启动的应用程序
/etc/init.d/init.crs start

[root@raw2 ~]#Startup will be queued to init within 90 seconds.


由于oracle所有应用设置为自动启动, 所以在crs启动时会试图启动所有的服务, 但是在对oracle相关的ip地址进行设置时需要crs处于运行状态.   [root@raw1 bin]# ./srvctl stop asm -n raw2
[root@raw1 bin]# ./srvctl stop nodeapps -n raw1

[root@raw1 bin]# ./crs_stat -t

------------------------------------------------------------

ora.raw.dmm.cs applicationOFFLINEOFFLINE

ora....w1.inst applicationOFFLINEOFFLINE

ora....SM1.asm applicationOFFLINEOFFLINE

ora.raw1.gsdapplicationOFFLINEOFFLINE

ora.raw1.vipapplicationOFFLINEOFFLINE

ora....W2.lsnr applicationOFFLINEOFFLINE

ora.raw2.onsapplicationOFFLINEOFFLINE

3.2 注: 如果修改的网段相同,可以不做这一步。

查看当前配置:

eth010.85.10.0globalpublic

[root@raw1 bin]# ./oifcfg delif -global eth0

[root@raw1 bin]# ./oifcfg getif

重新添加

10.85.10.0:public

192.168.1.0:cluster_interconnect

eth010.85.10.0globalpublic

[root@racnode2 bin]# ./oifcfg iflist

eth1192.168.0.0

eth3192.168.200.0

eth5192.168.200.0

这里地址最一个为代表的是一个网段。否在在启动网络地址和网络接口操作中出错 [7]

修改VIP

[root@raw1 bin]# ./srvctl modify nodeapps -n raw2 -A 10.85.10.223/255.255.255.0/eth0

3.4 [root@raw1 bin]# vi/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora.raw1

LISTENER_RAW1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST =)

注意:如果你使用了ocfs,修改ocfs配置文件(/etc/ocfs/cluster.conf),验证修改后是否可用。

3.5 [root@raw1 bin]# ./srvctl start nodeapps -n raw1

[root@raw1 bin]# ./srvctl start asm -n raw1

[root@raw1 bin]# ./srvctl start instance -d raw -i raw1

[root@raw1 bin]# ./crs_stat -t

------------------------------------------------------------

ora.raw.dmm.cs applicationONLINEONLINEraw2

ora....w1.inst applicationONLINEONLINEraw1

ora....SM1.asm applicationONLINEONLINEraw1

ora.raw1.gsdapplicationONLINEONLINEraw1

ora.raw1.vipapplicationONLINEONLINEraw1

ora....W2.lsnr applicationONLINEONLINEraw2

ora.raw2.onsapplicationONLINEONLINEraw2

若启动出现问题,参考我的blog:

启动与关闭

3.6
[root@raw1 bin]# ifconfig

inet addr:10.85.10.219Bcast:10.85.10.255Mask:255.255.255.0

eth0:1Link encap:EthernetHWaddr 00:0C:29:55:28:FD

... ...

inet addr:192.168.1.219Bcast:192.168.1.255Mask:255.255.255.0

loLink encap:Local Loopback

[root@raw2 ~]# ifconfig

inet addr:10.85.10.221Bcast:10.85.10.255Mask:255.255.255.0

eth0:1Link encap:EthernetHWaddr 00:0C:29:2E:28:EE

... ...

inet addr:192.168.1.221Bcast:192.168.1.255Mask:255.255.255.0

loLink encap:Local Loopback

... ...

 

你可能感兴趣的:(oracle)