Failover query in RAC

oracleoracle-11goracle-11g-r2oracle-12crac

Say I have the following tnsnames.ora in my two node RAC database,

DIVTEST = 
(DESCRIPTION = 
(ADDRESS = (PROTOCOL = TCP)(HOST = DIVTEST-scan.DIVCORP.com)(PORT = 1721)) 
(CONNECT_DATA = 
(SERVER = DEDICATED) 
(SERVICE_NAME = DIVTEST) 
) 
) 

And I create a service as following:

Service_name – DIVTEST 
Failover_type - Basic 
Failover_method - session 
Failover_retries – 180 
Failover_delay - 5

and the service in running in both the nodes.

For server side TAF, Should I edit my tnsnames.ora (above mentioned) on my database server as given below?

DIVTEST = 
(DESCRIPTION = 
(ADDRESS = (PROTOCOL = TCP)(HOST = DIVTEST-scan.DIVCORP.com)(PORT = 1721)) 
(CONNECT_DATA = 
(SERVER = DEDICATED) 
(SERVICE_NAME = DIVTEST) 
(FAILOVER_MODE= 
(TYPE=session) 
(METHOD=basic))))

OR just have the service running in both the nodes will ensure runtime TAF?

  1. Should the service-name mentioned in TNS and the service which I create for TAF using srvctl be the same so that client need not make any changes in tns at their end?

Best Answer

11gR2(11.2) RAC TAF Configuration for Admin and Policy Managed Databases (Doc ID 1312749.1)

  1. Create Service

As you have already written.

  1. Start the service

No TNS entry needed on the server.

  1. Make a connection.

The client connect string does not require any special TAF parameters. A simple tnsnames.ora entry as shown below will do.

mysrvb = 
  (description =
   (address = (protocol=tcp)(host=secrac-scan)(port=1521))
   (connect_data=
    (service_name=mysrvb)
   ) 
  )

Of course, use the service that was defined with TAF.