DB2 Version 9.7 for Linux, UNIX, and Windows

System environment variables

DB2_ALTERNATE_GROUP_LOOKUP
  • Operating system: AIX®, Linux
  • Default: NULL, Values: NULL, GETGRSET on AIX, GETGROUPLIST on Linux
  • This variable allows DB2® database systems to obtain group information from an alternative source that is provided by the operating system. On AIX, the function getgrset is used. This allows you to obtain groups from somewhere other than local files via Loadable Authentication Modules.
DB2_APPL_CFG_PATH
  • Operating system: Linux and UNIX
    Note: The DB2_APPL_CFG_PATH environment variable is not supported on Linux and UNIX servers.
  • Default: $DB2PATH
  • This variable specifies the path where the client configuration files are stored. The client configuration files include the client database manager configuration file, DB2 registry variables, directory catalogs, and the db2cli.ini file.
  • You can set this variable to specify a user-specific client configuration path. If you set the DB2_APPL_CFG_PATH variable to a user-specific path, any changes that are made to the default location do not affect that client.
  • There are other environment variables to override the default location of certain client configuration files, such as the db2cli.ini and db2dsdriver.cfg files. If these other environment variables are set, the DB2_APPL_CFG_PATH variable is ignored.
DB2_APPL_DATA_PATH
  • Operating system: Linux and UNIX
    Note: The DB2_APPL_DATA_PATH environment variable is not supported on Linux and UNIX servers.
  • Default: $DB2PATH
  • This variable specifies the path where the client user data is stored. Client user data includes the db2dump directory, CLI internal cache files, diagnostic data files, server list cache files, and internal temporary files that require WRITE access.
  • Client users cannot share application data paths.
  • If the DB2PATH variable is set to a READONLY network path, you must set this variable to a location that you have WRITE access to.
  • If you set the DIAGPATH configuration parameter and the DIAGPATH keyword in the db2cli.ini file, the DB2_APPL_DATA_PATH variable is ignored.
DB2_CLP_EDITOR
See DB2_CLP_EDITOR in "Command-line variables" for details.
DB2_CLP_HISTSIZE
See DB2_CLP_HISTSIZE in "Command-line variables" for details.
DB2CONNECT_ENABLE_EURO_CODEPAGE
  • Operating system: All
  • Default:NO, Values: YES, NO
  • Set this variable to YES on all DB2 Connect™ clients and servers that connect to a DB2 for z/OS® server or a DB2 for i server where euro support is required. If you set this variable to YES, the current application code page is mapped to the equivalent coded character set ID (CCSID) that explicitly indicates support for the euro sign. As a result, DB2 Connect connects to the DB2 for z/OS server or DB2 for i server by using a CCSID that is a superset of the CCSID of the current application code and that also supports the euro sign. For example, if the client is using code page that maps to CCSID 1252, the client connects by using CCSID 5348.
DB2CONNECT_IN_APP_PROCESS
  • Operating system: All
  • Default:YES, Values: YES, NO
  • When you set this variable to NO, local DB2 Connect clients on a DB2 Enterprise Server Edition workstations are forced to run within an agent. Some advantages of running within an agent are that local clients can be monitored and that they can use SYSPLEX support.
DB2_COPY_NAME
  • Operating system: Windows
  • Default: The name of the default copy of DB2 installed on your workstation. Values: the name of a copy of DB2 installed on your workstation. The name can be up to 128 characters long.
  • The DB2_COPY_NAME variable stores the name of the copy of DB2 currently in use. If you have multiple DB2 copies that are installed on your workstation, you cannot use DB2_COPY_NAME to switch to a different copy of DB2, you must run the command INSTALLPATH\bin\db2envar.bat to change the copy currently in use, where INSTALLPATH is the location where the DB2 copy is installed.
