各位好:
我在两节点实例的的RAC环境中创建服务端的TAF故障透明切换服务,并且 FAILOVER_TYPE=SELECT, FAILOVER_METHOD=BASIC,连接监听后,像在其中一个节点执行select查询,杀掉这个连接对应的 Server process或关闭这个实例,但并不会自动切换连接到另一个实例和继续执行SQL,而是中断报错和自动中断连接。
创建过程如下:
[oracle@dbp tmp]$ srvctl add service -d wxxrdb -s oltp -r wxxrdb1 -a wxxrdb2 -P preconnect
[oracle@dbp tmp]$ srvctl config service -d wxxrdb -s oltp -a
oltp PREF: wxxrdb1 AVAIL: wxxrdb2 TAF: preconnect
[oracle@dbs tmp]$ srvctl status service -d wxxrdb -s oltp
Service oltp is running on instance(s) wxxrdb1
SQL> exec dbms_service.modify_service(
service_name=>'oltp',
failover_type=>'BASIC',
failover_type='SELECT',
failover_retries=>5,
failover_delay=>150
);
PL/SQL procedure successfully completed.
在连接的客户端的tnsnames.ora配置对应Server TAF的条目如下:
serv_taf =
(DESCRIPTION =
(LOAD_BALANCE = YES)
(ADDRESS_LIST =
(ADDRESS = (HOST = dbp-vip)(PROTOCOL = TCP)(PORT = 1521))
(ADDRESS = (HOST = dbs-vip)(PROTOCOL = TCP)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oltp)
)
)
------
但我不创建 Server TAF的服务,直接在客户端的tnsnames.ora使用 Client TAF 的方式连接数据库,侧连接到的节点如果出现故障,是可以正常切换自动连接到另一个节点,并继续执行失败的SQL的,
Client TAF配置的条目如下:
wxxrdb_taf =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dbp-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dbs-vip)(PORT = 1521))
)
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = wxxrdb)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)
)
)
)
---------
请问这是什么原因呢?为什么配置 Server TAF的方式连接数据库时,连接的节点出现故障,却不会自动切换到另一个节点,不能继续执行SQL呢?
而使用 Client TAF 的方式连接就可以正常切换故障节点和继续执行SQL呢?
-----
待复,感谢!