Managing Sqlhosts with Setnet

On UNIX systems, ensuring that the correct entries are placed in the sqlhosts file is strictly a manual job. Informix has simplified this greatly with the inclusion of the setnet utility on NT systems. Actually, setnet originally saw light as part of Informix-Net for OnLine 5.X clients running on Windows 3.1. In the time since then, Informix-Net went from being a 16-bit application to being a 32-bit application called Informix-Connect. Setnet became setnet32.

It is possible to run both the 16-bit and the 32-bit connectivity packages on the same machine if this is needed. Install the 16-bit I-Net first. Go into %INFORMIXDIR%in and rename setnet.exe to setnet16.exe. Rename ilogin.exe to ilogin16.exe. Then go ahead and install the 32-bit Informix-Connect product in the same directory tree. The 16-bit connectivity should be used with 16-bit clients, and the 32-bit connectivity should be used with 32-bit clients. Trying to run a 16-bit connectivity package with a 32-bit application package will not succeed.

When you run setnet32, you get the following screen:



You will see four tabbed pages:

  • Environment: Holds the environmental variables for the instance. This is a definite improvement over having to set the variables in startup scripts ala UNIX.

  • Server Information: This tabbed page is where the information that UNIX machines keeps in the sqlhosts file goes on Windows systems.

  • Host Information: Includes the hostname, the user to log in as, whether or not to ask explicitly for a password, and an encrypted version of the password.

  • About Setnet32: Just a standard "about" page. There's a help button at the bottom of the form.

Let's look at the salient pages, one by one.

Environment

In the example on the previous page you will see that the list of environment variables has been scrolled down about two-thirds of the way, down to the area that most often gets used. These three variables are usually filled in automatically, but if their values are wrong, the communications will fail:

   INFORMIXDIR                =  c:informix
   INFORMIXSERVER             = inf_bignbad
   INFORMIXSQLHOSTS           = \ntws033

For those of you who are not familiar with the "\ntws033" nomenclature, this is the way that NT identifies names of servers on the network. If you have troubles with this variable, try using the fully qualified name, like this:

   INFORMIXSQLHOSTS         = \ntws033.mydomain.com

To change a variable on this screen, highlight it in the left-hand panel. The name appears in the lower-left panel, just above the drop-down list box. To change the value, type the new value in the list box and hit the "Set" button. The information is not actually committed to the registry until you hit either the "OK" or the "Apply" button at the bottom. Unless you use the set button followed by either "OK" or "Apply," the value will not be committed to the registry.

