Oracle 11g RAC 修改IP-阿里云开发者社区

开发者社区> 余二五> 正文

Oracle 11g RAC 修改IP

简介:
+关注继续查看

Oracle 11g RAC 修改IP

     在RAC环境下修改ip地址,会造成数据库停机,所以在搭建、配置RAC前,必须做好ip规划,而主机名是不允许修改的,如果修改必须重新安装CRS.


系统环境:

操作系统:RedHat EL5.5

集群软件: GI 11G

数据库软件:Oracle 11.2.0.1


修改ip 方法:


一、禁用和停止相关的resource

1)禁用和停止 vip service

[root@node1 ~]# srvctl disable vip -h

Disable the VIPs from Oracle Clusterware management.

Usage: srvctl disable vip -i <vip_name> [-v]
   -i <vip_name>            VIP name
   -h                       Print usage
   -v                       Verbose output

[root@node1 ~]# srvctl disable vip -i "node1-vip"
[root@node1 ~]# srvctl disable vip -i "node2-vip"


[root@node1 ~]# srvctl stop vip -h

Stop the specified VIP or VIPs on a node.

Usage: srvctl stop vip { -n <node_name>  | -i <vip_name> } [-f] [-r] [-v]
   -n <node_name>           Node name
   -i <vip_name>            VIP name
   -r                       Relocate VIP
   -f                       Force stop
   -h                       Print usage
   -v                       Verbose output
[root@node1 ~]# srvctl stop vip -n node1
[root@node1 ~]# srvctl stop vip -n node2


2)禁用和停止listener

[root@node1 ~]# srvctl disable listener
[root@node1 ~]# srvctl stop listener

3)禁用和停止scan及scan_listener
[root@node1 ~]# srvctl disable scan_listener
[root@node1 ~]# srvctl stop scan_listener
[root@node1 ~]# srvctl disable scan
[root@node1 ~]# srvctl stop scan

[root@node1 ~]#

4)在所有节点停止CRS 服务
[root@node1 ~]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'node1'
CRS-2673: Attempting to stop 'ora.crsd' on 'node1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'node1'
CRS-2673: Attempting to stop 'ora.DG2.dg' on 'node1'
CRS-2673: Attempting to stop 'ora.OCR_VOTE.dg' on 'node1'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'node1'
CRS-2673: Attempting to stop 'ora.DG1.dg' on 'node1'
CRS-2673: Attempting to stop 'ora.RCY1.dg' on 'node1'
CRS-2677: Stop of 'ora.registry.acfs' on 'node1' succeeded
CRS-2677: Stop of 'ora.OCR_VOTE.dg' on 'node1' succeeded
CRS-2677: Stop of 'ora.RCY1.dg' on 'node1' succeeded
CRS-2677: Stop of 'ora.DG2.dg' on 'node1' succeeded
CRS-2677: Stop of 'ora.DG1.dg' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'node1'
CRS-2677: Stop of 'ora.asm' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.eons' on 'node1'
CRS-2673: Attempting to stop 'ora.ons' on 'node1'
CRS-2677: Stop of 'ora.ons' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'node1'
CRS-2677: Stop of 'ora.net1.network' on 'node1' succeeded
CRS-2677: Stop of 'ora.eons' on 'node1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'node1' has completed
CRS-2677: Stop of 'ora.crsd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.mdnsd' on 'node1'
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'node1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'node1'
CRS-2673: Attempting to stop 'ora.evmd' on 'node1'
CRS-2673: Attempting to stop 'ora.asm' on 'node1'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'node1'
CRS-2677: Stop of 'ora.cssdmonitor' on 'node1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'node1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'node1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'node1' succeeded
CRS-2677: Stop of 'ora.asm' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'node1'
CRS-2677: Stop of 'ora.cssd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'node1'
CRS-2673: Attempting to stop 'ora.diskmon' on 'node1'
CRS-2677: Stop of 'ora.drivers.acfs' on 'node1' succeeded
CRS-2677: Stop of 'ora.gpnpd' on 'node1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'node1'
CRS-2677: Stop of 'ora.gipcd' on 'node1' succeeded
CRS-2677: Stop of 'ora.diskmon' on 'node1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.

二、在操作系统下修改IP(所有节点)


[root@node1 ~]# cat /etc/hosts(原ip 信息)


# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1                localhost
192.168.8.11  node1
192.168.8.13  node1-vip
10.10.10.11  node1-priv

192.168.8.12  node2
192.168.8.14  node2-vip
10.10.10.12   node2-priv

192.168.8.15   rac_scan

[root@node1 ~]# vi /etc/hosts(修改后ip 信息)

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1                localhost
192.168.8.111  node1
192.168.8.113  node1-vip
10.10.10.11  node1-priv

192.168.8.112  node2
192.168.8.114  node2-vip
10.10.10.12   node2-priv

