Configuring failover in the Oracle RAC environment

To provide the failover capabilities in an Oracle RAC environment, configure the Oracle connection string in the tnsnames.ora file to use Oracle TAF.

To enable failover, enter multiple virtual listener addresses in the tnsnames.ora file for the RAC database configuration. The first address is used for the initial connection. As shown in the following code segment, when a failure occurs, the connections between the ECDA Option for Oracle and the Oracle database try to reconnect to the subsequent virtual listener address entries until a connection is successful.

RACDB=
 (DESCRIPTION=
  (ADDRESS =(PROTOCOL = TCP)(HOST = host1)(PORT = 1521))
  (ADDRESS =(PROTOCOL = TCP)(HOST = host2)(PORT = 1521))
  (ADDRESS =(PROTOCOL = TCP)(HOST = host3)(PORT = 1521))
  (ADDRESS =(PROTOCOL = TCP)(HOST = host4)(PORT = 1521))
 )

In addition, you must add the FAILOVER_MODE section to the Oracle connection string. This section has two configuration parameters that define the failover characteristics for a connection:

This code segment shows the two recommended FAILOVER_MODE options:

(CONNECT_DATA =
 (SERVER = DEDICATED)
 (SERVICE_NAME = racdb.sybase.com)
 (FAILOVER_MODE =
  (TYPE = SELECT)
  (METHOD = BASIC)
 )
)

This code segment shows an example of the Oracle connection string combining the earlier code segments in the tnsnames.ora file with all of the configuration parameters set to enable failover:

RACDB=
 (DESCRIPTION=
  (ADDRESS =(PROTOCOL = TCP)(HOST = host1)(PORT = 1521))
  (ADDRESS =(PROTOCOL = TCP)(HOST = host2)(PORT = 1521))
  (ADDRESS =(PROTOCOL = TCP)(HOST = host3)(PORT = 1521))
  (ADDRESS =(PROTOCOL = TCP)(HOST = host4)(PORT = 1521))
  (CONNECT_DATA =
   (SERVER = DEDICATED)
   (SERVICE_NAME = racdb.sybase.com)
   (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
   )
  )
 )