Configuring Connection Failover

Connection failover allows an application to connect to an alternate, or backup, database server if the primary database server is unavailable, for example, because of a hardware failure or traffic overload. Connection failover ensures that the data on which your critical ODBC applications depend is always available. See "Using Connection Failover" for more information.

To configure connection failover, you must specify a list of alternate database servers that are tried at connection time if the primary server is not accepting connections. To do this, use the Alternate Servers (AlternateServers) connection option. Connection attempts continue until a connection is successfully established or until all the database servers in the list have been tried once (the default).

Optionally, you can specify the following additional connection failover features:

On Windows, you can configure a data source to use connection failover on the Failover tab of the driver's Setup dialog box. See "Configuring Data Sources" for details.

On UNIX and Linux, you can configure a data source to use connection failover by modifying your system information file (odbc.ini). See "Configuring the Product on UNIX/Linux" for details.

On Windows, UNIX, and Linux, you can use a connection string to direct the driver to use connection failover. See "Connecting to a Data Source Using a Connection String" for details.

A Connection String Example

The following connection string configures the Oracle Wire Protocol driver to use connection failover in conjunction with all of its optional features-load balancing, connection retry, and connection retry delay.

DSN=AcctOracleServer; 
AlternateServers=(HostName=AccountingOracleServer: 
PortNumber=1521:SID=Accounting, 
HostName=255.201.11.24:PortNumber=1522: 
ServiceName=ABackup.NA.MyCompany); 
LoadBalancing=1;ConnectionRetryCount=4; 
ConnectionRetryDelay=5 

Specifically, this connection string configures the driver to use two alternate servers as connection failover servers, to attempt to connect four additional times if the initial attempt fails, to wait five seconds between attempts, and to try the primary and alternate servers in a random order. The additional connection information required for the alternate servers is specified in the data source AcctOracleServer.

An odbc.ini File Example

To configure the Oracle Wire Protocol driver to use connection failover in conjunction with some of its optional features in your odbc.ini file, you could set the following connection string attributes:

Driver=ODBCHOME/lib/ivora23.so 
Description=DataDirect 5.3 Oracle Wire Protocol driver 
... 
AlternateServers=(HostName=AccountingOracleServer: 
PortNumber=1521:SID=Accounting, 
HostName=255.201.11.24:PortNumber=1522: 
ServiceName=ABackup.NA.MyCompany) 
... 
ConnectionRetryCount=4 
ConnectionRetryDelay=5 
... 
LoadBalancing=0 
... 

Specifically, this odbc.ini configuration tells the driver to use two alternate servers as connection failover servers, to attempt to connect four additional times if the initial attempt fails, to wait five seconds between attempts, and to try the primary and alternate servers in sequential order (do not use load balancing).