码迷,mamicode.com
首页 > 数据库 > 详细

oracle10g rac 零宕机修改public ip&vip

时间:2014-09-01 22:41:13      阅读:569      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   os   io   ar   for   文件   

先修改1节点的

1.修改ocr中public的信息

[oracle@rac1 ~]$ oifcfg delif -global eth0
[oracle@rac1 ~]$ oifcfg setif -global eth0/172.168.1.0:public
[oracle@rac1 ~]$ oifcfg getif
eth0 172.168.1.0 global public
eth1 192.168.1.0 global cluster_interconnect

2. 停止1节点nodeapps资源

[oracle@rac1 ~]$ srvctl stop nodeapps -n rac1

3.修改主机ip

[oracle@rac1 ~]$ oifcfg iflist
eth0  172.168.10.0
eth1  192.168.1.0
[root@rac1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

修改/etc/hosts文件中1节点的public ip和vip

[root@rac1 ~]# vi /etc/hosts
#public ip
192.168.0.10 --> 192.168.1.10
#vip
192.168.1.20 --> 192.168.1.20

[root@rac2 ~]# vi /etc/hosts
#public ip
192.168.0.10 --> 192.168.1.10
#vip
192.168.1.20 --> 192.168.1.20

重启网络服务

[root@rac1 ~]# service network restart
[oracle@rac1 ~]$ oifcfg iflist
eth0  172.168.1.0
eth1  192.168.1.0

4. 修改vip

[oracle@rac1 ~]$ su                                                                   
Password:                                                                             
[root@rac1 oracle]# srvctl modify nodeapps -n rac1 -A 172.168.1.20/255.255.255.0/eth0 

5. 修改监听文件

$ vi $ORACLE_HOME/network/admin/listener.ora

6. 启动nodeapps资源

[oracle@rac1 ~]$ srvctl start nodeapps -n rac1
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 01-SEP-2014 17:13:26
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:Copyright (c) 1991, 2010, Oracle.  All rights reserved.
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:Starting /oracle/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:TNSLSNR for Linux: Version 10.2.0.5.0 - Production
rac1:ora.rac1.LISTENER_RAC1.lsnr:System parameter file is /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
rac1:ora.rac1.LISTENER_RAC1.lsnr:Log messages written to /oracle/app/oracle/product/10.2.0/db_1/network/log/listener_rac1.log
rac1:ora.rac1.LISTENER_RAC1.lsnr:Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.21)(PORT=1521)(IP=FIRST)))
rac1:ora.rac1.LISTENER_RAC1.lsnr:TNS-12545: Connect failed because target host or object does not exist
rac1:ora.rac1.LISTENER_RAC1.lsnr: TNS-12560: TNS:protocol adapter error
rac1:ora.rac1.LISTENER_RAC1.lsnr:  TNS-00515: Connect failed because target host or object does not exist
rac1:ora.rac1.LISTENER_RAC1.lsnr:   Linux Error: 99: Cannot assign requested address
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:Listener failed to start. See the error message(s) above...
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 01-SEP-2014 17:13:29
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:Copyright (c) 1991, 2010, Oracle.  All rights reserved.
rac1:ora.rac1.LISTENER_RAC1.lsnr:
rac1:ora.rac1.LISTENER_RAC1.lsnr:Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.21)(PORT=1521)(IP=FIRST)))
rac1:ora.rac1.LISTENER_RAC1.lsnr:TNS-12560: TNS:protocol adapter error
rac1:ora.rac1.LISTENER_RAC1.lsnr: TNS-00530: Protocol adapter error
rac1:ora.rac1.LISTENER_RAC1.lsnr:  Linux Error: 113: No route to host
rac1:ora.rac1.LISTENER_RAC1.lsnr:Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.168.1.11)(PORT=1521)(IP=FIRST)))
rac1:ora.rac1.LISTENER_RAC1.lsnr:TNS-12541: TNS:no listener
rac1:ora.rac1.LISTENER_RAC1.lsnr: TNS-12560: TNS:protocol adapter error
rac1:ora.rac1.LISTENER_RAC1.lsnr:  TNS-00511: No listener
rac1:ora.rac1.LISTENER_RAC1.lsnr:   Linux Error: 111: Connection refused
CRS-0215: Could not start resource ‘ora.rac1.LISTENER_RAC1.lsnr‘.

监听资源没有起来,可以看到其他资源均正常启动

[oracle@rac1 admin]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    OFFLINE    
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2           
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2        
ora.test.db    application    ONLINE    ONLINE    rac1        
ora....t1.inst application    ONLINE    ONLINE    rac1        
ora....t2.inst application    ONLINE    ONLINE    rac2

7. 手动启动监听

[oracle@rac1 admin]$ lsnrctl start

LSNRCTL for Linux: Version 10.2.0.5.0 - Production on 01-SEP-2014 17:19:50

Copyright (c) 1991, 2010, Oracle.  All rights reserved.

Starting /oracle/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.5.0 - Production
System parameter file is /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.5.0 - Production
Start Date                01-SEP-2014 17:19:50
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /oracle/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1)(PORT=1521)))
The listener supports no services
The command completed successfully

8. 动态监听注册

[oracle@rac1 admin]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Mon Sep 1 17:20:06 2014

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> alter system register;

System altered.

9. 启动监听资源

[oracle@rac1 ~]$ crsctl start resources ora.rac2.LISTENER_RAC2.lsnr
Starting resources.
Successfully started CRS resources

10. 再次查看状态,已全部启动

[oracle@rac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....SM1.asm application    ONLINE    ONLINE    rac1        
ora....C1.lsnr application    ONLINE    ONLINE    rac1
ora.rac1.gsd   application    ONLINE    ONLINE    rac1        
ora.rac1.ons   application    ONLINE    ONLINE    rac1        
ora.rac1.vip   application    ONLINE    ONLINE    rac1        
ora....SM2.asm application    ONLINE    ONLINE    rac2        
ora....C2.lsnr application    ONLINE    ONLINE    rac2           
ora.rac2.gsd   application    ONLINE    ONLINE    rac2        
ora.rac2.ons   application    ONLINE    ONLINE    rac2        
ora.rac2.vip   application    ONLINE    ONLINE    rac2        
ora.test.db    application    ONLINE    ONLINE    rac1        
ora....t1.inst application    ONLINE    ONLINE    rac1        
ora....t2.inst application    ONLINE    ONLINE    rac2 

 

接下来修改2节点,步骤同修改1节点

oracle10g rac 零宕机修改public ip&vip

标签:des   style   blog   color   os   io   ar   for   文件   

原文地址:http://www.cnblogs.com/redoracle/p/3950139.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!