Informix client/server connectivity information, the sqlhosts information, contains information that enables a client application to find and connect to any Informix database server on the network.
For a detailed description of the sqlhosts information, see The sqlhosts Information.
On UNIX, the sqlhosts file resides, by default, in the $INFORMIXDIR/etc directory. As an alternative, you can set the INFORMIXSQLHOSTS environment variable to the full pathname and filename of a file that contains the sqlhosts file information. Each computer that hosts a database server or a client must have an sqlhosts file.
Each entry (each line) in the sqlhosts file contains the sqlhosts information for one database server. Use white space (spaces, tabs, or both) to separate the fields. Do not include any spaces or tabs within a field. To put comments in the sqlhosts file, start a line with the comment character (#). You can also leave lines completely blank for readability. 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.
Table 6 shows a sample sqlhosts file.
dbservername | nettype | hostname | servicename | options |
---|---|---|---|---|
menlo | onipcshm | valley | menlo | |
newyork | ontlitcp | hill | dynsrvr2 | s=2,b=5120 |
sales | ontlispx | knight | sales | k=0,r=0 |
payroll | onsoctcp | dewar | py1 | |
asia | group | – | – | e=asia.3 |
asia.1 | ontlitcp | node6 | svc8 | g=asia |
asia.2 | onsoctcp | node0 | svc1 | g=asia |
To manage the SQLHOSTS information, use one of the following tools:
When you install the database server, the setup program creates the following key in the Windows registry:
HKEY_LOCAL_MACHINE\SOFTWARE\INFORMIX\SQLHOSTS
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:
Using a shared SQLHOSTS registry key relieves you of the necessity to maintain the same sqlhosts information on multiple computers. However, the hosts and services files on each computer must contain information about all computers that have database servers.
If you specify a shared sqlhosts registry key, you must set the INFORMIXSQLHOSTS environment variable on your local computer to the name of the Windows computer that stores the registry. The database server first looks for the sqlhosts registry key on the INFORMIXSQLHOSTS computer. If the database server does not find an sqlhosts registry key on the INFORMIXSQLHOSTS computer, or if INFORMIXSQLHOSTS is not set, the database server looks for an sqlhosts registry key on the local computer.
You must comply with Windows network-access conventions and file permissions to ensure that the local computer has access to the shared sqlhosts registry key. For information about network-access conventions and file permissions, see your Windows documentation.
Figure 4 illustrates the location and contents of the SQLHOSTS registry key for the database server payroll.