The -FILE option

On UNIX, you can use the -FILE option to run certain IBM® Informix® utilities with the local environment variables that you set in your onconfig file. You do not have to set local environment variables before you run the command to start the utilities.

You can use the -FILE option when you start the following utilities: oninit, oncheck, onclean, onload, onunload, onlog, onmode, onparams, onspaces, onstat, and ontape.

Syntax

-FILE option
Read syntax diagramSkip visual syntax diagram -FILE= file_name
Table 1. -FILE option
Element Purpose Key Considerations
-FILE=file_name Specifies the full path or relative path to the onconfig file that contains the environment information. The -FILE=file_name option must be the first argument in the command.

Usage

Before you run a command with the -FILE option, you must add directives to your onconfig file in the following format:

#$variable_name value

Any environment variables that are set in the onconfig file take precedence over the same environment variables that are set in the system or shell.

When you start a utility with the -FILE option, specify the full path or the relative path to the onconfig file. For example, both of the following examples start the database server with the environment information in the onconfig.serv1 file:

Full path
oninit -FILE=/opt/IBM/inf/etc/onconfig.serv1
Relative path
oninit -FILE=etc/onconfig.serv1

If the INFORMIXDIR environment variable is not set in the user system, the shell, or in the onconfig file, the value of INFORMIXDIR is set to the PATH of the executable program, with the assumption that the executable program is in a subdirectory of INFORMIXDIR. For example, you can run the oninit -FILE=etc/onconfig.myserv command when the oninit utility is in the /opt/IBM/informix/bin directory. If the INFORMIXDIR environment variable is not set in the shell or in the onconfig.myserv file, the value of INFORMIXDIR is set to /opt/IBM/informix.

If you use a form of remote execution, such as ssh, use the -FILE option to specify the path to the onconfig file on the remote computer.

Example

Suppose that you specified values for the INFORMIXSERVER, DBDATE, and SERVER_LOCALE environment variables in the onconfig file for the js_3 instance:

             #onconfig.js_3
             #
             # *** Start environment settings for js_3
             #
             #$INFORMIXSERVER server3
             #$DBDATE MDY4/
             #$SERVER_LOCALE en_us.utf8
             #
             # *** End environment settings for js_3 

The other important environment variables (INFORMIXDIR, INFORMIXSQLHOSTS, ONCONFIG) for running the utility are specified in the user environment. The path to the oninit executable program is part of the user environment and the onconfig file is in the current directory.

You can run the oninit -FILE=onconfig.js_3 command from the current directory to start the database server, and automatically set the values for the INFORMIXSERVER, DBDATE, and SERVER_LOCALE environment variables.