The sqlhosts file and the SQLHOSTS registry key

HCL® OneDB® client/server connectivity information, the sqlhosts information, contains information that enables a client application to find and connect to any HCL OneDB database server on the network.

The sqlhosts file (UNIX™)

On UNIX, the sqlhosts file is located, by default, in the $INFORMIXDIR/etc directory.

If you store the information in another location, you must set the INFORMIXSQLHOSTS environment variable.

If you set up several database servers to use distributed queries, use one of the following ways to store the sqlhosts information for all the databases:
  • In one sqlhosts file, pointed to by the INFORMIXSQLHOSTS environment variable
  • In separate sqlhosts files in each database server directory

Each entry in the sqlhosts file contains the sqlhosts information for a database server or a database server group. Additional syntax rules for each of the fields are provided in the following sections, which describe the entries in the sqlhosts file. Use any standard text editor to enter information in the sqlhosts file.

The SQLHOSTS registry key (Windows™)

When you install the database server, the setup program creates a key in the Windows registry:
  • For an HCL OneDB 64-bit product installed on a Windows 64-bit system or an HCL OneDB 32-bit product installed on a Windows 32-bit system, the sqlhosts information is in this key:
    HKEY_LOCAL_MACHINE\SOFTWARE\INFORMIX\SQLHOSTS
  • For an HCL OneDB 32-bit product installed on a Windows 64-bit system, the sqlhosts information is in this key:
    HKEY_CLASSES_ROOT\VirtualStore\MACHINE\SOFTWARE\Wow6432Node\Informix\SQLHOSTS
Note: If you have 32-bit and 64-bit HCL OneDB software (client or server) operating together on Windows on the same machine, you must have duplicate entries in both registry hives.

This branch of the HKEY_LOCAL_MACHINE subtree stores the SQLHOSTS information. Each key on the SQLHOSTS branch is the name of a database server. When you click the database server name, the registry displays the values of the HOST, OPTIONS, PROTOCOL, and SERVICE fields for that particular database server.

Each computer that hosts a database server or a client must include the connectivity information either in the SQLHOSTS registry key or in a central registry. When the client application runs on the same computer as the database server, they share a single SQLHOSTS registry key.

When you install the database server, the installation program asks where you want to store the SQLHOSTS registry key. You can specify one of the following two options:
  • The local computer where you are installing the database server
  • Another computer in the network that serves as a central, shared repository of SQLHOSTS information for multiple database servers in the network

Using a shared SQLHOSTS registry key relieves you of the necessity to maintain the same sqlhosts information about multiple computers. However, the hosts and services files on each computer must contain information about all computers that have database servers.

The following tools can be used to manage the SQLHOSTS information:
  • regedt32
  • Setnet32
Although you can use Setnet32 to set up database servers, you cannot use it to set up database server groups.

The default location of the sqlhosts file is:

UNIX:
$INFORMIXDIR/etc/sqlhosts
Windows:
%INFORMIXDIR%\etc\sqlhosts.%INFORMIXSERVER%

If you store the information in another location, you must set the INFORMIXSQLHOSTS environment variable.

If you set up several database servers to use distributed queries, use one of the following ways to store the sqlhosts information for all the databases:
  • In one sqlhosts file, pointed to by the INFORMIXSQLHOSTS environment variable
  • In separate sqlhosts files in each database server directory