您好,登錄后才能下訂單哦!
Service-Side TAF
Service-Side TAF的配置參考:
How To Configure Server Side Transparent Application Failover [ID 460982.1]
Service-SideTAF 可以看作是TAF的一種變種,首先Service-SideTAF也是TAF,所有TAF的特點(diǎn)它都有,其次這種TAF是在服務(wù)器上配置的,而不像TAF是在客戶端配置的。
Client-Side TAF 是在客戶端修改tnsnames.ora 文件來配置的,如果有很多客戶端使用這個數(shù)據(jù)庫,那么每次微笑調(diào)整都需要把所有的計算機(jī)更改一遍,既低效又容易出錯。而Service-Side TAF 通過結(jié)合Service,在數(shù)據(jù)庫里保存FAIL_MODE的配置,把所有的TAF配置保存在數(shù)據(jù)字典中,從而省去了客戶端的配置工作,現(xiàn)在客戶端的TNS文件就不需要任何TAF的配置選項(xiàng)了。
從配置參數(shù)而言,Service-Side TAF和TAF 相比多了一個Instance Role(實(shí)例角色)的概念。 所謂的實(shí)例角色,就是當(dāng)有多個Instance 參與一個Service時,可以配置優(yōu)先使用哪一個Instance為用戶提供服務(wù)。用戶共有兩種可選角色。
PREFERRED:首選實(shí)例,會優(yōu)先選擇擁有這個角色的實(shí)例提供服務(wù)。
AVAILABLE: 后備實(shí)例,用戶連接會優(yōu)先連接PREFFERRED的Instance,當(dāng)PREFERRED的Instance不可用時,才會被轉(zhuǎn)到AVAILBALE的Instance上。
要使用Server-Side TAF必須配置Service。 Service 可以在創(chuàng)建數(shù)據(jù)庫時創(chuàng)建,也可以在創(chuàng)建數(shù)據(jù)庫之后修改,既可以使用dbca 配置向?qū)В部梢杂妹钚械姆绞脚渲谩?/p>
服務(wù)端不需要配置更改客戶端實(shí)現(xiàn)taf
方法1.客戶端配置 (METHOD = basic)節(jié)約資源、浪費(fèi)時間
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.171.4)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.171.5)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = session)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)
)
)
)
方法2.客戶端配置 (METHOD = preconnect)節(jié)約時間、浪費(fèi)資源
orcl1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.171.4)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = preconnect)
(BACKUP = orcl2)
)
)
)
orcl2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.171.5)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = preconnect)
(BACKUP = orcl1)
)
)
)
由于客戶端要改太過麻煩,現(xiàn)在我們看下怎么不改客戶端,直接配置服務(wù)端
1.用srvctl 命令配置Service
[oracle@rac1]$srvctl add service -d orcl -s taf -r "orcl1,orcl2" -P BASIC
--這里的orcl是database name,orcl1和orcl2 是instance name。
刪除service
#srvctl remove service -d orcl -s taf
2.啟動taf服務(wù)
[oracle@rac1]srvctl start service -d orcl -s taf
2.1數(shù)據(jù)庫運(yùn)行時自動運(yùn)行service
srvctl enable service -d orcl -s taf
SQL> execute dbms_service.modify_service (service_name => '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);
刪除數(shù)據(jù)字典里的service信息
begin
dbms_service.delete_service(service_name=>'taf');
end;
/
5.確認(rèn)修改的參數(shù)
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'
select name, failover_method,failover_type, failover_retries,goal,
clb_goal,aq_ha_notifications from dba_services where name = 'taf';
6.檢查service注冊情況:
[oracle@rac1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 13-DEC-2018 14:18:37
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 13-DEC-2018 09:09:32
Uptime 0 days 5 hr. 9 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/rac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.171.2)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.171.4)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "taf" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
The command completed successfully
7.客戶端就可以使用Service-SideTAF了:
在客戶端TNS 配置:
orcl =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST= 172.16.171.6)(PORT=1521))
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=taf )
)
)
--172.16.171.6是scan ip的地址
測試。。。。。。。。。。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。