In Oracle RAC, in addition to the TFA Method Based on the client, there is also the TFA Method Based on the server. You can regard the TFA method of the server as an upgraded version of the TFA method of the client. The TFA on the server must be configured on the server. This is done through the Service. This article mainly describes how to configure the TFA of the server through service in Oracle 10g rac.
The following are some reference links for this purpose:
For the load balancing configuration, see
Non-Default port listening configuration in oracle rac (listener. ora tnsnames. ora)
Load Balance)
Oracle RAC server connection Load Balance)
Oracle RAC load balancing test (combined with server and client)
1. server and client Environments
# Server environment and host information
Oracle @ bo2dbp: ~> Cat/etc/hosts | grep vip
192.168.7.61 bo2dbp-vip.2gotrade.com bo2dbp-vip
192.168.7.62 bo2dbs-vip.2gotrade.com bo2dbs-vip
# Server environment and cluster information
Oracle @ bo2dbp: ~> ./Crs_stat.sh
Resource name Target State
-------------------------
Ora. GOBO4.GOBO4A. inst ONLINE on bo2dbp
Ora. GOBO4.GOBO4B. inst ONLINE on bo2dbs
Ora. GOBO4.db ONLINE on bo2dbp
Ora. bo2dbp. ASM1.asm ONLINE on bo2dbp
Ora. bo2dbp. LISTENER_BO2DBP.lsnr ONLINE on bo2dbp
Ora. bo2dbp. LISTENER_ORA10G_BO2DBP.lsnr ONLINE on bo2dbp
Ora. bo2dbp. gsd ONLINE on bo2dbp
Ora. bo2dbp. ons ONLINE on bo2dbp
Ora. bo2dbp. vip ONLINE on bo2dbp
Ora. bo2dbs. ASM2.asm ONLINE on bo2dbs
Ora. bo2dbs. LISTENER_BO2DBS.lsnr ONLINE on bo2dbs
Ora. bo2dbs. LISTENER_ORA10G_BO2DBS.lsnr ONLINE on bo2dbs
Ora. bo2dbs. gsd ONLINE on bo2dbs
Ora. bo2dbs. ons ONLINE on bo2dbs
Ora. bo2dbs. vip ONLINE on bo2dbs
Ora. ora10g. db ONLINE on bo2dbp
# Client environment
Robin @ SZDB: ~> Cat/etc/issue
Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64)-Kernel \ r (\ l ).
Robin @ SZDB: ~> Sqlplus-v
SQL * Plus: Release 10.2.0.3.0-Production
# Client tnsnames Configuration
GOBO4 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.61) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.62) (PORT = 1521 ))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TFA) # Pay Attention to the SERVICE_NAME of our client and set it to TFA.
)
)
2. Configure the service on the server
There are multiple methods to configure the service, such as dbca, oem, and srvctl command lines. The following is a command line configuration.
For more information about what is a service and how to use the srvctl command line to create a service, see: http://blog.csdn.net/robinson_0612/article/details/8124232
Oracle @ bo2dbp: ~> Srvctl add service-d GOBO4-s TFA-r GOBO4A-a GOBO4B-P basic
Oracle @ bo2dbp: ~> Srvctl start service-d GOBO4-s TFA
Oracle @ bo2dbp: ~> ./Crs_stat.sh | grep TFA
Ora. GOBO4.TFA. GOBO4A. srv ONLINE on bo2dbp
Ora. GOBO4.TFA. cs ONLINE on bo2dbp
Oracle @ bo2dbp: ~> Srvctl config service-d GOBO4-
Tfa pref: GOBO4A AVAIL: GOBO4B TAF: basic
Oracle @ bo2dbp: ~> Export ORACLE_SID = GOBO4A
Oracle @ bo2dbp: ~> Sqlplus/as sysdba
SQL * Plus: Release 10.2.0.3.0-Production on Mon Dec 17 14:55:02 2012
Copyright (c) 1982,200 6, Oracle. All Rights Reserved.
Connected:
Oracle Database 10g Release 10.2.0.3.0-64bit Production
With the Real Application Clusters option
SQL> show parameter service
NAME TYPE VALUE
-----------------------------------------------------------------------------
Service_names string SYS $ SYS. KUPC $ s_20172012102317304
4. GOBO4, SYS $ SYS. KUPC $ c_00002012
1023173044. GOBO4, GOBO4, TFA
SQL> begin
2 dbms_service.modify_service (
3 service_name => 'tfa ',
4 failover_method => dbms_service.failover_method_basic,
5 failover_type => dbms_service.failover_type_select,
6 failover_retries => 180,
7 failover_delay => 5 );
8 end;
9/
PL/SQL procedure successfully completed.
SQL> select name, failover_method, failover_type, goal, clb_goal from dba_services
2 where name = 'tfa ';
NAME FAILOVER_METHOD FAILOVER_TYPE GOAL CLB_G
------------------------------------------------------------------------
TFA BASIC SELECT LONG
SQL> ho lsnrctl status
..........
Service "TFA" has 1 instance (s ).
Instance "GOBO4A", status READY, has 2 handler (s) for this service...
The command completed successfully