DB2DBMSADDR
  • Operating system: Linux on x86, Linux on zSeries (31-bit), Windows 32-bit
  • Default: NULL on Linux operating systems, 0x20000000 on Windows operating systems, Values: virtual addresses in the range 0x09000000 to 0xB0000000 in increments of 0x10000 on Linux operating systems, 0x20000000 to 0xB0000000 in increments of 0x10000 on Windows operating systems
  • The DB2DBMSADDR registry variable specifies the default database shared memory address in hexadecimal format.

    This variable can be used to fine-tune the address space layout of DB2 processes. This variable changes the location of the instance shared memory from its current location at virtual address 0x10000000 to the new value.

    Note: An incorrect address can cause severe issues with the DB2 database system, ranging from an inability to start a DB2 instance, to an inability to connect to the database. An incorrect address is one that collides with an area in memory that is already in use, or is predestined to be used for something else. To address this problem, reset the DB2DBMSADDR registry variable to NULL by using the following command:
    db2set DB2DBMSADDR= 
    Note: Before you change the setting of this variable, you must stop the instance and all DB2 processes. If the instance is running while this variable is set, then any subsequent db2stop command fails.
DB2_DIAGPATH
  • Operating system: All
  • Default: The default value is the instance db2dump directory on UNIX and Linux operating systems, and the instance DB2 directory on Windows operating systems.
  • This parameter applies to ODBC and CLI applications only.

    This parameter allows you to specify the fully qualified path for DB2 diagnostic information. This directory could possibly contain dump files, trap files, an error log, a notification file, and an alert log file, depending on your operating system.

    Setting this environment variable has the same effect for ODBC and CLI applications in the scope of that environment as setting the DB2 database manager configuration parameter diagpath, and as setting the CLI/ODBC configuration keyword DiagPath.

DB2DOMAINLIST
  • Operating system: All
  • Default: NULL, Values: A list of Windows domain names that are separated by commas (",").
  • This variable defines one or more Windows domains. The list, which is maintained on the server, defines the domains that the requesting user ID is authenticated against. Only users that belong to these domains have their connection or attachment requests accepted.

    This variable is effective only when CLIENT authentication is set in the database manager configuration. It is needed if a single sign-on from a Windows desktop is required in a Windows domain environment.

    DB2 servers versions 7.1 or later support DB2DOMAINLIST, but only in a pure Windows domain environment. Starting with Version 8 Fix Pack 15 and Version 9.1 Fix Pack 3, DB2DOMAINLIST is supported if either the client or the server is running in a Windows environment.

DB2ENVLIST
  • Operating system: UNIX
  • Default: NULL
  • This variable lists specific variable names for either stored procedures or user-defined functions. By default, the db2start command filters out all user environment variables except those prefixed with "DB2" or "db2". If specific environment variables must be passed to either stored procedures or user-defined functions, you can list the variable names in the DB2ENVLIST environment variable. Separate each variable name by one or more spaces.
DB2INSTANCE
DB2INSTPROF
  • Operating system: Windows
  • Default: Documents and Settings\All Users\Application Data\IBM\DB2\Copy Name (Windows XP, Windows 2003), ProgramData\IBM\DB2\Copy Name (Windows Vista)
  • This environment variable specifies the location of the instance directory on Windows operating systems. Beginning with version 9.5, the instance directory (and other user data files) cannot be under the sqllib directory.
DB2LDAPSecurityConfig
  • Operating system: All
  • Default: NULL, Values: valid name and path to the IBM LDAP security plug-in configuration file
  • This variable is used to specify the location of the IBM LDAP security plug-in configuration file. If the variable is not set, the IBM LDAP security plug-in configuration file is named IBMLDAPSecurity.ini and is in one of the following locations:
    • On Linux and UNIX operating systems: INSTHOME/sqllib/cfg/
    • On Windows operating systems: %DB2PATH%\cfg\

    On Windows operating systems, this variable should be set in the global system environment to ensure that it is picked up by the DB2 service.