192.168.8.115   rac_scan
~

[root@node1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0


三、重新启动CRS 服务

[root@node1 ~]# crsctl start crs
CRS-4123: Oracle High Availability Services has been started.


[root@node1 ~]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online


被禁用服务未启动
[root@node1 ~]# crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DG1.dg     ora....up.type OFFLINE   OFFLINE               
ora.DG2.dg     ora....up.type ONLINE    ONLINE    node2       
ora....ER.lsnr ora....er.type OFFLINE   OFFLINE               
ora....N1.lsnr ora....er.type OFFLINE   OFFLINE               
ora....VOTE.dg ora....up.type ONLINE    ONLINE    node1       
ora.RCY1.dg    ora....up.type ONLINE    ONLINE    node2       
ora.asm        ora.asm.type   ONLINE    ONLINE    node1       
ora.eons       ora.eons.type  ONLINE    ONLINE    node1       
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    node1       
ora....SM1.asm application    ONLINE    ONLINE    node1       
ora....E1.lsnr application    OFFLINE   OFFLINE               
ora.node1.gsd  application    OFFLINE   OFFLINE               
ora.node1.ons  application    ONLINE    ONLINE    node1       
ora.node1.vip  ora....t1.type OFFLINE   OFFLINE               
ora....SM2.asm application    ONLINE    ONLINE    node2       
ora....E2.lsnr application    OFFLINE   OFFLINE               
ora.node2.gsd  application    OFFLINE   OFFLINE               
ora.node2.ons  application    ONLINE    ONLINE    node2       
ora.node2.vip  ora....t1.type OFFLINE   OFFLINE               
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE               
ora.ons        ora.ons.type   ONLINE    ONLINE    node1       
ora.prod.db    ora....se.type OFFLINE   OFFLINE               
ora....taf.svc ora....ce.type OFFLINE   OFFLINE               
ora....ry.acfs ora....fs.type ONLINE    ONLINE    node1       
ora.scan1.vip  ora....ip.type OFFLINE   OFFLINE               
rac_web        application    ONLINE    ONLINE    node1       
web_vip        application    ONLINE    ONLINE    node1       

四、通过oifcfg 工具修改ip

[root@node1 ~]# oifcfg

Name:
       oifcfg - Oracle Interface Configuration Tool.

Usage:  oifcfg iflist [-p [-n]]
       oifcfg setif {-node <nodename> | -global} {<if_name>/<subnet>:<if_type>}...
       oifcfg getif [-node <nodename> | -global] [ -if <if_name>[/<subnet>] [-type <if_type>] ]
       oifcfg delif [{-node <nodename> | -global} [<if_name>[/<subnet>]]]
       oifcfg [-help]

       <nodename> - name of the host, as known to a communications network
       <if_name>  - name by which the interface is configured in the system
       <subnet>   - subnet address of the interface
       <if_type>  - type of the interface { cluster_interconnect | public }

[root@node1 ~]# oifcfg iflist
eth0  192.168.8.0
eth1  10.10.10.0
[root@node1 ~]# oifcfg iflist -p
eth0  192.168.8.0  PRIVATE
eth1  10.10.10.0  PRIVATE
[root@node1 ~]# oifcfg iflist -p -n
eth0  192.168.8.0  PRIVATE  255.255.255.0
eth1  10.10.10.0  PRIVATE  255.255.255.0
[root@node1 ~]# oifcfg getif -global
eth0  192.168.8.0  global  public
eth1  10.10.10.0  global  cluster_interconnect

删除原来的网卡ip 配置信息

[root@node1 ~]# oifcfg delif 
[root@node1 ~]# oifcfg getif
[root@node1 ~]# oifcfg getif -global


重新配置网卡ip信息

[root@node1 ~]# oifcfg setif -global eth0/192.168.8.0:public
[root@node1 ~]# oifcfg getif
eth0  192.168.8.0  global  public
[root@node1 ~]# oifcfg setif -global eth1/10.10.10.0:cluster_interconnect
[root@node1 ~]# oifcfg getif -global
eth0  192.168.8.0  global  public
eth1  10.10.10.0  global  cluster_interconnect
[root@node1 ~]# oifcfg iflist
eth0  192.168.8.0
eth1  10.10.10.0
[root@node1 ~]# oifcfg iflist -p -n
eth0  192.168.8.0  PRIVATE  255.255.255.0
eth1  10.10.10.0  PRIVATE  255.255.255.0
查看并重新配置VIP

[root@node1 ~]# srvctl config vip -n node1
VIP exists.:node1
VIP exists.: /node1-vip/192.168.8.113/255.255.255.0/eth0
[root@node1 ~]# srvctl config vip -n node2
VIP exists.:node2
VIP exists.: /node2-vip/192.168.8.114/255.255.255.0/eth0
[root@node1 ~]# clear

[root@node1 ~]# srvctl modify nodeapps -h

Modifies the configuration for a node application.

Usage: srvctl modify nodeapps {[-n <node_name> -A <new_vip_address>/<netmask>[/if1[|if2|...]]] | [-S <subnet>/<netmask>[/if1[|if2|...]]]} [-m <multicast-ip-address>] [-p <multicast-portnum>] [-e <eons-listen-port>] [ -l <ons-local-port> ] [-r <ons-remote-port> ] [-t <host>[:<port>][,<host>[:<port>]...]] [-v]
   -A <addr_str>            Node level Virtual IP address
   -S <subnet>/<netmask>/[if1[|if2...]]  NET address spec for network
   -m <multicast-ip-address>   The multicast IP address for eONS
   -p <multicast-portnum>    The port number for eONS
   -e <eons-listen-port>     Local listen port for eONS daemon (Default port number is 2016)
   -l <ons-local-port>      ONS listening port for local client connections
   -r <ons-remote-port>     ONS listening port for connections from remote hosts
   -t <host>[:<port>][,<host>[:<port>]...]  List of remote host/port pairs for ONS daemons outside this cluster
   -h                       Print usage
   -v                       Verbose output


[root@node1 ~]# srvctl modify nodeapps -A 192.168.8.113/255.255.255.0/eth0 -n node1
[root@node1 ~]# srvctl modify nodeapps -A 192.168.8.114/255.255.255.0/eth0 -n node2
[root@node1 ~]# srvctl config vip -n node1
VIP exists.:node1
VIP exists.: /node1-vip/192.168.8.113/255.255.255.0/eth0
[root@node1 ~]# srvctl config vip -n node2
VIP exists.:node2
VIP exists.: /node2-vip/192.168.8.114/255.255.255.0/eth0

查看并重新配置SCAN:

[root@node1 ~]# srvctl config scan
SCAN name: rac_scan, Network: 1/192.168.8.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /192.168.8.15/192.168.8.15
[root@node1 ~]# srvctl modify scan -h

Modifies the SCAN name.

Usage: srvctl modify scan -n <scan_name>
   -n <scan_name>           Domain name qualified SCAN name
   -h                       Print usage
[root@node1 ~]# srvctl modify scan -n rac_scan
[root@node1 ~]# srvctl config scan
SCAN name: rac_scan, Network: 1/192.168.8.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac_scan/192.168.8.115
[root@node1 ~]#

如果需要修改private ip ,同样可用oifcfg 配置eth1网卡即可!

五、配置完成,启动相关的服务和resource

启动VIP、监听、scan和scan_listener、数据库
[root@node1 ~]# srvctl enable listener      
[root@node1 ~]# srvctl enable vip -i "node1-vip"
[root@node1 ~]# srvctl enable vip -i "node2-vip"
[root@node1 ~]# srvctl enable scan_listener
[root@node1 ~]# srvctl enable scan
[root@node1 ~]# srvctl enable database -d prod
[root@node1 ~]# srvctl start listener      
[root@node1 ~]# srvctl start vip -n node1,node2
     [
[root@node1 ~]# srvctl start scan_listener
[root@node1 ~]# srvctl start scan
[root@node1 ~]# srvctl start database -d prod










本文转自 客居天涯 51CTO博客,原文链接:http://blog.51cto.com/tiany/1378083,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
[20171101]修改oracle口令安全问题.txt
[20171101]修改oracle口令安全问题.txt --//等保的问题,做一些关于修改oracle口令方面的测试. 1.oracle修改口令一般如下方式: alter user scott identified by oracle; password scott 第三方工具,通常也是执行以上类似的命令.
947 0
Mysql、SqlServer和Oracle 添加修改删除字段
MySql:添加单列:ALTER TABLE 表名 ADD 列名 数据类型添加多列:ALTER TABLE 表名 ADD 列名1 数据类型1,Add 列名2 数据类型2修改单列数据类型:ALTER TABLE 表名 CHANGE COLUMN 列名 数据类型同时修改多列数据类型:ALTE...
587 0
阿里云服务器端口号设置
阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建.   have fun!  将编程看作是一门艺术,而不单单是个技术。
3958 0
修改oracle配置参数
版权声明:转载请注明出处:http://blog.csdn.net/dajitui2024 https://blog.csdn.net/dajitui2024/article/details/79396645 ...
769 0
oracle修改字符集
sqlplus /nolog conn /as sysdba   Oracle 使用时间长了, 新增了许多user 和tablespace. 需要清理一下 对于单个user和tablespace 来说, 可以使用如下命令来完成。
784 0
+关注
12613
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
文娱运维技术
立即下载
《SaaS模式云原生数据仓库应用场景实践》
立即下载
《看见新力量:二》电子书
立即下载