11gr2 RAC配置Service-Side TAF

renjixinchina發表於2014-02-26

10g可以用dbca 來配置TAF 11.2以後只能透過命令和EM方式來實現,命令方式試驗結果如下:

1 建立TAF服務

srvctl add service -d orcl -s orcl_taf -r "orcl1,orcl2" -P BASIC

2 啟動TAF服務

srvctl start service -d orcl -s orcl_taf

 

3 修改service 引數

execute dbms_service.modify_service (service_name => 'orcl_taf', aq_ha_notifications => true, failover_method => dbms_service.failover_method_basic, failover_type => dbms_service.failover_type_select, failover_retries => 181,failover_delay => 5,clb_goal => dbms_service.clb_goal_long);

 

4 查詢是否設定成功

SQL> select name, failover_method, failover_type, failover_retries,goal, clb_goal,aq_ha_notifications  from dba_services where service_id =4;

 

NAME

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

FAILOVER_METHOD

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

FAILOVER_TYPE

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

FAILOVER_RETRIES GOAL         CLB_G AQ_

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

orcl_taf

BASIC

SELECT

             180 NONE         LONG  YES

 

5 檢查服務註冊情況

[grid@node1 ~]$ lsnrctl services

 

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 26-FEB-2014 09:21:34

 

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

 

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM1", status READY, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:0 refused:0 state:ready

         LOCAL SERVER

Service "orcl" has 1 instance(s).

  Instance "orcl1", status READY, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:0 refused:0 state:ready

         LOCAL SERVER

Service "orcl_taf" has 1 instance(s).

  Instance "orcl1", status READY, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:0 refused:0 state:ready

         LOCAL SERVER

The command completed successfully

6 配置一個tnsnames

ORCL_TAF =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = scanip)(PORT = 1521))

    (CONNECT_DATA =

      (SERVICE_NAME = orcl_taf)

    )

  )

 

 

7 測試

SQL> select host_name,instance_name from v$instance;

 

HOST_NAME

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

INSTANCE_NAME

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

node1

orcl1

SQL> /

 

HOST_NAME

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

INSTANCE_NAME

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

node2

orcl2

 

關閉該節點

srvctl stop instance -d orcl -i orcl1 -o immediate

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-1092913/,如需轉載,請註明出處,否則將追究法律責任。

相關文章