TimesTen Simple Walkthrough


Intro


Oracle TimesTen In-Memory database is a high performance event-processing software component that enables applications to capture, store, use, and distribute information in real-time, while preserving transactional integrity and continuous availability. The following simple walk through assumes a working knowledge of the TimesTen. The purpose of this page is to show how Swingbench can be run against TimesTen using a trivial benchmark.

The following walkthrough has been tested with TimesTen 6/7. The example is based on a Linux/Unix client but it could be trivially moved to a Windows environment.

Software


User can download Oracle TimesTen from here
Users will also need to use the latest build of Swingbench 2.3 available here

Installation


Follow the installation guide to install TimesTen. This walk though assumes that it follows the default model and the the software is installed in /opt/TimesTen.
Swingbench is installed as usual however the users need to ensure that the TTHOME in the swingbench.env file is set to reflect the locations of the TimesTen software. ie.

#!/bin/bash
#!/bin/bash
# Set the following to reflect the root directory of your Java installation
export JAVAHOME=/usr/java/latest
# Set the following to the directory where you installed swingbench
export SWINGHOME=/Users/dgiles/swingbench
# Set the following to the location of your TimesTen install (optional)
export TTHOME=/opt/TimesTen/tt70
# If you don't have the ORACLE_HOME environment variable set uncomment the following and change it to reflect your environment
# export ORACLE_HOME=/home/oracle
#
export ANTHOME=$SWINGHOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib:$TTHOME/lib
export CLASSPATH=$JAVAHOME/lib/rt.jar:$JAVAHOME/lib/tools.jar:$SWINGHOME/lib/mytransactions.jar: ${SWINGHOME}/lib/swingbench.jar:$ANTHOME/ant.jar:
# The following is needed for 10g environments
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/jdbc/lib/ojdbc14.jar:$ORACLE_HOME/opmn/lib/ons.jar
# The following is only needed for 11g environments
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/jdbc/lib/ojdbc5.jar
# The following is only needed for TimesTen environments
export CLASSPATH=$CLASSPATH:$TTHOME/lib/classes15.jar


The values shown in red need to be modified to reflect the file structure into which the software has been installed.

Create Datastore


To ensure that is possible to access/create a TimesTen datastore edit (this may not exist) $HOME/odbc.ini and create an entry similar to this

[sb]
DRIVER=/opt/TimesTen/tt70/lib/libtten.so
DataStore=/var/TimesTen/tt70/SwingbenchDataStore/sb
PermSize=100


When accessing TimesTen for the first time the entry above will create a 100MB temporary datastore in the /var/TimesTen/tt70/SwingbenchDataStore directory. NOTE : Ensure that you have write access to create files in this location.
Ensure that it is possible to connect to TimesTen (make sure that the TimesTen installation "bin" directory is in your path).

[oracle@oraclelinux bin]# ttisql
Copyright (c) 1996-2006, Oracle. All rights reserved.
Type ? or "help" for help, type "exit" to quit ttIsql.
All commands must end with a semicolon character.

Command> connect sb;
Connection successful: DSN=sb;UID=root;DataStore=/var/TimesTen/tt70/SwingbenchDataStore/sb;
DRIVER=/opt/TimesTen/tt70/lib/libtten.so;
(Default setting AutoCommit=1)
Command> exit


Configure Swingbench


Swingbench ships with a simple benchmark for TimesTen called stresstest, it can run both against Oracle and TimesTen. It is located in the $SWINHOME/bin/sample directory. However it needs to be modified to reflect your environment. Run swingbench using the following command

[oracle@oraclelinux bin]./swingbench -c sample stresstest.xml


Make sure the connection information looks similar to the following



Press the play button to start the transactional load andto stop it . The supplied benchmark has a delay of between one and ten milliseconds between transactions to run TimesTen at its maximum speed set the "Min. Think Time" and "Max. Think Time" to zero. Also note that this benchmark adds and removes transactions from a single table and unless the size of the TimesTen memory allocation is modified it will quickly run out of memory.


Users can implement their own transactions as described in the Swingbench reference guide available here