Adding a hafailover line to the sql.ini file

Clients with the failover property automatically reconnect to the secondary companion when the primary companion crashes or when you issue shutdown or shutdown with nowait, triggering failover. To give a client the failover property, you must add a line labeled “hafailover” to the sql.ini file to provide the information necessary for the client to connect to the secondary companion. You can add this line using either a file editor or the dsedit utility.

The following is a sql.ini entry for a symmetric configuration between the “MONEY1” and “PERSONNEL1” companions:

[MONEY1]
 master=TCP,FN1,9835
 query=TCP,FN1,9835
 hafailover=PERSONNEL1

[PERSONNEL1]
 master=TCP,HUM1,7586
 query=TCP,HUM1,7586
 hafailover=MONEY1

For more information about adding this information to the sql.ini file, see “Configure sql.ini”.

NoteClient applications must resend any queries that were interrupted by failover. Other information specific to the connection, such as cursor declarations, also need to be restored.