时间:2021-07-01 10:21:17 帮助过:6人阅读
服务端不需要配置更改客户端实现taf
方法1.客户端配置 (METHOD = basic)节约资源、浪费时间
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)节约时间、浪费资源
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)
)
)
)
由于客户端要改太过麻烦,现在我们看下怎么不改客户端,直接配置服务端
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服务
[oracle@rac1]srvctl start service -d orcl -s taf
2.1数据库运行时自动运行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);
删除数据字典里的service信息
begin
dbms_service.delete_service(service_name=>‘taf‘);
end;
/
5.确认修改的参数
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的地址
测试。。。。。。。。。。
Oracle 11gR2 RAC Service-Side TAF 配置示例
标签:service ddr day 就是 dmi conf ESS 1.2 sid