DB2LIBPATH
  • Operating system: UNIX
  • Default: NULL
  • DB2 constructs its own shared library path. If you want to add a PATH into the engine's library path (for example, on AIX, a user-defined function requires a specific entry in LIBPATH), you must set DB2LIBPATH. The actual value of DB2LIBPATH is appended to the end of the DB2 constructed shared library path.
DB2LOGINRESTRICTIONS
  • Operating system: AIX
  • Default: LOCAL, Values: LOCAL, REMOTE, SU, NONE
  • This registry variable allows you to use an AIX operating system API called loginrestrictions(). This API determines whether a user is allowed to access the system. By calling this API, DB2 database security is able to enforce the login restrictions that are specified by the operating system. There are different values that can be submitted to this API when you are using this registry variable. The values are:
    • REMOTE

      DB2 enforces login restrictions to verify that the account can be used for remote logins through the rlogind or telnetd programs only.

    • SU

      DB2 Version 9.1 enforces su restrictions to verify that the su command is permitted, and that the current process has a group ID that can start the su command to switch to the account only.

    • NONE

      DB2 does not enforce any login restrictions.

    • LOCAL (or the variable is not set)

      DB2 enforces login restrictions to verify that local logins are permitted for this account only. This is the normal behavior when you log in.

    No matter which one of these options you set, user accounts or IDs that have the specified privileges are able to use DB2 successfully both locally on the server and from remote clients. For a description of the loginrestrictions() API, refer to AIX documentation.

DB2NODE
  • Operating system: All
  • Default: NULL, Values: 1 - 999
  • Used to specify the target logical node of a database partition server that you want to attach to or connect to. If this variable is not set, the target logical node defaults to the logical node that is defined with port 0 on the workstation. In a partitioned database environment, the connection settings could have an impact on acquiring trusted connections. For example, if the DB2NODE variable is set to a node such that the establishment of a connection on that node requires going through an intermediate node (a hop node), it is the IP address of that intermediate node and the communication protocol that is used to communicate between the hop node and the connection node that are considered when evaluating this connection in order to determine if it can be marked as a trusted connection. In other words, it is not the original node from which the connection was initiated that is considered. Rather, it is the hop node that is considered.
    Note: You cannot use the db2set command to update this registry variable. For more information, see Setting environment variables outside the profile registries on Windows.
DB2OPTIONS
  • Operating system: All
  • Default: NULL
  • Used to set the command line processor options.
