Disclaimer

Wednesday, 21 July 2021

TAF configuration and testing - 19c RAC

19c TAF configuration and testing

 

1. Add services_taf:

root@rac01 ~]# su - oracle
Last login: Tue Mar  3 18:06:26 CST 2020 on pts/1
[oracle@rac01 ~]$ srvctl add service -d orcl -s server_taf -r "orcl1,orcl2" -P BASIC
 

2. Start server_taf :-


[oracle@rac01 ~]$ srvctl start service -d orcl -s server_taf

 


3. Check the running status of server_taf

[oracle@rac01 ~]$ srvctl config service -d orcl

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: orcl1,orcl2
Available instances: 
CSS critical: no
Service uses Java: false

 

4. Check the service just created


SQL> select name,service_id from dba_services where name ='server_taf';

 NAME            SERVICE_ID
--------------- ----------
server_taf               3

 


5. Check the service configuration

 

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 from dba_services where service_id = 3;

 

NAME            METHOD      TYPE        RETRIES GOAL       CLB_GOAL AQNOT

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

server_taf                                    0 NONE       LONG     NO

 


 


6. Modify the failover parameter strategy

 


[oracle@rac01 ~]$ srvctl modify service -d orcl -s server_taf -m BASIC -e SELECT -q TRUE -j LONG


[oracle@rac01 ~]$ srvctl config service -d orcl

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: orcl1,orcl2
Available instances: 
CSS critical: no
Service uses Java: false

 

7. Check the service again, we can see that the values ​​are all there

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

 


8. Check whether the service is registered to monitor


[oracle@rac01 ~]$ 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 "orcl1", 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
         ……
The command completed successfully

 


9. Test the service 

SQL> col host_name format a11;

SQL> select instance_name,host_name from v$instance;

 

INSTANCE_NAME    HOST_NAME

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

orcl2             rac02

 


10. Open a new window to close this instance

SQL> shut abort

ORACLE instance shut down.

 

11. The query can be performed normally, but there will be a temporary lock-up phenomenon

 

SQL> col host_name format a11;

SQL> select instance_name,host_name from v$instance;

 

INSTANCE_NAME    HOST_NAME

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

orcl2             rac02









 

No comments:

Post a Comment

Understanding SQL Plan Baselines in Oracle Database

  Understanding SQL Plan Baselines in Oracle Database SQL Plan Baseline is the feature in Oracle started from Database 11g that helps to pre...