Environment Variables

There are several environment variables that must be set appropriately for proper operation of TimesTen Scaleout.

Setting Environment Variables

You set environment variables for a terminal window, which enables the window to run commands for a particular instance. Here is a list of situations where you should set your environment variables:

  • After you create the active management instance

  • Before using ttGridAdmin or any TimesTen utility

  • Before executing a direct mode application on a host running a data instance

  • Before executing a client server application on a host running a client (or data) instance

You set the environment variables by sourcing the ttenv shell script (ttenv.sh or ttenv.csh). TimesTen creates the scripts after you create an instance. These scripts are located in the grid/instance1/bin directory (where grid/instance1 is the full path of the instance). By sourcing these scripts, the environment variables required to use a TimesTen Scaleout instance are set.

The environment variables include TIMESTEN_HOME, PATH, LD_LIBRARY_PATH (or equivalent) and TNS_ADMIN.

For example:

For a Bourne-type shell, such as sh, bash, zsh, or ksh:

$ . ttenv.sh

For a csh or tcsh shell:

% source ttenv.csh

TIMESTEN_HOME Environment Variable

The TIMESTEN_HOME environment variable specifies the home directory of the TimesTen Scaleout instance. You explicitly set this variable when sourcing the ttenv script.

NLS_LANG Environment Variable

The character set specified in the database definition file is used by default for the connection, if not overridden by NLS_LANG or if not in the connectable. While setting the character set explicitly is recommended, the default is usually AMERICAN_AMERICA.US7ASCII. To use the environment variable to set the character set, do the following:


See Character Sets in Oracle TimesTen In-Memory Database C Developer's Guide and Supported Character Sets in Oracle TimesTen In-Memory Database Reference.

Shared Library Path Environment Variable

The shared library path environment variable is set when sourcing ttenv. This environment variable specifies the path for shared libraries. The ttenv script adds $TIMESTEN_HOME/install/lib to LD_LIBRARY_PATH.

PATH Environment Variable

TimesTen provides utilities for managing and debugging your applications. For these utilities to be available, the path for executables in $TIMESTEN_HOME/bin and $TIMESTEN_HOME/install/bin must be designated in the PATH setting. The path is updated to include these directories when you source ttenv.

In addition, to compile programs, be sure the location of the compiler for your programming language is in the PATH setting.

Temporary Directory Environment Variable

TMPDIR specifies the location of the temporary directory, which TimesTen uses during recovery and other operations.

TNS_ADMIN Environment Variable

The TNS_ADMIN environment variable specifies the full path to the directory where the tnsnames.ora file is located.

  • For TimesTen OCI, Pro*C/C++, or ODP.NET, set the TNS_ADMIN environment variable to indicate the full path to the directory where the tnsnames.ora file is located.

  • TimesTen Scaleout automatically populates the tnsnames.ora file on all instances with entries for all the connectables. Do not manually configure these entries, as the related configuration files are owned by TimesTen Scaleout.

  • The tnsnames and related information for additional entries, such as for Oracle database connections (as applicable), are brought in and distributed through the ttGridAdmin TNSNamesImport and ttGridAdmin SQLNetImport commands. See Import TNS Names (TNSNamesImport) and Import a SQLNet file (SQLNetImport) in Oracle TimesTen In-Memory Database Reference.

Java Environment Variables

For Java applications, there are additional environment variables of interest. These topics provide information about additional environment variables or considerations that affect Java applications:

CLASSPATH Environment Variable

Java classes and class libraries are found on the class path, as specified by the CLASSPATH environment variable. Before executing a Java program that loads any of the TimesTen JDBC drivers, the CLASSPATH setting must include the class library file and path:


where JDK_VER indicates the JDK version. For JDK8, JDK_VER is 8 and the file name is ttjdbc8.jar.


If multiple JAR files are listed in the CLASSPATH, ensure that the TimesTen JAR file is listed first.

CLASSPATH elements are separated by colons. For example (sh type shell):


Or (csh type shell):

setenv CLASSPATH .:$TIMESTEN_HOME/install/lib/ttjdbc8.jar

To check the JDK version:

java -version

PATH Environment Variable Settings for Java

For Java applications, ensure that the locations of the java and javac executables are in the PATH setting.