DB2_PARALLEL_IO
  • Operating system: All
  • Default: NULL, Values: TablespaceID:[n],... - a comma-separated list of defined table spaces (identified by their numeric table space ID). If the prefetch size of a table space is AUTOMATIC, you can indicate to the DB2 database manager the number of disks per container for that table space by specifying the table space ID, followed by a colon, followed by the number of disks per container, n. If n is not specified, the default is 6.

    You can replace TablespaceID with an asterisk (*) to specify all table spaces. For example, if DB2_PARALLEL_IO=*, all table spaces use six as the number of disks per container. If you specify both an asterisk (*) and a table space ID, the table space ID setting takes precedence. For example, if DB2_PARALLEL_IO =*,1:3, all table spaces use six as the number of disks per container, except for table space 1, which uses three.

  • This registry variable is used to change the way DB2 calculates the I/O parallelism of a table space. When I/O parallelism is enabled (either implicitly, by the use of multiple containers, or explicitly, by setting DB2_PARALLEL_IO), it is achieved by issuing the correct number of prefetch requests. Each prefetch request is a request for an extent of pages. For example, a table space has two containers and the prefetch size is four times the extent size. If the registry variable is set, a prefetch request for this table space is broken into four requests (one extent per request) with a possibility of four prefetchers that are servicing the requests in parallel.

    You might want to set the registry variable if the individual containers in the table space are striped across multiple physical disks or if the container in a table space is created on a single RAID device that is composed of more than one physical disk.

    If this registry variable is not set, the degree of parallelism of any table space is the number of containers of the table space. For example, if DB2_PARALLEL_IO is set to NULL and a table space has four containers, four extent-sized prefetch requests are issued; or if a table space has two containers and the prefetch size is four times the extent size, the prefetch request for this table space will be broken into two requests (each request is for two extents).

    If this registry variable is set, and the prefetch size of the table is not AUTOMATIC, the degree of parallelism of the table space is the prefetch size that is divided by the extent size. For example, if DB2_PARALLEL_IO is set for a table space that has a prefetch size of 160 and an extent size of 32 pages, 5 extent-sized prefetch requests are issued.

    If this registry variable is set, and the prefetch size of the table space is AUTOMATIC, DB2 automatically calculates the prefetch size of a table space. The following table summarizes the different options available and how parallelism is calculated for each situation:
    Table 1. How Parallelism is Calculated
    Prefetch size of table space DB2_PARALLEL_IO Setting Parallelism is equal to:
    AUTOMATIC Not set Number of containers
    AUTOMATIC Table space ID Number of containers * 6
    AUTOMATIC Table space ID:n Number of containers * n
    Not AUTOMATIC Not set Number of containers
    Not AUTOMATIC Table space ID Prefetch size/extent size
    Not AUTOMATIC Table space ID:n Prefetch size/extent size

    Disk contention might result by using this variable in some scenarios. For example, if a table space has two containers and each of the two containers have each a single disk that is dedicated to it, setting the registry variable might result in contention on those disks because the two prefetchers are accessing each of the two disks at the same time. However, if each of the two containers was striped across multiple disks, setting the registry variable would potentially allow access to four different disks at the same time.

    To activate changes to this registry variable, issue a db2stop command and then enter a db2start command.

DB2PATH
  • Operating system: All
  • Default: Varies by Windows operating system. On Linux and UNIX operating systems, the default path is $HOME/sqllib.
  • This environment variable is used to specify the directory where the product is installed.
  • For network mounted client environments on Linux and UNIX operating systems, set the path to the network path where the DB2 client code is located.
    Note: The DB2PATH environment variable is not supported on Linux and UNIX servers.
DB2_PMAP_COMPATIBILITY
  • Operating system: All
  • Default: ON, Values: ON, OFF
  • This variable allows users to continue by using the sqlugtpi and sqlugrpn APIs to return, respectively, the distribution information for a table and the database partition number and database partition server number for a row. The default setting, ON, indicates that the distribution map size remains 4 096 entries (the pre-Version 9.7 behavior). When this variable is set to OFF, the distribution map size for new or upgraded databases is increased to 32 768 entries (the Version 9.7 behavior). If you use the 32K distribution map, you must use the new db2GetDistMap and db2GetRowPartNum APIs.
DB2PROCESSORS
  • Operating system: Windows
  • Default: NULL, Values: 0-n-1 (where n= the number of processors)
  • This variable sets the process affinity mask for a particular db2syscs process. In environments that are running multiple logical nodes, this variable is used to associate a logical node to a processor or set of processors.

    When specified, DB2 issues the SetProcessAffinityMask() API. If unspecified, the db2syscs process is associated with all processors on the server.

DB2RCMD_LEGACY_MODE
  • Operating system: Windows,
  • Default: NULL, Values: YES, ON, TRUE, or 1, or NO, OFF, FALSE, or 0
  • This variable allows users to enable or disable the DB2 Remote Command Service's enhanced security. To run the DB2 Remote Command Service in a secure manner, set DB2RCMD_LEGACY_MODE to NO, OFF, FALSE, 0, or NULL. To run in legacy mode (without enhanced security), set DB2RCMD_LEGACY_MODE to YES, ON, TRUE, or 1. The secure mode is only available if your domain controller is running Windows 2000 or later.
    Note: If DB2RCMD_LEGACY_MODE is set to YES, ON, TRUE, or 1, all requests that are sent to the DB2 Remote Command Service are processed under the context of the requester. To facilitate this, you must allow either or both the workstation and service logon account to impersonate the client by enabling the workstation and service logon accounts at the domain controller.
    Note: If DB2RCMD_LEGACY_MODE is set to NO, OFF, FALSE, or 0, you must have SYSADM authority in order to have the DB2 Remote Command Service run commands on your behalf.
