Group information

You define server groups in the sqlhosts file or SQLHOSTS registry key. When you create a server group, you can treat multiple related database server or Connection Manager SLA entries as a single entity for client connections to simplify connection redirection to database servers or Connection Managers. You must create group entries for database servers that participate in Enterprise Replication.

You can use the name of a group instead of the database server name in the following environment variables, or in the SQL CONNECT command:
  • The value of the ONEDB_SERVER environment variable for a client application can be the name of a group. However, you cannot use a group name as the value of the ONEDB_SERVER environment variable for a database server or database server utility.
  • The value of the DBPATH environment variable can contain the names of groups.

Use a dash (-) character (ASCII 45) for hostname and server/port values when you specify a connection information for a group.

High-availability cluster groups

A high-availability cluster groups sqlhosts have the following format:
#dbservername   nettype   hostname     servicename        options
 group_name     group     -            -                  c=1,e=member_name_n
 member_name_1  protocol  host_name_1  service_or_port_1  g=group_name
 member_name_2  protocol  host_name_2  service_or_port_2  g=group_name
 member_name_n  protocol  host_name_n  service_or_port_n  g=group_name

C=1 is optional, and specifies that a random starting point in the list of group members is used for connection attempts. e=member_name is optional, and specifies the final entry for group members, so that the entire file is not scanned. The g=group_name option is required for group members, and specifies the group that the member belongs to.

Enterprise Replication server groups

All database servers that participate in replication must be a member of a database server group. Each database server in the enterprise must have a unique identifier. Enterprise Replication node groups have the following sqlhosts format:
#dbservername   nettype   hostname     servicename        options
 group_name_1   group     -            -                  i=identifier_1,e=member_name_1
 member_name_1  protocol  host_name_1  service_or_port_1  g=group_name_1

 group_name_2   -         -                               i=identifier_2,e=member_name_2
 member_name_2  protocol  host_name_2  service_or_port_2  g=group_name_2

 group_name_n   -         -                               i=identifier_n,e=member_name_n
 member_name_n  protocol  host_name_n  service_or_port_n  g=group_name_n

The i=identifier is required for Enterprise Replication. e=member_name is optional, and specifies the final entry for group members, so that the entire file is not scanned. The g=group_name option is required for group members, and specifies the group that the member belongs to.

Connection Manager service-level agreement groups

Connection Manager SLA groups have the following sqlhosts format:
#dbservername         nettype   hostname   servicename             options
SLA_1_group_name      group     -          -                       c=1,e=SLA_name_1_from_CM_n
SLA_name_1_from_CM_1  protocol  CM_1_host  CM_1_port_or_service_1  g=SLA_1_group_name
SLA_name_1_from_CM_2  protocol  CM_2_host  CM_2_port_or_service_1  g=SLA_1_group_name
SLA_name_1_from_CM_n  protocol  CM_n_host  CM_n_port_or_service_1  g=SLA_1_group_name

SLA_2_group_name      group     -          -                       c=1,e=SLA_name_2_from_CM_n
SLA_name_2_from_CM_1  protocol  CM_1_host  CM_1_port_or_service_2  g=SLA_2_group_name
SLA_name_2_from_CM_2  protocol  CM_2_host  CM_2_port_or_service_2  g=SLA_2_group_name
SLA_name_2_from_CM_n  protocol  CM_n_host  CM_n_port_or_service_2  g=SLA_2_group_name

SLA_n_group_name      group     -          -                       c=1,e=SLA_name_n_from_CM_n
SLA_name_n_from_CM_1  protocol  CM_1_host  CM_1_port_or_service_n  g=SLA_n_group_name
SLA_name_n_from_CM_2  protocol  CM_2_host  CM_2_port_or_service_n  g=SLA_n_group_name
SLA_name_n_from_CM_n  protocol  CM_n_host  CM_n_port_or_service_n  g=SLA_n_group_name

C=1 is optional, and specifies that a random starting point in the list of group members is used for connection attempts. e=member_name is optional, and specifies the final entry for group members, so that the entire file is not scanned. The g=group_name option is required for group members, and specifies the group that the member belongs to.