Where to Set Environment Variables - Firebird

Environment variables are global system settings that take effect when the operating system is booted. On Windows, Linux, and most UNIX systems, the Firebird server will recognize and use certain environment variables if they are configured. The fbserver process (Superserver architecture) or the fb_inet_server process (Classic server architecture) will not recognize settings that point to networked resources (disks and filesystems) not physically controlled by the server machine.

Where to Set Environment Variables


The type of environment variable to set and the method of setting it varies from one version of Windows to another. Table shows which types to set (if applicable), and where and how to set them.

Setting Environment Variables on Windows

Setting Environment Variables on Windows

Setting Environment Variables on Windows


On Linux and UNIX, the easiest way to define environment variables is to add their definitions to the systemwide default shell profile.

The root user can also choose to either

  • Issue setenv() commands from a shell or shell script.
  • For temporary use, set and export a variable from a shell (e.g., export ISC_USER=SYSDBA)


The effect of this dangerous pair of environment variables is to give SYSDBA access to the Firebird server and its databases, via the command-line tools or other client applications, to anyone who can log into the host machine. They are a convenience for developers.

If you do not provide a user name and password when you connect locally to a database or when you run the command -line utilities such as gbak, gstat, and gfix, Firebird looks to see if the ISC_USER and ISC_PASSWORD environment variables are set; if they are, Firebird lets you log in without entering a password. Never allow these variables to remain configured on a server that has production databases running unless your server room is physically very secure!


The FIREBIRD environment variable (INTERBASE in version 1.0.x), if configured, is used during both installation and runtime, on all platforms, to locate the root directory of the Firebird server installation. If present, it overrides all other settings—installation kit defaults, Windows Registry settings, firebird.conf configuration, operating system global paths defaults, etc.

During installation, it points to the root directory where Firebird is (to be) installed. The value must point to a fully qualified path that exists within the host machine’s own physical filesystem. At startup, the server reads non -default settings from a configuration file named firebird.conf (or ibconfig/isc_config in version 1.0.x), which must be located in the directory assigned to the FIREBIRD (or INTERBASE) variable. This directory must be the parent of the /bin directory where the Firebird binaries reside. It is also the default location of the message and lock files, firebird.msg (interbase.msg) and the hostname.lck file(s).

If the FIREBIRD variable is not configured, the defaults are used: /opt/firebird (on Linux/UNIX platforms), or C:Program FilesFirebird (v. 1.0.x) or C:Program FilesFirebirdFirebird_1_5 (v. 1.5) (on Windows platforms). Refer to Tables through in Chapter Installation for exact locations. If Firebird is installed in a path that is different from the default and the FIREBIRD variable is configured, the client library can read the variable to find the installation path.

On Windows, client applications can also find the installation path by reading the field DefaultInstance under the Registry key that is installed in a client-only installation.

HKEY_LOCAL_MACHINESOFTWAREFirebird ProjectFirebird ServerInstances

For more discussion of the trail followed by the server to locate its files, refer to the “The Firebird Root Directory” section later in this chapter. Look up the section “Installing Clients” in Chapter Firebird Clients for information about client-only installs.


By default, Firebird will use the global temporary file space, usually configured as a system default by the environment variable TMP (discussed below). The FIREBIRD_TMP (v.1.0.x INTERBASE_TMP) environment variable is one means by which a custom location for Firebird’s sort files can be configured. The value must point to a fully qualified path that exists within the host machine’s own physical filesystem.

Other options are available for defining the location of these files. Configuration of the parameter TempDirectories (tmp_directory in Firebird 1.0.x) is described in Chapter Configuration and Special Features, in the section “The Firebird Configuration File” under “Parameters for Configuring Temporary Sort Space.”

*_LOCK and *_MSG

FIREBIRD_LOCK (INTERBASE_LOCK in v.1.0.x) sets the location of the lock file.
FIREBIRD_MSG (INTERBASE_MSG in v.1.0.x) sets the location of the Firebird message file.

These two variables are independent of each other and can be set to different locations. The value must point to a fully qualified path that exists within the host machine’s own physical filesystem.


Sort Space on the Server Machine

Sort space is space on disk where the engine stores the intermediate output sets, in runtime temporary files, for queries that have to be sorted or aggregated. Firebird 1.0.x uses only disk files for such storage. Firebird 1.5 stores these files in RAM, if it can, and pages them out to disk sort space only if resources become exhausted.

The global environment variable TMP (or TEMP on some systems) points to a directory path on the server where applications should store temporary files. Firebird will attempt to store temporary sort files here if the FIREBIRD_TMP environment variable (see the previous section titled “FIREBIRD_TMP”) is not defined and no other sort space has been configured in the Firebird configuration file (see TempDirectories and tmp_directory in Chapter Configuration and Special Features).

isql Script Files on a Client

The interactive command-line SQL utility isql provides the capability to “record” sequences of interactive SQL commands to a script file, using the OUTPUT switch. On a client machine, the TMP setting is the only place to control the space where these script files will be stored if an absolute path specification is not supplied. If the TMP location is not set, a Firebird client uses any temporary directory it finds defined for the local system, usually the /tmp filesystem on a Linux/UNIX client, or C:Temp on a Windows client.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Firebird Topics