Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Configure Server Side TAF

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Experimental environment: Oracle 11.2.0.4 RAC

Refer to the MOS documentation:

How To Configure Server Side Transparent Application Failover (document ID 460982.1)

1. Create a new service on the RAC cluster to set up TAF

two。 Start the server_taf service

3. Check to confirm that the service is running

4. Find the service_id of the service you just created

5. Review service information based on service_id

6. Add server side failover parameters to the service

7. Review the service again to see the Method, Type and reads values

8. Check the monitoring information for registered services

9. Create a network service name

10. Test TAF function

1. Create a new service on the RAC cluster to set up TAF

Eg: srvctl add service-d rac-s server_taf-r "rac1,rac2"-P BASIC

Create a new service server_taf on the RAC cluster using the oracle user:

[oracle@jyrac1] $srvctl add service-d jyzhao-s server_taf-r "jyzhao1,jyzhao2"-P BASIC [oracle@jyrac1 ~] $

Note that you cannot use grid user actions. If you use a grid user, an error will be reported:

[grid@jyrac1] $srvctl add service-d jyzhao-s server_taf-r "jyzhao1,jyzhao2"-P BASICPRCD-1288: User is not authorized to create service server_taf for database jyzhaoPRKH-1014: Current user "grid" is not the oracle owner user "oracle" of oracle home "/ opt/app/oracle/product/11.2.0/dbhome_1" 2. Start the server_taf service

Eg: srvctl start service-d rac-s server_taf

Start the server_taf service

[oracle@jyrac1] $srvctl start service-d jyzhao-s server_taf3. Check to confirm that the service is running

Eg: srvctl config service-d rac

Check to confirm that the service is running:

[oracle@jyrac1] $srvctl config service-d jyzhaoService name: server_tafService is enabledServer pool: jyzhao_server_tafCardinality: 2Disconnect: falseService role: PRIMARYManagement policy: AUTOMATICDTP transaction: falseAQ HA notifications: falseFailover type: NONEFailover method: NONETAF failover retries: 0TAF failover delay: 0Connection Load Balancing Goal: LONGRuntime Load Balancing Goal: NONETAF policy specification: BASICEdition: Preferred instances: jyzhao1,jyzhao2Available instances:4. Find the service_id of the service you just created

Eg: select name,service_id from dba_services where name = 'server_taf'

Find the service_id of the service you just created

SQL > select name,service_id from dba_services where name = 'server_taf' NAME SERVICE_ID-----server_taf seventy-five。 Review service information based on service_id

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 service_id = 7

Based on the information of the service_id review service:

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 = 7 3 NAME METHOD TYPE RETRIES GOAL CLB_GOAL AQNOT- server_taf NONE NONE 0 NONE LONG NOSQL > 6. Add server side failover parameters to the service

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)

Version 11.2 can use srvctl to modify the information of the service:

Srvctl modify service-d RAC-s server_taf-m BASIC-e SELECT-Q TRUE-j LONG

Add server side failover parameters to the 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); PL/SQL procedure successfully completed.7. Review the service again to see the Method, Type and reads values

Select name, failover_method, failover_type, failover_retries,goal, clb_goal,aq_ha_notifications

From dba_services where service_id = 7

If you review the service again, you can see the Method, Type, and reads values:

SQL > select name, failover_method, failover_type, failover_retries,goal, clb_goal,aq_ha_notifications 2 from dba_services where service_id = 7 NAME METHOD TYPE RETRIES GOAL CLB_GOAL AQNOT- server_taf BASIC SELECT 180 NONE LONG YES8. Check the monitoring information for registered services

Lsnrctl services

Service "server_taf.za.oracle.com" has 2 instance (s).

Instance "rac1", status READY, has 2 handler (s) for this service...

Handler (s):

"DEDICATED" established:0 refused:0 state:ready

REMOTE SERVER

(ADDRESS= (PROTOCOL=TCP) (HOST=dell01) (PORT=1521))

"DEDICATED" established:0 refused:0 state:ready

LOCAL SERVER

Instance "rac2", status READY, has 1 handler (s) for this service...

Handler (s):

"DEDICATED" established:0 refused:0 state:ready

REMOTE SERVER

(ADDRESS= (PROTOCOL=TCP) (HOST=dell02) (PORT=1521))

The version here is different, and the display is different. I display my own instances on different nodes:

