日期:2014-05-16  浏览次数:20563 次

10G RAC节点2宕机通过修改listener.ora实现客户端通过节点2VIP连接到数据库
根据周亮ORACLE DBA实战里的一个实验做的。
环境描述:两节点10G RAC环境,节点2宕机。此时客户端通过原节点2 VIP地址无法连接至数据库。客户端较多修改不便需要在服务器上进行修改。


1.检查节点1监听状态、/etc/hosts 、IP信息

[oracle@rac1 admin]$ ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:93:AD:F2  
          inet addr:192.168.57.219  Bcast:192.168.57.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:112453 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2496 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:68881461 (65.6 MiB)  TX bytes:332010 (324.2 KiB)

eth0:1    Link encap:Ethernet  HWaddr 08:00:27:93:AD:F2  
          inet addr:192.168.57.221  Bcast:192.168.57.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0:2    Link encap:Ethernet  HWaddr 08:00:27:93:AD:F2  
          inet addr:192.168.57.222  Bcast:192.168.57.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth1      Link encap:Ethernet  HWaddr 08:00:27:33:81:45  
          inet addr:192.168.58.1  Bcast:192.168.58.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1750 errors:0 dropped:0 overruns:0 frame:0
          TX packets:150571 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:150427 (146.9 KiB)  TX bytes:130002468 (123.9 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:82328 errors:0 dropped:0 overruns:0 frame:0
          TX packets:82328 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:13965995 (13.3 MiB)  TX bytes:13965995 (13.3 MiB)
[oracle@rac1 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.57.219   rac1.bys.com   rac1
192.168.57.220   rac2.bys.com   rac2
192.168.57.221    rac1-vip
192.168.57.222    rac2-vip
192.168.58.1      rac1-priv
192.168.58.2  &n