This list of environmental variables is taken directly from the help system of setnet32 for IDS 7.3 on NT:

   CC8BITLEVEL      Specifies how the C-language compiler processes
   non-ASCII (8-bit and multibyte) characters. ESQL/C
   only

   CLIENT_LOCALE   Specifies the locales that the ESQL/C application
   uses to perform read/write operations that involve
   the keyboard, display, file, or printer on the client com-
   puter. Any valid locale specifier.

   COLLCHAR  Specifies that existing ESQL/C applications take
   advantage of the NLS collation feature without requiring a
   change in their code. You must also set DBNLS to 1 or 2.
   Provided for backward compatibility with NLS products.
   CONRETRY  Specifies the maximum number of additional connection
   attempts made to a database server in the time limit
   that CONTIME specifies. Same as   INFORMIXCONRETRY.

   CONTIME   Specifies the number of seconds an SQL CONNECT
   statement continues to try establishing a connection before
   it generates an error. Same as INFORMIXCONTIME.

   DB_LOCALE Specifies the locale of all the databases that an
   ESQL/C application accesses in a single connection (the database
   locale). Any valid locale name.

   DBALSBC   When set to 1, enables compatibility with ALS
   products. 0 or 1.

   DBANSIWARN      When turned on (y), causes the ESQL/C pre-processor
   to check for Informix extensions to ANSI-standard
   SQL syntax at compile time, and causes an ESQL/C application
   to check for Informix extensions at runtime.

   DBAPICODE allows pre-7.2 systems that use nonstandard or
   rare code sets to access databases that store data in a
   standard code set. Maximum size = 23 characters. Provided
   for backward compatibility with NLS and ALS product. Usage
   and values depend on language system.

   DBASCIIBC When set to 1, enables compatibility with Ascii
   Cop. Products. 0 or 1

   DBCENTURY Specifies how to expand values of two-digit-year
   DATE and DATETIME values.

   P = past century,
   R = present century,
   C = closest century.
   F = future century

   DBCODESET Specifies an Asian-locale code set. Overrides the
   code set that DB_LOCALE specifies. Provided for backward
   compatibility with Version 4.x and 5.x ALS products. Same
   value as ALS DBAPICODE. (8859-1) unless the informix.rc file
   specifies another system-wide default.
   DBCONNECT Specifies whether or not connections are
   restricted. 1 or 3.

   DBCSCONV  Controls code-set conversion initialization. Maximum
   size is 8 characters. Provided for backward compatibility
   with ALS products. 1 or 2:<codesetname>.

   DBCSOVERRIDE    Forces the user-specified DB_LOCALE to override
   default restrictions on accessing databases with locales
   different from DB_LOCALE. Provided for backward
   compatibility with Version 6.0 ALS database servers. 0
   or 1.

   DBCSWIDTH       Maximum number of display bytes (1-2) and
   storage bytes (1-4) for the characters in up to three code sets.
   Display and storage widths are separated by commas.
   Code sets are separated by colons. Maximum size of this
   field is, therefore, 11 characters. Provided for backward
   compatibility with ALS products. Example:1,1:2,3 means a
   display and storage width of 1 byte for character set 1; a
   display width of 2 bytes and a storage width of 3 bytes for
   code set 2.

   DBDATE    Specifies the end-user format for DATE values so
   that they can conform with various international date conventions.
   Provided for backward compatibility with pre-7.2
   products. Informix recommends GL_DATE for new applications.
   MDY4 unless NLS variable LC_TIME is activated).

   DBFLTMSK  Specifies the number of decimal digits to use when
   storing a DECIMAL, SMALLFLOAT, or FLOAT data type in a character
   buffer. 0-16

   DBLANG    Specifies the subdirectory of the %INFORMIXDIR% directory
   that contains the product -specific'message (.iem)
   files. (%INFORMIXDIR%msg)

   DBMONEY Specifies the end-user format for MONEY values so
   that they can conform with various international and local
   monetary conventions. ($.,)
   DBMONEYSCALE    Specifies the total number of digits and
   number of of decimal digits for monetary values. Provided
   for backward compatibility with NLS products.

   DBNLS     Specifies whether an ESQL/C application can access
   NLS features. Provided for backward compatibility with NLS
   products.

   DBPATH    Identifies the database severs (online) or directories
   that contain databases that the ESQL/C application
   accesses.

   DBSS2     Maximum size is 4 characters. Provided for backward
   compatibility with ALS products. 0x00-0xff or 0-255

   DBSS3     Maximum size 4 characters. Provided for backward
   compatiblity with ALS products. 0x00-0ff or 0-255

   DBTEMP    Specifies the directory on the client computer
   that the ESQL/C processor uses to store temporary files
   (also called swap files).(	mp)

   DBTIME    Specifies the end-user format for DATETIME values
   so that the user can conform with various international date
   conventions. Provided for backward compatibility with pre-
   7.2 products. Informix recommends GL_DATETIME for new ESQL/C
   applications. (%Y-%m-%d%H:%M:%S)

   DELIMIDENT      Indicates whether (y) or not (n) to interpret
   strings in double quotes as delimited identifiers.

   ESQLMF    Indicates whether the ESQL/C processor automatically
   invokes the ESQL/C multibyte filter (value=l and
   CC8BITLEVEL<3, or not value=0). ESQL/C only.

   FET_BUF_SIZE    Allows you to override the default size of
   the fetch buffer. Any valid buffer size, in bytes.
   (Default value depends on row size.)

   GL_DATE   Specifies a customized end-user format for DATE
   values.
   GL_DATETIME     Specifies a customized end-user format for
   DATETIME values.

   INFORMIXDIR     Identifies the location of the ESQL/C processor
   as well as the location of library files, message files,
   header files, and other executables.

   INFORMIXSERVER  Identifies the default database server.

   INFORMIXSQLHOSTS      Specifies the name of the computer on
   which the central registry resides.

   LANG      Specifies the language environment (called a locale)
   for an NLS database that the ESQL/C application accesses.
   Provided for backward compatibility with Informix
   NLS products.

   LC_COLLATE      Specifies a collation or sort sequence for
   data in NCHAR and NVARCHAR columns of an NLS database. Provided
   for backward compatibility

   LC_CTYPE  Specifies character attributes such as character
   classification and case conversion of regular expressions
   for data in NCHAR and NVARCHAR columns of an NLS database.
   Provided for backward compatibility.

   LC_MONETARY     Specifies the end-user format for MONEY values
   in an NLS database. Provided for backward compatibility.

   LC_NUMERIC     Specifies the end-user format for numeric values
   in an NLS database. Provided for backward compatibility
   with NLS products.

   LC_TIME   Specifies the end-user format for DATE and
   DATETIME values in an NLS database. Provided for backward
   compatibility with NLS products.

