1. 检查RAC是否正常
[oracle@racdb01 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac.db application ONLINE ONLINE racdb01
ora....s1.inst application ONLINE ONLINE racdb01
ora....s2.inst application ONLINE ONLINE racdb02
ora....esdb.cs application ONLINE ONLINE racdb01
ora....es1.srv application ONLINE ONLINE racdb01
ora....es2.srv application ONLINE ONLINE racdb02
ora....01.lsnr application ONLINE ONLINE racdb01
ora....b01.gsd application ONLINE ONLINE racdb01
ora....b01.ons application ONLINE ONLINE racdb01
ora....b01.vip application ONLINE ONLINE racdb01
ora....02.lsnr application ONLINE ONLINE racdb02
ora....b02.gsd application ONLINE ONLINE racdb02
ora....b02.ons application ONLINE ONLINE racdb02
ora....b02.vip application ONLINE ONLINE racdb02
2. 连接到数据库,检查连接到那个instance
select instance_name from v$instance;
INSTANCE_NAME
--------------
rac2
3. 测试
测试一
拔除 rac2 的public 网线
rac2 自动reboot
[oracle@racdb01 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac.db application ONLINE ONLINE racdb01
ora....s1.inst application ONLINE ONLINE racdb01
ora....s2.inst application ONLINE OFFLINE
ora....esdb.cs application ONLINE ONLINE racdb01
ora....es1.srv application ONLINE ONLINE racdb01
ora....es2.srv application ONLINE OFFLINE
ora....01.lsnr application ONLINE ONLINE racdb01
ora....b01.gsd application ONLINE ONLINE racdb01
ora....b01.ons application ONLINE ONLINE racdb01
ora....b01.vip application ONLINE ONLINE racdb01
ora....02.lsnr application ONLINE OFFLINE
ora....b02.gsd application ONLINE OFFLINE
ora....b02.ons application ONLINE OFFLINE
ora....b02.vip application ONLINE ONLINE racdb01
检查连接状态,发现自动连接上instance 1
select instance_name from v$instance;
INSTANCE_NAME
--------------
rac1
復原rac2的網線,reboot rac2
[oracle@racdb02 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac.db application ONLINE ONLINE racdb01
ora....s1.inst application ONLINE ONLINE racdb01
ora....s2.inst application ONLINE ONLINE racdb02
ora....esdb.cs application ONLINE ONLINE racdb01
ora....es1.srv application ONLINE ONLINE racdb01
ora....es2.srv application ONLINE ONLINE racdb02
ora....01.lsnr application ONLINE ONLINE racdb01
ora....b01.gsd application ONLINE ONLINE racdb01
ora....b01.ons application ONLINE ONLINE racdb01
ora....b01.vip application ONLINE ONLINE racdb01
ora....02.lsnr application ONLINE ONLINE racdb02
ora....b02.gsd application ONLINE ONLINE racdb02
ora....b02.ons application ONLINE ONLINE racdb02
ora....b02.vip application ONLINE ONLINE racdb02
检查连接状态,仍然连接到instance 1
select instance_name from v$instance;
INSTANCE_NAME
--------------
rac1
测试二
拔除 rac1 的public 网线
检查状态,发现VIP1飘逸到 rac2
[oracle@racdb01 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac.db application ONLINE ONLINE racdb01
ora....s1.inst application ONLINE ONLINE racdb01
ora....s2.inst application ONLINE ONLINE racdb02
ora....esdb.cs application ONLINE ONLINE racdb01
ora....es1.srv application ONLINE OFFLINE
ora....es2.srv application ONLINE ONLINE racdb02
ora....01.lsnr application ONLINE OFFLINE
ora....b01.gsd application ONLINE ONLINE racdb01
ora....b01.ons application ONLINE ONLINE racdb01
ora....b01.vip application ONLINE ONLINE racdb02
ora....02.lsnr application ONLINE ONLINE racdb02
ora....b02.gsd application ONLINE ONLINE racdb02
ora....b02.ons application ONLINE ONLINE racdb02
ora....b02.vip application ONLINE ONLINE racdb02
过了两分钟,再次检查状态,发现异常,vip1 & vip2均down,数据库无法使用
[oracle@racdb01 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac.db application ONLINE ONLINE racdb01
ora....s1.inst application ONLINE ONLINE racdb01
ora....s2.inst application ONLINE OFFLINE
ora....esdb.cs application OFFLINE OFFLINE
ora....es1.srv application ONLINE OFFLINE
ora....es2.srv application ONLINE OFFLINE
ora....01.lsnr application ONLINE OFFLINE
ora....b01.gsd application ONLINE ONLINE racdb01
ora....b01.ons application ONLINE ONLINE racdb01
ora....b01.vip application ONLINE OFFLINE
ora....02.lsnr application ONLINE OFFLINE
ora....b02.gsd application ONLINE OFFLINE
ora....b02.ons application ONLINE OFFLINE
ora....b02.vip application ONLINE OFFLINE
试图检查RAC2上的CRS状态,报错,手工启动CRS无果
[oracle@racdb02 ~]$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.
测试失败,寻找原因中.......