oracle用户登录,所有节点均进行修改:
[oracle@node1 db]$ cd $ORACLE_HOME/network/admin # 修改前先进行文件备份 [oracle@node1 admin]$ cp -a tnsnames.ora tnsnames.ora.bak [oracle@node1 admin]$ cp -a listener.ora listener.ora.bak然后检查者两个文件,文件中Public IP和VIP为hostname的不做修改,文件中Public IP和VIP为IP地址的修改为新的Public IP和VIP。
示例:
# 将文件中的192.168.56.20修改为新的Public IP:192.168.100.20, # 文件中的node1-vip保持不变 [oracle@node1 admin]$ cat listener.ora # listener.ora.node1 Network Configuration File: /oracle/product/10.2.0/db/network/admin/listener.ora.node1 # Generated by Oracle configuration tools. SID_LIST_LISTENER_NODE1 = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/product/10.2.0/db) (PROGRAM = extproc) ) ) LISTENER_NODE1 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)(IP = FIRST)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.20)(PORT = 1521)(IP = FIRST)) ) ) 3.6 修改 /etc/hostsroot用户登录,所有节点均修改:
# 首先备份hosts文件 [root@node1 admin]# cp -a /etc/hosts /etc/hosts.bak #查看当前hosts配置文件 [root@node1 admin]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.56.20 node1 192.168.56.21 node2 192.168.56.98 node1-vip 192.168.56.99 node2-vip 10.1.1.1 node1-priv 10.1.1.2 node2-priv将其中的Public IP和VIP均修改为新的IP地址:
# 修改后的hosts文件 [root@node1 admin]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 192.168.100.20 node1 192.168.100.21 node2 192.168.100.98 node1-vip 192.168.100.99 node2-vip 10.1.1.1 node1-priv 10.1.1.2 node2-priv 3.7 修改操作系统IProot用户登录,将所有节点的Public IP修改为新地址,然后重启网络服务:
[root@node1 ~]# cd /etc/sysconfig/network-scripts/ [root@node1 network-scripts]# vim ifcfg-eth0 # Intel Corporation 82540EM Gigabit Ethernet Controller DEVICE=eth0 BOOTPROTO=none ONBOOT=yes HWADDR=08:00:27:b2:d1:1b NETMASK=255.255.255.0 IPADDR=192.168.100.20 TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes # 重启网络服务 [root@node1 network-scripts]# service network restart修改成功后,root用户登录,确保所有节点的Public IP和Private IP可以相互ping通。
3.8 重启crs及crs资源root用户登录,所有节点均执行以下操作:
# 首先关闭CRS,(所有节点执行完该命令再继续下一步) [root@node1 ~]# crsctl stop crs Stopping resources. This could take several minutes. Successfully stopped CRS resources. Stopping CSSD. Shutting down CSS daemon. Shutdown request successfully issued. # 开启CRS(所有节点) [root@node1 ~]# crsctl start crs Attempting to start CRS stack The CRS stack will be started shortly稍等片刻,所有节点的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