For more information about these environment variables, their syntax, and acceptable values, see Chapter 4 of the Informix Guide to SQL: Reference. Remember that the NT products store all of these values in the registry, not as conventional environment variables. Keeping the environmental variables along with the connection information simplifies the task of administering multiple client/server systems.

Another feature of setnet that simplifies these administrative duties is the ability to save these settings to a file and to retrieve them from a file. To save the connectivity portions of the Informix registry to a file, hit the "Save to File" button.

Setnet files have the default suffix of ".nfx." These files are simple ASCII files that contain the relevant connectivity and environmental variables. You can move these files from system to system These files do not contain any information about the available protocols on each individual system. The available protocols that populate the "protocols" list box in the Server Information page are placed there by the Informix setup program.



The save and load programs perform a complete replacement of the registry data. There is currently no provision for merging the output files rather than totally replacing them. This could probably be done fairly easily by hand, but it is really easier to designate one machine as the master SQLHOSTS machine. You can then make all of your changes on that machine, and either point all the other clients to that machine for SQLHOSTS or create an ".nfx" file from that machine and export the file to other clients for loading.

Server Information

The server information screen is where the "traditional" sqlhosts data is stored, that is, the same information that is included in the Informix sqlhosts file on UNIX. Both the Informix Server and HostName listboxes are populated from already-defined systems in your registry. The Protocol name information is placed there by the Informix install.

Beginning with IDS 7.30, there is a fifth edit box entitled "Options," in which special options to the server are included. Click on the "Make Default Server" to designate the cur-rently-chosen server as the default server. In conjunction with setting the INFORMIX-SERVER variable, this will allow easier access to your most commonly used server.

As an aside, several of the third-party tools that communicate with Informix systems prefer to talk only to the default server. This is the case with the 5.X versions of PowerBuilder. To talk to any other servers in this environment, you also have to write code to change the default server registry entry. This is supposedly fixed in PowerBuilder 6.0, but if you have an application that can't seem to connect to your Informix database, try making that database the default. It can't hurt.



Host Information

The Host Information screen allows the user to include information about logins and passwords for the host. If you are adding a server into setnet and if you do not have a previous host information entry for it, you will need to enter the host information here.



The Password Option box allows three options:

  • Ask password at runtime

  • Password

  • No Password

  • Using the "Ask password at runtime" can sometimes be of help when testing connectivity. Sometimes it is difficult to determine exactly which server you're talking to, and if your servers have different passwords, sometimes this will help you be certain you're talking to the right machine

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.246.203