ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RAC的TAF简单测试(五)

RAC的TAF简单测试(五)

原创 Linux操作系统 作者:yangtingkun 时间:2007-05-02 00:00:00 0 删除 编辑

OracleRAC的高可用功能除了负载均衡还包括TAFTransparent Application Failover)。

RACTAF是指会话连接到一个实例上,如果这个实例出现了故障,Oracle会自动将会话迁移到另一个实例上。

RACTAF简单测试(一):http://yangtingkun.itpub.net/post/468/283068

RACTAF简单测试(二):http://yangtingkun.itpub.net/post/468/283277

RACTAF简单测试(三):http://yangtingkun.itpub.net/post/468/283474

RACTAF简单测试(四):http://yangtingkun.itpub.net/post/468/284898

这篇简单讨论一下TAF服务器端的PRECONNECT设置


上一篇讨论了客户端配置PRECONNECT方式的TAF,下面介绍一下RAC服务器端设置PRECONNECT服务的方法:

通过图形界面启动dbca

在欢迎界面选择Oracle Real Application Cluster database

选择Service Management

选择CLUSTER数据库,这里是testrac

Database Service界面添加要启动的服务:PRE_TESTRAC,然后将TAF策略修改为Pre-connect,点击Finish,完成配置。

这是服务器端的tnsnames.ora中添加了下面的配置:

PRE_TESTRAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = racnode1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = racnode2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRE_TESTRAC)
(FAILOVER_MODE =
(BACKUP = PRE_TESTRAC_PRECONNECT)
(TYPE = SELECT)
(METHOD = PRECONNECT)
(RETRIES = 180)
(DELAY = 5)
)
)
)

PRE_TESTRAC_PRECONNECT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = racnode1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = racnode2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRE_TESTRAC_PRECONNECT)
(FAILOVER_MODE =
(BACKUP = PRE_TESTRAC)
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
)
)
)

同时,通过srvctl可以监控、管理建立的PER_TESTRAC服务:

bash-2.03$ srvctl status service -d testrac
Service PRE_TESTRAC is running on instance(s) testrac2, testrac1

建立了服务之后,客户端可以直接配置PRE_TESTRAC这个服务,比如客户端tnsnames.ora的配置为:

PRE_TESTRAC_SERVICE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.224)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.25.198.225)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRE_TESTRAC)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = PRECONNECT)
(BACKUP = PRE_TESTRAC_PRECONNECT)
)
)
)

通过服务名PRE_TESTRAC_SERVICE建立的连接就启用了PRECONNECTTAF

SQL> CONN TEST/TEST@PRE_TESTRAC_SERVICE已连接。
SQL> SELECT SID, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER
2 FROM V$SESSION
3 WHERE SID IN (SELECT SID FROM V$MYSTAT WHERE ROWNUM = 1);

SID FAILOVER_TYPE FAILOVER_M FAI
---------- ------------- ---------- ---
127 SELECT PRECONNECT NO

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/4227/viewspace-69261/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2007-12-29

  • 博文量
    1955
  • 访问量
    10488471