DB2RESILIENCE
  • Operating system: All
  • Default: ON, Values: ON (TRUE or 1), or OFF (FALSE or 0)
  • This registry variable can be used to control whether physical read errors are tolerated, and activates extended trap recovery. The default behavior is to tolerate read errors and activate extended trap recovery. To revert to the behavior of previous releases and force the database manager to shut down the instance, set the registry variable to OFF. This registry variable does not affect the existing storage key support.
DB2_RESTORE_GRANT_ADMIN_AUTHORITIES
  • Operating system: All
  • Default: OFF, Values: ON, OFF
  • If DB2_RESTORE_GRANT_ADMIN_AUTHORITIES is set to ON, and you are restoring to a new or existing database, then you are granted SECADM, DBADM, DATAACCESS, and ACCESSCTRL authorities.
  • The following methods of restore are supported when DB2_RESTORE_GRANT_ADMIN_AUTHORITIES is set to ON:
    • Split mirror backups
    • ACS Snapshot backups
    • Online and offline database backups with the RESTORE DATABASE command
    Note: This variable has no effect on table space restores; no additional authorities are granted to the user that is issuing the restore operation.
  • If DB2_WORKLOAD is set to SAP, DB2_RESTORE_GRANT_ADMIN_AUTHORITIES is set to ON.
DB2SYSTEM
  • Operating system: Windows and UNIX
  • Default: NULL
  • Specifies the name that is used by your users and database administrators to identify the DB2 database server system. If possible, this name should be unique within your network.

    This name is displayed in the system level of the Control Center's object tree to aid administrators in the identification of server systems that can be administered from the Control Center.

    When you are using the Search the Network function of the Configuration Assistant, DB2 discovery returns this name and it is displayed at the system level in the resulting object tree. This name aids users in identifying the system that contains the database they want to access. A value for DB2SYSTEM is set at installation time as follows:

    • On Windows the setup program sets it equal to the computer name specified for the Windows system.
    • On UNIX systems, it is set equal to the UNIX system's TCP/IP host name.
DB2_UPDDBCFG_SINGLE_DBPARTITION
  • Operating system: All
  • Default: Not set, Values: 0/FALSE/NO, 1/TRUE/YES
  • When set to 1, TRUE, or, YES, this registry variable allows you to specify that any updates and resets to your database affect only a specific partition. If the variable is not set, updates and requests follow the version 9.5 behavior.
  • Beginning with version 9.5, updates, or changes to a database configuration act across all database partitions, when you do not specify a partition clause. DB2_UPDDBCFG_SINGLE_DBPARTITION enables you to revert to the behavior of previous versions of DB2, in which updates to a database configuration apply only to the local database partition or the database partition that is set by the DB2NODE registry variable. This allows for compatibility with an earlier version for any existing command scripts or applications that require this behavior.
Note: This variable does not apply to update or reset requests that are made by calling ADMIN_CMD routines.
DB2_USE_PAGE_CONTAINER_TAG
  • Operating system: All
  • Default:NULL, Values: ON, NULL
  • By default, DB2 stores a container tag in the first extent of each DMS container, whether it is a file or a device. The container tag is the metadata for the container. Before DB2 Version 8.1, the container tag was stored in a single page, and it thus required less space in the container. To continue to store the container tag in a single page, set DB2_USE_PAGE_CONTAINER_TAG to ON.

    However, if you set this registry variable to ON when you use RAID devices for containers, I/O performance might degrade. Because for RAID devices you create table spaces with an extent size equal to or a multiple of the RAID stripe size, setting the DB2_USE_PAGE_CONTAINER_TAG to ON causes the extents not to line up with the RAID stripes. As a result, an I/O request might must access more physical disks than would be optimal. Users are advised against enabling this registry variable unless you have tight space constraints, or you require behavior consistent with pre-Version 8 databases.

    To activate changes to this registry variable, issue a db2stop command and then enter a db2start command.

