Enabling Cluster Edition connection failover

Using the ODBC user interface

One way to enable the Cluster Edition connection failover in ODBC is through the ODBC user interface.

StepsUsing the user interface to enable extended failover

  1. Open the Adaptive Server Enterprise dialog box.

  2. Go to the Connection tab.

  3. Select Enable High Availability.

  4. Optionally, enter the alternate servers and ports in the Alternate Servers field using the format:

    server1:port1,server2:port2,...,serverN:portN;
    

In establishing a connection, ODBC Driver by Sybase will first try to connect to the primary host and port defined in the General tab of the Adaptive Server Enterprise dialog box. If ODBC fails to establish a connection, ODBC will go through the list of hosts and ports specified in the Alternate Servers field.

Using the ODBC connection string

Another way to enable the connection failover in ODBC is to set the HASession connection string property to 1. You can use SQLDriverConnect to specify a connection string. For example:

Driver=AdaptiveServerEnterprise;server=server1;
port=port1;UID=sa;PWD=;HASession=1;
AlternateServers=server2:port2,...,serverN:portN;

The preceding example defines server1 and port1 as the primary server and port. If ODBC fails to establish connection to the primary server, and alternate servers are defined, it will go through the ordered list of servers and ports specified in the Alternate Servers field until a connection is established or until the end of the list is reached.

NoteThe list of alternate servers specified in the GUI or the connection string is used only during initial connection. After the connection is established with any available instance, and the client supports high-availability, the client will receive an updated list of the best possible failover targets from the server. This new list overrides the specified list.