The next section describes the connectivity information that is in each field of the sqlhosts file or SQLHOSTS registry key.
The database server name field (dbservername) gives the name of the database server for which the connectivity information is being specified. Each database server across all of your associated networks must have a unique database server name. The dbservername field must match the name of a database server in the network, as specified by the DBSERVERNAME and DBSERVERALIASES configuration parameters in the ONCONFIG configuration file. For more information about these configuration parameters, see ONCONFIG Parameters for Connectivity.
The dbservername field can include any printable character other than an uppercase character, a field delimiter, a new line character, or a comment character. This field is limited to 128 bytes.
If the sqlhosts file has multiple entries with the same dbservername, only the first one is used.
The connection-type field (nettype on UNIX or PROTOCOL on Windows) describes the type of connection that should be made between the database server and the client application or another database server. The field is a series of eight letters composed of three subfields, as Figure 5 shows.
The following sections describe the subfields of the connection-type field.
The first two letters of the connection-type field represent the database server product.
For information about DRDA, see the IBM Informix Enterprise Gateway with DRDA User Manual.
The middle three letters of the connection-type field represent the network programming interface that enables communications. For more information, see Network Programming Interface.
Interprocess communications (IPC) are used only for communications between two processes running on the same computer.
The final three letters of the connection-type field represent the network protocol or specific IPC mechanism.
IPC connections use shared memory or stream pipes. The database server supports two network protocols: TCP/IP and IPX/SPX.
Table 7 summarizes the possible connection-type values for database server connections. For more information on MaxConnect protocols, see Using IBM Informix MaxConnect.
For information on the connection types for your platform, see Connections That the Database Server Supports.
The host name field (hostname on UNIX or host on Windows) contains the name of the computer where the database server resides. The name field can include any printable character other than a field delimiter, a new line character, or a comment character. The host name field is limited to 256 bytes.
The following sections explain how client applications derive the values used in the host name field.
When you use the TCP/IP network protocol, the host name field is a key to the hosts file, which provides the network address of the computer. The name that you use in the host name field must correspond to the name in the hosts file. In most cases, the host name in the hosts file is the same as the name of the computer. For information about the hosts file, see TCP/IP Connectivity Files.
In some situations, you might want to use the actual Internet IP address in the host name field. For information about using the IP address, see IP Addresses for TCP/IP Connections.
When you use shared memory or stream pipes for client/server communications, the hostname field must contain the actual host name of the computer on which the database server resides.
When you use the IPX/SPX network protocol, the hostname field must contain the name of the NetWare file server. The name of the NetWare file server is usually the UNIX hostname of the computer. However, this is not always the case. You might need to ask the NetWare administrator for the correct NetWare file server names.
The interpretation of the service name field (servicename or service) depends on the type of connection that the connection-type field (nettype or PROTOCOL) specifies. The service name field can include any printable character other than a field delimiter, a new line character, or a comment character. The service name field is limited to 128 bytes.
When you use the TCP/IP connection protocol, the service name field must correspond to a service name entry in the services file. The port number in the services file tells the network software how to find the database server on the specified host. It does not matter what service name you choose, as long as you agree on a name with the network administrator.
Figure 6 shows the relationship between the sqlhosts file or registry and the hosts file, as well as the relationship of sqlhosts to the services file.
In some cases, you might use the actual TCP listen-port number in the service name field. For information about using the port number, see Port Numbers for TCP/IP Connections.
When the PROTOCOL field specifies a named-pipe connection (onipcnmp), the SERVICE entry can be any short group of letters that is unique in the environment of the host computer where the database server resides.
When the nettype field specifies a shared-memory connection (onipcshm) or a stream-pipe connection (onipcstr), the database server uses the value in the servicename entry internally to create a file that supports the connection. For both onipcshm and onipcstr connections, the servicename can be any short group of letters that is unique in the environment of the host computer where the database server resides.
Recommendation: Use the dbservername as the servicename for stream-pipe connections.
A service on an IPX/SPX network is simply a program that is prepared to do work for you, such as the database server. For an IPX/SPX connection, the value in the servicename field can be an arbitrary string, but it must be unique among the names of services available on the IPX/SPX network. It is convenient to use the dbservername in the servicename field.
The options field includes entries for the following features.
Option Name | Option Letter | Reference |
---|---|---|
Buffer size | b | page Buffer-Size Option |
Connection redirection | c | page Connection-Redirection Option |
End of group | e | page End-of-Group Option |
Group | g | page Group Option |
Identifier | i | page Identifier Option |
Keep-alive | k | page Keep-Alive Option |
Security | s (database server)
r (client) |
page Security Options |
Communication support module | csm | Using Communication Support Modules (CSMs) for Password and Data Transmission Encryption |
When you change the values in the options field, those changes affect the next connection that a client application makes. You do not need to stop and restart the client application to allow the changes to take effect. However, a database server reads its own connectivity information only during initialization or database-server restart. If you change the options for the database server, you must restart the database server to allow the changes to take effect.
Each item in the options field has the following format:
letter=value
You can combine several items in the options field, and you can include them in any order. The maximum length of the options field is 256 bytes.
You can use either a comma or white space as the separator between options. You cannot use white space within an option.
The database server evaluates the options field as a series of columns. A comma or white space in the options field represents an end of a column. Client and database server applications check each column to determine whether the option is supported. If an option is not supported, you are not notified. It is merely ignored.
The following examples show both valid and invalid syntax.
Syntax | Valid | Comments |
---|---|---|
k=0,s=3,b=5120 | Yes | Syntax is correct. |
s=3,k=0 b=5120 | Yes | Syntax is equivalent to the preceding entry. (White space is used of instead of a comma.) |
k=s=0 | No | You cannot combine entries. |
Use the buffer-size option (b=value) to specify in bytes the size of the communications buffer space. The buffer-size option applies only to connections that use the TCP/IP network protocol. Other types of connections ignore the buffer-size setting. You can use this option when the default size is not efficient for a particular application. The default buffer size for the database server using TCP/IP is 4096 bytes.
Adjusting the buffer size allows you to use system and network resources more efficiently; however, if the buffer size is set too high, the user receives a connection-reject error because no memory can be allocated. For example, if you set b=64000 on a system that has 1000 users, the system might require 64 megabytes of memory for the communications buffers. This setting might exhaust the memory resources of the computer.
On many operating systems, the maximum buffer size supported for TCP/IP is 16 kilobytes. To determine the maximum allowable buffer size, see the documentation for your operating system or contact the technical-support services for the vendor of your platform.
If your network includes several different types of computers, be particularly careful when you change the size of the communications buffer.
You can define a group of database servers, or aliases in the sqlhosts file on the client and have the client connections to the dbserver group try each of the group members with fail-over. The connection-redirection option (c=value) indicates the order in which the connection software chooses database servers, aliases, or coservers within a group.
Use the connection-redirection option in the following situations:
The following table shows the possible settings for the connection-redirection option.
Use the Communication Support Module (CSM) option to describe the CSM for each database server that uses a CSM. If you do not specify the CSM option, the database server uses the default authentication policy for that database server. You can specify the same CSM option setting for every database server described in the sqlhosts file or registry, or you can specify a different CSM option or no CSM options for each sqlhosts entry.
The format of the CSM option is illustrated in the following example:
csm=(csmname,csm-connection-options)
The value of csmname must match a csmname entry in the concsm.cfg file. The connection-options parameter overrides the default csm-connection options specified in the concsm.cfg file.
The following example specifies that the ENCCSM communication support module will be used for the connection:
csm=(ENCCSM)
For information on Communication Support Modules, see Using Communication Support Modules (CSMs) for Password and Data Transmission Encryption. For information on the concsm.cfg file entry, see CSM Configuration File.
Use the end-of-group option (e=dbservername) to specify the ending database server name of a database server group. If you specify this option in an entry other than a database server group, the option is ignored.
If no end-of-group option is specified for a group, the group members are assumed to be contiguous. The end of group is determined when an entry is reached that does not belong to the group, or at the end of file, whichever comes first. For an example of the end-of-group option, see Table 8.
When you define database server groups in the sqlhosts file or registry, you can use multiple related entries as one logical entity to establish or change client/server connections.
The database server group name can be the same as the initial DBSERVERNAME for the database server.
The options for a database server group entry are as follows:
Use the i and g options in Enterprise Replication. All database servers participating in replication must be a member of a database server group. Each database server in the enterprise must have a unique identifier, which is the server group. Make sure that the sqlhosts file is set up properly on each database server participating in replication.
For more information, see preparing the replication environment in the IBM Informix Dynamic Server Enterprise Replication Guide.
Use the c, e, and g options in High-Availability Data Replication (HDR). HDR requires two identical systems. For more information, see Directing Clients with the Connectivity Information.
The example in Table 8 shows the following two groups: asia and peru. Group asia includes the following members:
Because group asia uses the end-of-group option (e=asia.3), the database server searches for group members until it reaches asia.3, so the group includes usa.2. Because group peru does not use the end-of-group option, the database server continues to include all members until it reaches the end of file.
Table 8 shows examples of database server groups in the sqlhosts file.
You can use the name of a database server group instead of the database server name in the following environment variables, or in the SQL CONNECT command:
The value of INFORMIXSERVER for a client application can be the name of a database server group. However, you cannot use a database server group name as the value of INFORMIXSERVER for a database server or database server utility.
DBPATH can contain the names of database server groups as dbservernames.
The identifier option (i=number) assigns an identifying number to a database server group. The identifier must be a positive numeric integer and must be unique within your network environment.
For more information on the use of the identifier option, see the IBM Informix Dynamic Server Enterprise Replication Guide.
The keep-alive option is a network option that TCP/IP uses. It does not affect other types of connections. If you do not include the keep-alive option in the options field, the keep-alive feature is enabled by default. To set the keep-alive option on the database server side only, the client side only, or on both sides, specify k=1 in the fifth column of the sqlhosts file. For most cases, you should enable the keep-alive option.
The letter k identifies keep-alive entries in the options field, as follows:
k=0 Disable the keep-alive feature k=1 Enable the keep-alive feature
When a connected client and server are not exchanging data and the keep-alive option is enabled, the network service checks the connection periodically. If the receiving end of the connection does not respond within the time specified by the parameters of your operating system, the network service immediately detects the broken connection and frees resources.
When the keep-alive option is disabled, the network service does not check periodically whether the connection is still active. If the opposite end of the connection terminates unexpectedly without any notification, as when a PC reboots, for example, the network service might never detect that the connection is broken.
The security options let you control operating-system security-file lookups. The letter s identifies database server-side settings, and the letter r identifies client-side settings. You can set both options in the options field. A client ignores s settings, and the database server ignores r settings.
The following table shows the possible security option settings.
The security options let you control the way that a client (user) gains access to a database server. By default, an Informix database server uses the following information on the client computer to determine whether the client host computer is trusted:
With the security options, you can specifically enable or disable the use of either or both files.
For example, if you want to prevent end users from specifying trusted hosts in rhosts, you can set s=1 in the options field of the sqlhosts file or SQLHOSTS registry key for the database server to disable the rhosts lookup.