B TimesTen Scaleout Environment

This appendix provides reference material on:

Environment variables

These sections discuss environment variables:

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

Environment variable descriptions

These sections provide more details on the environment variables:

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 normally AMERICAN_AMERICA.US7ASCII. To use the environment variable to set the character set, do the following:

NLS_LANG=.WE8ISO8859P1

For more information, see:

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 SQLNetImport commands. See "Import TNS names (TNSNamesImport)" and "Import a sqlnet file (SQLNetImport)" in Oracle TimesTen In-Memory Database Reference for more information.

Java environment variables

For Java applications, there are additional environment variables of interest. These sections 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:

$TIMESTEN_HOME/install/lib/ttjdbcjdk_ver.jar

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

Note:

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):

CLASSPATH=.:$TIMESTEN_HOME/install/lib/ttjdbc7.jar
export CLASSPATH

Or (csh type shell):

setenv CLASSPATH .:$TIMESTEN_HOME/install/lib/ttjdbc7.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.

Instance home directory and subdirectories

When you create an instance, each instance includes these subdirectories within $TIMESTEN_HOME:

  • bin: TimesTen utilities and executables tailored and specific to the instance

    This includes ttenv, which sets environment variables appropriately for the TimesTen environment for your session, and setuproot.sh, which can be run as root to cause data instances to be automatically started whenever the operating system reboots.

    Note that ttenv also puts the bin directory in your path.

  • conf: Contains the timesten.conf file, which is the TimesTen instance configuration file

  • diag: Diagnostic output, including the daemon log and error log

  • grid: Files and resources for TimesTen Scaleout

  • info: Working directory of the TimesTen daemon, containing persistent state about the TimesTen instance

  • install: Symbolic link referencing the installation associated with this instance.

  • plsql: Contains this subdirectory:

    • utl_file_dir: The only directory that can be read from or written to by PL/SQL blocks using the UTL_FILE package

  • startup: Contains a script that can be added to /etc/init.d to cause the instance to be automatically started at system startup and stopped at system shutdown.

Notes:

  • TimesTen Scaleout updates configuration files as needed. Do not update them manually.

  • Client-only instances do not include the grid or the startup directories.

Managing a development or test environment

If you have a test or a development environment where you are creating, using and then destroying multiple grids, you may need to purge the membership server meta data for any grid that is destroyed and will not be used again.

TimesTen Scaleout creates membership server meta data to represent each independent grid on each instance in a grid. If you know that a particular grid has been destroyed and is never going to be used again, then you can perform the following on one instance:

  1. Locate the timesten.conf configuration file in the /conf directory under the instance home directory.

  2. Identify the membership server entries in the timesten.conf configuration file with the grid_guid and grid_name parameters, such as:

    grid_guid=4012FC64-8B9X-45D1-A16C-ED52C3098CAD
    grid_name=mygrid
    

    The membership server entry has the naming structure of grid_name.grid_guid and exists within the /oracle/timesten/grid/membership directory.

    Note:

    It is imperative that you identify the correct grid to avoid deleting a membership server of an active grid.
  3. Execute the zkCli.sh command to connect to the membership servers.

    ./zkCli.sh -server ms_host1:2181
    
  4. Using the zkCli.sh rmr command, delete the membership server entries.

    rmr /oracle/timesten/grid/membership/mygrid.4012FC64-8B9B-45D1-A16C-ED52C3098CAD