Oracle11G RAC搭建文档【第三部分 RAC Failover配置】

Oracle 11G RAC搭建文档,由于此文档涉及从虚拟机基础环境搭建到RAC环境搭建再到RAC Failover配置,文档内容很多,所以本分档将分为3部分发布,这样结构化更清晰,也更方便大家阅读。

【第一部分 基础环境搭建】

【第二部分 RAC环境搭建】

【第三部分 RAC Failover配置】

十、 配置RAC SESSION FAIL 51

1) 创建TAFService 52

2) 启动testrac_taf服务 52

3) 检查service运行情况 52

4) 配置service参数 53

5) 查看serviceID 53

6) 查看修改后的参数 54

7) 检查service注册情况: 54

十、配置RAC SESSION FAIL
配置Oracle 11g RAC TAF(Transparent Application Failover) 服务端配置实现failover
Oracle 用户下,任意节点执行
1)创建TAFService

srvctl add service -d testrac -s testrac_taf -r "testrac1,testrac2" -P BASIC

2)启动testrac_taf服务

配置这个服务自启动

srvctl enable service -d testrac -s testrac_taf
srvctl start service -d testrac -s testrac_taf

3)检查service运行情况

srvctl config service -d testrac

[oracle@TESTRAC02 ~]$ srvctl config service -d testrac
Service name: testrac_taf
Service is enabled
Server pool: testrac_testrac_taf
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: true
Failover type: SELECT
Failover method: BASIC
TAF failover retries: 180
TAF failover delay: 5
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition: 
Preferred instances: testrac1,testrac2
Available instances: 

4)配置service参数
Oracle 10G

SQL> 
execute dbms_service.modify_service (service_name => 'server_taf' - 
, aq_ha_notifications => true - 
, failover_method => dbms_service.failover_method_basic - 
, failover_type => dbms_service.failover_type_select - 
, failover_retries => 180 - 
, failover_delay => 5 - 
, clb_goal => dbms_service.clb_goal_long);  

Oracle 11G

srvctl modify service -d testrac -s testrac_taf -e select -m basic -w 5 -z 180 -q true 

5)查看serviceID

SQL> select name,service_id from dba_services;

NAME                                                             SERVICE_ID
---------------------------------------------------------------- ----------
SYS$BACKGROUND                                                            1
SYS$USERS                                                                 2
testrac_taf                                                               3
testracXDB                                                                5
testrac                                                                   6

6)查看修改后的参数

SQL>select name,FAILOVER_METHOD,FAILOVER_TYPE,FAILOVER_RETRIES,GOAL,CLB_GOAL,AQ_HA_NOTIFICATIONS from dba_services where service_id =3;

NAME            METHOD      TYPE        RETRIES GOAL       CLB_GOAL AQNOT

--------------- ----------- ------------------ ---------- -------- -----

testrac_taf      BASIC       SELECT          180 NONE       LONG    YES

7)检查service注册情况:

[grid@TESTRAC02 ~]$ lsnrctl service

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 19-MAR-2015 17:02:04

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "testrac" has 1 instance(s).
  Instance "testrac2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "testracXDB" has 1 instance(s).
  Instance "testrac2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER 
         (ADDRESS=(PROTOCOL=tcp)(HOST=TESTRAC02)(PORT=52210))
Service "testrac_taf" has 1 instance(s).
  Instance "testrac2", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
The command completed successfully

配置完毕。

发表评论