Node1:Service "server_taf" has 1 instance (s). Instance "jyzhao1", status READY, has 1 handler (s) for this service... Handler (s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVERThe command completed successfully--node2:Service "server_taf" has 1 instance (s). Instance "jyzhao2", status READY, has 1 handler (s) for this service... Handler (s): "DEDICATED" established:0 refused:0 state:ready LOCAL SERVERThe command completed successfully9. Create a network service name

SERVERTAF =

(DESCRIPTION =

(LOAD_BALANCE = yes)

(ADDRESS = (PROTOCOL = TCP) (HOST = dell01) (PORT = 1521))

(ADDRESS = (PROTOCOL = TCP) (HOST = dell02) (PORT = 1521))

(CONNECT_DATA =

(SERVICE_NAME = server_taf.za.oracle.com)

)

)

Server RAC all nodes configure tnsnames.ora, add content:

SERVERTAF = (DESCRIPTION = (LOAD_BALANCE = yes) (ADDRESS = (PROTOCOL = TCP) (HOST = jyrac1) (PORT = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST = jyrac2) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = server_taf)

Sqlplus system/oracle@192.168.56.160/server_taf

10. Test TAF function

Select host_name,instance_name from v$instance

SQL > select instance_name from V$instance

INSTANCE_NAME

-

Rac2

SQL > shutdown abort

ORACLE instance shut down.

Select host_name,instance_name from v$instance

10.1Simulator client uses scanVIP to test whether TAF can be implemented.

Sqlplus system/oracle@192.168.56.160/server_taf

[grid@jyrac1] $sqlplus system/oracle@192.168.56.160/server_tafSQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 10 02:59:53 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL > select host_name,instance_name from v$instance HOST_NAME----INSTANCE_NAME-jyrac1jyzhao1-- forcefully shuts down the jyzhao1 instance here. SQL > / HOST_NAME----INSTANCE_NAME-jyrac2jyzhao2

Conclusion: the TAF function can be realized, which means that the client no longer needs to be configured and connects directly through SCAN VIP.

10.2Simulator client uses Public IP to test whether TAF can be implemented.

Sqlplus system/oracle@192.168.56.150/server_taf

SQL > select host_name,instance_name from vastly instantly holding jyzhao1 instance. Here, the jyzhao1 instance is forcibly shut down. SQL > / select host_name,instance_name from v$instance*ERROR at line 1:ORA-12153: TNS:not connectedProcess ID: 20116Session ID: 24 Serial number: 7

If the client configures tnsnames.ora, configure publicIP

TAF = (DESCRIPTION = (LOAD_BALANCE = yes) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.150) (PORT = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.152) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = server_taf))

Test again:

[oracle@jyrac2 admin] $sqlplus system/oracle@tafSQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 10 05:11:30 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL > select host_name,instance_name from v$instance HOST_NAME----INSTANCE_NAME-jyrac2jyzhao2-- forcefully shuts down the jyzhao2 instance here. SQL > / HOST_NAME----INSTANCE_NAME-jyrac1jyzhao1

Conclusion: direct connection to Public IP can not realize the function of TAF. But the client can configure Public IP list, which can be realized.

10.3Simulator client uses VIP to test whether TAF can be implemented.

Sqlplus system/oracle@192.168.56.151/server_taf

[grid@jyrac1] $sqlplus system/oracle@192.168.56.151/server_tafSQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 10 04:32:20 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL > select host_name,instance_name from v$instance HOST_NAME----INSTANCE_NAME-jyrac1jyzhao1SQL > / select host_name,instance_name from v$instance*ERROR at line 1:ORA-03113: end-of-file on communication channelProcess ID: 32459Session ID: 159Serial number: 3

If the client is configured with tnsnames.ora, you can connect through sqlplus system/oracle@tafvip.

TAFVIP = (DESCRIPTION = (LOAD_BALANCE = yes) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.151) (PORT = 1521)) (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.153) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = server_taf))

Test again:

[oracle@jyrac2 admin] $sqlplus system/oracle@tafvipSQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 10 05:15:32 2017Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL > select host_name,instance_name from v$instance HOST_NAME----INSTANCE_NAME-jyrac2jyzhao2-- forcefully shuts down the jyzhao2 instance here. SQL > / HOST_NAME----INSTANCE_NAME-jyrac1jyzhao1

Conclusion: direct connection to VIP can not realize the function of TAF. But the client can configure VIP list, which can be realized.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report