Oracle 11g RAC TAF 服務端配置實現failover

來源:互聯網
上載者:User

Oracle 11g 引入了scan ip 。但是在沒有DNS的情況下,用戶端串連RAC好多還是使用oracle 10g的辦法。就是在用戶端的tnsname.ora中配置failover。
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(LOAD_BALANCE = yes)
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.203)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.204)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.205)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
(FAILOVER = on)
(TYPE = select)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)

)
)
這樣可以實現用戶端的failover,那麼能不能在伺服器端實現failover,用戶端只配置scan ip呢。今天做了個測試,測試結果OK.說下配置過程:

How To Configure Server Side TransparentApplication Failover [ID 460982.1]
1.建立TAFService
[oracle@db1 bin]$ ./srvctl add service -d orcl -s server_taf -r "orcl1,orcl2" -P BASIC
--這裡的orcl是database name,orcl1和orcl2 是instance name。
2. 啟動server_taf服務
[oracle@db1 bin]$ ./srvctl start service -d orcl -s server_taf
3. 檢查service運行情況
[oracle@db1 bin]$ ./srvctl config service -d orcl
Service name: server_taf
Service is enabled
Server pool: orcl_server_taf
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: orcl1,orcl2
Available instances:
4.確認serviceID
SQL> select name,service_id from dba_services where name = 'server_taf';
NAME SERVICE_ID
--------------------------------------------------------------------------
server_taf 3
5.給service添加參數:
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);
6. 確認參數修改:
col name format a15
col failover_method format a11 heading 'METHOD'
col failover_type format a10 heading 'TYPE'
col failover_retries format 9999999 heading 'RETRIES'
col goal format a10
col clb_goal format a8
col AQ_HA_NOTIFICATIONS format a5 heading 'AQNOT'
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
--------------- ----------- ------------------ ---------- -------- -----
server_taf BASIC SELECT 180 NONE LONG YES
SQL>
7. 檢查service註冊情況:
[oracle@db1 bin]$ lsnrctl services
LSNRCTL for Linux: Version 11.2.0.3.0 -Production on 15-JUL-2012 13:26:43
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db1)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for thisservice...
Handler(s):
"DEDICATED" established:57 refused:0 state:ready
LOCAL SERVER
Service "orcl" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for thisservice...
Handler(s):
"DEDICATED" established:11 refused:0 state:ready
LOCAL SERVER
Service "orclXDB" has 1instance(s).
Instance "orcl1", status READY, has 1 handler(s) for thisservice...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER
(ADDRESS=(PROTOCOL=tcp)(HOST=db1.tianlesoftware.com)(PORT=38731))
Service "server_taf" has 1instance(s).
Instance "orcl1", status READY, has 1 handler(s) for thisservice...
Handler(s):
"DEDICATED" established:11 refused:0 state:ready
LOCAL SERVER
The command completed successfully

推薦閱讀:

RedHat Linux 5 & CentOS 5下Oracle 10g安裝詳解

CentOS 6.3(x32)下安裝Oracle 10g R2

Linux-6-64下安裝Oracle 12C筆記

  • 1
  • 2
  • 下一頁

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.