SQLHOSTS Connection Manager configuration parameter

The SQLHOSTS parameter specifies where a Connection Manager can search for database servers that are specified by the INFORMIXSERVER parameter and DBSERVERS attribute.

Read syntax diagramSkip visual syntax diagram
Syntax

                .-LOCAL+REMOTE-.   
|--SQLHOSTS--=--+-LOCAL--------+--------------------------------|
                '-REMOTE-------'   

Table 1. Values for the SQLHOSTS Connection Manager configuration parameter
SQLHOSTS parameter value Description
LOCAL The Connection Manager searches the local sqlhosts file for requested database server instances.
REMOTE The Connection Manager searches for requested database server instances in remote sqlhosts files. The Connection Manager searches the sqlhosts files of database servers that are specified by a connection-unit's INFORMIXSERVER parameter.
LOCAL+REMOTE (default) The Connection Manager searches the local sqlhosts file for requested database server instances. If a database server cannot be found, the Connection Manager searches the sqlhosts files of database servers that are specified by a connection-unit's INFORMIXSERVER parameter.

Usage

The SQLHOSTS parameter is optional, and applies to the following connection units:
  • CLUSTER
  • GRID
  • REPLSET
  • SERVERSET

The SQLHOSTS option is useful when you want to restrict client applications from accessing one or more database servers in a high-availability cluster.

Example

In the following example, the SQLHOSTS parameter is used to limit the servers that the Connection Manager connects to.
NAME my_connection_manager
SQLHOSTS LOCAL

CLUSTER my_cluster
{
   INFORMIXSERVERS my_servers
   SLA my_sla DBSERVERS=server_1,server_2,server_3,server_4
   FOC ORDER=ENABLED PRIORITY=1
}
The local sqlhosts file has the following entries:
#dbservername       nettype    hostname   servicename   options
 my_servers         group      -          -             c=1,e=server_3
 server_1           onsoctcp   host_1     port_1        g=my_servers
 server_2           onsoctcp   host_2     port_2        g=my_servers
 server_3           onsoctcp   host_3     port_3        g=my_servers
Remote database-server sqlhosts files have the following entries:
#dbservername       nettype    hostname   servicename   options
 my_servers         group      -          -             c=1,e=server_4
 server_1           onsoctcp   host_1     port_1        g=my_servers
 server_2           onsoctcp   host_2     port_2        g=my_servers
 server_3           onsoctcp   host_3     port_3        g=my_servers
 server_4           onsoctcp   host_3     port_3        g=my_servers
server_4 is not defined in the local sqlhosts file, and the Connection Manager is configured to not search remote sqlhosts files, so the Connection Manager does not send connection requests to server_4.

Copyright© 2019 HCL Technologies Limited