To provide the failover capabilities in an Oracle RAC environment, you must configure the Oracle connection string in the ECDA Option for Oracle tnsnames.ora file to use Oracle TAF.
To enable failover, you 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 will try to reconnect to the subsequent virtual listener address entries (shown in bold typeface) 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. It has two configuration parameters that define the failover characteristics for a connection:
TYPE, which has two options:
SELECT keeps track of any select statements issued in the current transaction and replays them after the failover connection is reestablished. (Sybase recommends this option.)
SESSION only establishes a new connection to the backup instance, and all work is lost.
METHOD, which also has two options:
BASIC establishes a new connection to the backup instance only when the primary connection fails. (Sybase recommends this option.)
PRECONNECT establishes a connection to the backup instance when the primary connection is made, reducing failover time. However, for every connection, two connections are created, so more resources are used.
This code segment shows the two recommended FAILOVER_MODE options in bold typeface:
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb.sybase.com)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
) )
This code segment shows the example Oracle connection string combined in the tnsnames.ora file with all of the configuration parameters (in bold typeface) 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)
)
)
)