Show TOC

Environment Variables for Setting Up the Database ConnectionLocate this document in the navigation structure

Each SAP system in the transport environment needs environment variables that enable tp to log on to the databases belonging to the SAP systems. These environment variables depend on the particular database system and must therefore be defined specifically for each SAP system.

The following applies to all databases:

  • dbms_type

    The database interface recognizes the type of the database system by the environment variable dbms_type.

    Possible values: ora, inf, db2, db4, db6, ada, mss

  • DIR_LIBRARY

    This environment variable determines the directory in which the shared library for setting up the database connection is searched for.

    UNIX

    Default: /usr/sap/$(system)/SYS/exe/run/

    Possible values: Paths

    This environment variable tells tp the directory in which the dynamic SAP database interface is located. In the standard system, these files are always in the executable directory of the application server. This means that you do not have to change the default value. tp derives the value of the environment variables IR_LIBRARY from the value of this environment variable.

    Windows

    Windows does not evaluate the environment variable DIR_LIBRARY.

    The search for the dynamic SAP database interface is made in the following order:

    1. in the directory in which the started executable tp.exe is located
    2. in the work directory from which the program tp was called
    3. in the Windows directory
    4. in the path
IBM DB2 for z/OS

The environment variables required for DB2 for z/OS can be found in the SAP Database Administration Guide: IBM DB2 for z/OS in the appendix Environment Variables.

IBM DB2 for Linux, UNIX, and Windows

You must install the DB2 client software on the host where the transport control program tp runs. The SAP database must be cataloged and accessible.

The following environment variables are also required:

  • DB2DBDFT

    Default: <SAPSID>

    Value range: Text

    Here, you can enter the name of the SAP database.

  • DB2INSTANCE

    Default: db2<sapsid>

    Value range: Text

    Here, you can enter the name of the DB2 database instance where the SAP database is cataloged.

  • DB2DB6EKEY

    Value range: Text

    This variable is used to decode the passwords of the database users. You have to set the same value for this variable as for the central instance.

  • DB2DB6_PASSWD_FILE

    Default: /usr/sap/<SAPSID>/SYS/global/dscdb6.conf

    Value range: Text

    Here, you can specify the directory where the password file that contains the passwords of the database users is stored.

    If you do not set the variable, the default value is used.

  • dbs_db6_schema

    Default: sapr3 or sap<sapsid>

    Value range: Text

    This variable describes the name of the database connect user.

IBM DB2 for i5/OS

DB2 for i5/OS for iSeries requires only SAPDBHOST:

Value range: Text

This environment variable specifies the system name of the host where the database runs.

If you use TCP/IP instead of opticonnect, you must also specify the following:

dbs/dbh/ opticonnect = 0

INFORMIX

INFORMIX databases with a standard installation require the two environment variables INFORMIXSERVER and INFORMIX_DBIDD:

  • INFORMIXSERVER

    Value range: Text

    This environment variable specifies the name of the host where the database runs.

  • INFORMIX_DBID

    Value range: Text

    This environment variable specifies the name of the database instance. The name is case-sensitive.

  • INFORMIXDIR

    Default: /informix/<sapsid>.

    Value range: Text

    This environment variable specifies the name of the directory where the database software is located.

  • INFORMIXSQLHOST

    Default value (UNIX): $(informixdir)/etc/sqlhosts[.tli|.soc]

    Value range: Text

    This environment variable specifies the name of the SQL hosts file with a complete path.

Microsoft SQL Server

SQL Server databases require the two environment variables MSSQL_SERVER and MSSQL_DBNAME.

  • MSSQL_SERVER

    Value range: Text

    This parameter specifies the TCP/IP name of the host where the database runs.

  • MSSQL_DBNAME

    Value range: Text

    This environment variable specifies the name of the database instance.

Microsoft SQL Server has two ways of connecting to the database:

  1. SQL Server authentication

    SQL Server user and password are defined (sapr3, sap)

  2. Windows authentication (integrated security)

    No user or password is necessary. The Windows security descriptor is used and the Windows user connects itself.

Windows authentication is used by default. For <SID>adm and SapService<SID>, the corresponding logins are created during the upgrade and the installation (see SAP Note 116735 Information published on SAP site). The environment variables MSSQL_USER and MSSQL_PASSWD are no longer evaluated in normal circumstances.

However, by setting the environment variable MSSQL_USEINTEGRATEDSECURITY to 0, you can force the process to use SQL Server authentication to log on. If a tp user is running under a non-<SID>adm user, the user can work with a SQL Server database by setting MSSQL_USEINTEGRATEDSECURITY=0 using a user name and password. You can also define a Windows login for this user with the SQL Server Enterprise Manager. We recommend using this option.

  • MSSQL_USER

    Value range: Text

    This environment variable specifies the connection to the database for a specific user.

  • MSSQL_PASSWD

    Value range: Text

    The environment variable MSSQL_USER specifies the password for a specific user.

  • MCOD systems also require the environment variable MSSQL_SCHEMA to be set.

    This environment variable specifies the name of the database instance (in lowercase letters <sid>).

Oracle

The environment variables TNS_ADMIN and dbs_ora_tnsname are relevant for configuring the database connections for Oracle databases. Due to the Oracle software used, ORACLE-NET-V2 is used to connect to the database.

The NLS (National Language Support) and TNS (Transparent Network Substrat) files are installed in the directory ORACLE_HOME. Oracle installations are only possible with this configuration. (Oracle uses TNS to implement the SQL*NET V2 database connection.)

SAP's own database interface is in a dynamic library that is not linked to the user until runtime.

  • dbs_ora_tnsname

    Value range: Text

    This environment variable specifies the logical name given to the instance in the Oracle network during configuration.

  • TNS_ADMIN

    Value range: Text

    Possible values: Paths

    You can use this environment variable to inform tp where the configuration files for ORACLE SQL*NET V2 are located.

    Note Windows does not evaluate this environment variable.
  • NLS_LANG

    Default: AMERICAN.AMERICA.WE8DEC

    Value range: Text

    This environment variable specifies the code page of the database instance.

    The Oracle databases are installed with the code page we8dec. In this case, you must enter the value american_america.we8dec in the transport profile.

  • ORACLE_HOME

    Value range: Text

    Possible values: Paths

    This environment variable informs the transport control program of the value of the directory in which the Oracle client software is installed.

    Note Windows does not evaluate this environment variable.
MaxDB

MaxDB databases with a standard installation require the environment variable dbname.

  • dbname

    Value range: Text

    This environment variable specifies the name of the database instance.

The database connection is read from the xuser file after the DEFAULT userkey entry. The xuser file format is stored in file $home/.xuser62 and in the registry for Windows.