DB2_WORKLOAD
  • Operating system: All
  • Default: Not set, Values: 1C, CM, COGNOS_CS, FILENET_CM, INFOR_ERP_LN, MAXIMO, MDM, SAP, TPM, WAS, WC, or WP
  • Each value for DB2_WORKLOAD represents a specific grouping of several registry variables with predefined settings.
  • These are the valid values:
    1C
    Use this setting when you want to configure a set of registry variables in your database for 1C applications.
    CM
    Use this setting when you want to configure a set of registry variables in your database for IBM® Content Manager.
    COGNOS_CS
    Use this setting when you want to configure a set of registry variables in your database for Cognos® Content Server.
    FILENET_CM
    Use this setting when you want to configure a set of registry variables in your database for FileNet Content Manager.
    INFOR_ERP_LN
    Use this setting when you want to configure a set of registry variables in your database for Infor ERP Baan.
    MAXIMO
    Use this setting when you want to configure a set of registry variables in your database for Maximo®.
    MDM
    Use this setting when you want to configure a set of registry variables in your database for Master Data Management.
    SAP
    Use this setting when want to configure a set of registry variables in your database for the SAP environment.
    When you have set DB2_WORKLOAD=SAP, the user table space SYSTOOLSPACE and the user temporary table space SYSTOOLSTMPSPACE are not automatically created. These table spaces are used for tables that are created automatically by the following wizards, utilities, or functions:
    • Automatic maintenance
    • Design Advisor
    • Control Center database information panel
    • SYSINSTALLOBJECTS stored procedure, if the table space input parameter is not specified
    • GET_DBSIZE_INFO stored procedure

    Without the SYSTOOLSPACE and SYSTOOLSTMPSPACE table spaces, you cannot use these wizards, utilities, or functions.

    To be able to use these wizards, utilities, or functions, do either of the following:
    • Manually create the SYSTOOLSPACE table space to hold the objects that the tools need (in a partitioned database environment, create this table space on the catalog partition). For example:
      CREATE REGULAR TABLESPACE SYSTOOLSPACE 
      IN IBMCATGROUP 
      MANAGED BY SYSTEM 
      USING ('SYSTOOLSPACE')
    • Specifying a valid table space, call the SYSINSTALLOBJECTS stored procedure to create the objects for the tools, and specify the identifier for the particular tool. SYSINSTALLOBJECTS creates a table space for you. If you do not want to use SYSTOOLSSPACE for the objects, specify a different user-defined table space.
    After completing at least one of these choices, create the SYSTOOLSTMPSPACE temporary table space (also on the catalog partition, if you are working in a partitioned database environment). For example:
    CREATE USER TEMPORARY TABLESPACE SYSTOOLSTMPSPACE 
    IN IBMCATGROUP 
    MANAGED BY SYSTEM 
    USING ('SYSTOOLSTMPSPACE')

    Once the table space SYSTOOLSPACE and the temporary table space SYSTOOLSTMPSPACE are created, you can use the wizards, utilities, or functions that are mentioned earlier.

    TPM
    Use this setting when you want to configure a set of registry variables in your database for the IBM Tivoli® Provisioning Manager.
    WAS
    Use this setting when you want to configure a set of registry variables in your database for WebSphere® Application Server. This value is available in DB2 Version 9.5 Fix Pack 5 and later.
    WC
    Use this setting when you want to configure a set of registry variables in your database for WebSphere Commerce. This value is available in DB2 Version 9.5 Fix Pack 4 and later.
    WP
    Use this setting when you want to configure a set of registry variables in your database for WebSphere Portal. This value is available in DB2 Version 9.5 Fix Pack 5 and later.