|
The following sections discuss setting, viewing, unsetting, and modifying environment variables for native Windows applications and command-line utilities.
Native Windows Informix applications, such as the database server itself, store their configuration information in the Windows registry. To modify this information, you must use the Registry Editor, regedt32.exe.
Add Value in the Registry Editor.
Delete in the Registry Editor.For more information on using the Registry Editor, see your operating-system documentation.
Important: In order to use the Registry Editor to change database server environment variables, you must belong to either the Administrators' or Informix-Admin groups. For information on assigning users to groups, see your operating-system documentation.
Setting Environment Variables for Command-Prompt Utilities
You can set environment variables for command-prompt utilities in the following ways:
The System applet provides a graphical interface to create, modify, and delete system-wide and user-specific variables. Environment variables that are set with the System applet are visible to all command-prompt sessions.
Important: In order to use the System applet to change System environment variables, you must belong to the Administrators' group. For information on assigning users to groups, see your operating-system documentation.
The following diagram shows the syntax for setting an environment variable at a command prompt in Windows NT.
For more information on how to read syntax diagrams, see Command-Line Conventions in the introduction.
To view your current settings after one or more Informix products are installed, enter the following command at a command prompt.
Sometimes you must add information to an environment variable that is already set. For example, the PATH environment variable is always set in Windows NT environments. When you use an Informix product, you must add the name of the directory where the executable files for the Informix products are stored to the PATH.
In the following example, INFORMIXDIR is d:\informix, (that is, during installation, Informix products were installed in the d: \informix directory). The executable files are in the bin subdirectory, d:\informix\bin. To add this directory at the beginning of the PATH environment-variable value, use the following command:
Rather than entering an explicit pathname, you can use the value of the INFORMIXDIR environment variable (represented as %INFORMIXDIR%), as the following example shows:
You might prefer to use this version to ensure that your PATH entry does not contradict the path that was set in INFORMIXDIR and to avoid resetting PATH whenever you change INFORMIXDIR.
For more information about setting and modifying environment variables, refer to your operating-system manuals.
Each time that you open a Windows NT command prompt, it acts as an independent environment. Therefore, environment variables that you set within it are valid only for that particular command-prompt instance. For example, if you open one command prompt and set the variable, INFORMIXDIR, and then open another command prompt and type set to check your environment, you will find that INFORMIXDIR is not set in the new command-prompt session.
The database server installation program creates a batch file that you can use to configure command-prompt utilities, ensuring that your command-prompt environment is initialized correctly each time that you run a command-prompt session. The batch file, dbservername.cmd, is located in %INFORMIXDIR%, and is a plain text file that you can modify with any text editor. If you have more than one database server installed in %INFORMIXDIR%, there will be more than one batch file with the .cmd extension, each bearing the name of the database server with which it is associated.
To run dbservername.cmd from a command prompt, type dbservername or configure a command prompt so that it runs dbservername.cmd automatically at start up.
When an Informix product accesses an environment variable, normally the following rules of precedence apply:
Important: Because Windows NT services access only environment variables that are set in the registry, the preceding rules of precedence do not apply for Informix native Windows applications. For native Windows applications, the highest precedence goes to variables that are explicitly defined in the registry, and the lowest precedence goes to the default value. In addition, if you set one or more environment variables before you start the database server, and you do not explicitly set the same environment variables for your client products, the clients will adopt the original settings.