B
bevislee
Unregistered / Unconfirmed
GUEST, unregistred user!
环境:DEPHI 7 ORACLE10G RAC <br><br>ORACLE TNSNAMES配置<br><br><br>总连接<br>ORAHB =<br> (DESCRIPTION =<br> (ADDRESS_LIST =<br> (ADDRESS = (PROTOCOL = TCP)(HOST = 10.180.1.2)(PORT = 1521))<br> (ADDRESS = (PROTOCOL = TCP)(HOST = 10.180.1.3)(PORT = 1521))<br> (LOAD_BALANCE = yes)<br> )<br> (CONNECT_DATA =<br> (SERVICE_NAME = orahb)<br> (FAILOVER_MODE =<br> (TYPE = SELECT)<br> (METHOD = BASIC)<br> (RETRIES = 80)<br> (DELAY = 5)<br> )<br> )<br> )<br><br><br>服务器1连接<br>ORAHB1 =<br> (DESCRIPTION =<br> (ADDRESS = (PROTOCOL = TCP)(HOST = 10.180.1.2)(PORT = 1521))<br> (CONNECT_DATA =<br> (SERVER = DEDICATED)<br> (SERVICE_NAME = orahb)<br> (INSTANCE_NAME = orahb1)<br> )<br> )<br><br><br>服务器2连接<br>ORAHB2 =<br> (DESCRIPTION =<br> (ADDRESS = (PROTOCOL = TCP)(HOST = 10.180.1.3)(PORT = 1521))<br> (CONNECT_DATA =<br> (SERVER = DEDICATED)<br> (SERVICE_NAME = orahb)<br> (INSTANCE_NAME = orahb2)<br> )<br> )<br><br>用ADO控件连接总的连接串ORAHB,并确保ADOConnection1连接到服务器1上,连接正常,当手工shutdown服务器1上的数据库时,<br><br>ADOConnection1.Connect:=false;<br><br>ADOConnection1.Connect:=True; 都正常,但连接ADOConnection1的Query报告数据库连接失败,事实上,ADOConnection1.Connect:=false;ADOConnection1.Connect:=true操作并没有使连接自动切换到服务器2上,但将ADOConnection1重建或将程序关闭再打开时连接正常。请问,如何配置能使数据库1连接失败时自动切换到数据库2上?