- 论坛徽章:
- 0
|
我在client的tnsnames.ora中设置如下:
- RAC =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.248)(PORT = 1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.249)(PORT = 1521))
- (LOAD_BALANCE = on)
- (FAILOVER = on)
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = RAC.WORLD)
- (FAILOVER_MODE=
- (TYPE=select)
- (method=basic)
- (retries = 200)
- (delay = 5)
- )
- )
- )
- LISTENERS_RAC =
- (ADDRESS_LIST =
- (FAIL_OVER=on)
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.248)(PORT = 1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.249)(PORT = 1521))
- )
- RAC1 =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.248)(PORT = 1521))
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = RAC.WORLD)
- (INSTANCE_NAME = RAC1)
- )
- )
- RAC2 =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.8.249)(PORT = 1521))
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = RAC.WORLD)
- (INSTANCE_NAME = RAC2)
- )
- )
复制代码
然后我用sqlplus sys/password@rac as sysdba连上后,停掉被连接的这太机器,然后sqlplus中做查询语句,发现要等起码10s以上,确实是可以切换到node2上。
但是这里还有两个问题
1.为何select failover_type,failover_method,failed_over from v$session;只看到:
SELECT BASIC NO
SELECT BASIC YES
其他都是no
2.直接用oci链接的应用程序怎么做切换?因为直接用oci做链接的应用程序,链接数据库的connect类的链接初始化函数只是传入username,password,ip,sid,并不读tnsnames.ora,那这时怎么办? |
|