oracle中怎么配置及测试TAF
短信预约 -IT技能 免费直播动态提醒
这篇文章主要介绍“oracle中怎么配置及测试TAF”,在日常操作中,相信很多人在oracle中怎么配置及测试TAF问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”oracle中怎么配置及测试TAF”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
一、添加services_taf:
[root@ora19crac1 ~]# su - oracle
Last login: Tue Mar 3 18:06:26 CST 2020 on pts/1
[oracle@ora19crac1 ~]$ srvctl add service -d woo -s server_taf -r "woo1,woo2" -P BASIC
二、启动server_taf
[oracle@ora19crac1 ~]$ srvctl start service -d woo -s server_taf
三、检查server_taf 运行状态
[oracle@ora19crac1 ~]$ srvctl config service -d woo
Service name: server_taf
Server pool:
Cardinality: 2
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Global: false
Commit Outcome: false
Failover type:
Failover method:
Failover retries:
Failover delay:
Failover restore: NONE
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Pluggable database name:
Hub service:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Drain timeout:
Stop option:
Session State Consistency: DYNAMIC
GSM Flags: 0
Service is enabled
Preferred instances: woo1,woo2
Available instances:
CSS critical: no
Service uses Java: false
四、检查刚才创建的服务
SQL> select name,service_id from dba_services where name ='server_taf';
NAME SERVICE_ID
--------------- ----------
server_taf 3
五、检查服务配置
SQL> col name format a15
SQL> col failover_method format a11 heading 'METHOD'
SQL> col failover_type format a10 heading 'TYPE'
SQL> col failover_retries format 9999999 heading 'RETRIES'
SQL> col goal format a10
SQL> col clb_goal format a8
SQL> col AQ_HA_NOTIFICATIONS format a5 heading 'AQNOT'
SQL> select name, failover_method, failover_type, failover_retries,goal, clb_goal,aq_ha_notifications
2 from dba_services where service_id = 3;
NAME METHOD TYPE RETRIES GOAL CLB_GOAL AQNOT
--------------- ----------- ---------- -------- ---------- -------- -----
server_taf 0 NONE LONG NO
六、修改故障转移参数策略
[oracle@ora19crac1 ~]$ srvctl modify service -d woo -s server_taf -m BASIC -e SELECT -q TRUE -j LONG
[oracle@ora19crac1 ~]$ srvctl config service -d woo
Service name: server_taf
Server pool:
Cardinality: 2
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: true
Global: false
Commit Outcome: false
Failover type: SELECT
Failover method: BASIC
Failover retries:
Failover delay:
Failover restore: NONE
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Pluggable database name:
Hub service:
Maximum lag time: ANY
SQL Translation Profile:
Retention: 86400 seconds
Replay Initiation Time: 300 seconds
Drain timeout:
Stop option:
Session State Consistency: DYNAMIC
GSM Flags: 0
Service is enabled
Preferred instances: woo1,woo2
Available instances:
CSS critical: no
Service uses Java: false
七、再次检查服务,我们可以看到值都有了
SQL> col name format a15
SQL> col failover_method format a11 heading 'METHOD'
SQL> col failover_type format a10 heading 'TYPE'
SQL> col failover_retries format 9999999 heading 'RETRIES'
SQL> col goal format a10
SQL> col clb_goal format a8
SQL> col AQ_HA_NOTIFICATIONS format a5 heading 'AQNOT'
SQL> select name, failover_method, failover_type, failover_retries,goal, clb_goal,aq_ha_notifications
2 from dba_services where service_id = 3;
NAME METHOD TYPE RETRIES GOAL CLB_GOAL AQNOT
--------------- ----------- ---------- -------- ---------- -------- -----
server_taf BASIC SELECT 0 NONE LONG YES
八、检查服务是否有注册到监听
[oracle@ora19crac1 ~]$ lsnrctl services
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 19-MAR-2020 16:58:22
Copyright (c) 1991, 2019, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
……
Service "server_taf" has 1 instance(s).
Instance "woo1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "woo" has 1 instance(s).
Instance "woo1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
……
The command completed successfully
十、测试
SQL> col host_name format a11;
SQL> select instance_name,host_name from v$instance;
INSTANCE_NAME HOST_NAME
---------------- -----------
woo2 ora19crac2
十一、新开一个窗口关闭这个实例
SQL> shut abort
ORACLE instance shut down.
十二、查询可以正常进行,但是会有短暂的锁住现象
SQL> col host_name format a11;
SQL> select instance_name,host_name from v$instance;
INSTANCE_NAME HOST_NAME
---------------- -----------
woo2 ora19crac2
到此,关于“oracle中怎么配置及测试TAF”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341