Home skin

 

   Location : TOP > Usage
> Install steps for PostgreSQL(Linux)
 
     
  Step1 Install J2RE
Step2 Determine install directory for TG
Step3 Create a symbolic link to J2RE
Step4 Copy JDBC driver and edit "tg.sh"
Step5 Make sure you can run TG
Step6 Make sure you can load JDBC driver
 
     
   >> TOP  
 
   

 

 

 

 

This chapter guides your installation of TG on the following environment.

* Environment
Platform Linux
JDBC driver PostgreSQL JDBC Driver
Target database PostgreSQL

 

  Step1 - Install J2RE -

For example, it is assumed that "j2sdk-1_4_2_01-linux-i586.bin" (downloaded from Sun Microsystem's inc web site) will be installed to the "/home/postgres/tg" directory.

Make sure the downloaded package is executable. If not, use "chmod" command to give the package "execute" permission and run it.

 
* COMMAND-LINE SAMPLE
[postgres@dbsrv1 tg]$ pwd
/home/postgres/tg
[postgres@dbsrv1 tg]$ ls -l
total 13840
-rw-r--r-- 1 postgres postgres 14150306 Nov 28 22:00 j2re-1_4_2_01-linux-i586.bin
[postgres@dbsrv1 tg]$ chmod 755 j2re-1_4_2_01-linux-i586.bin
[postgres@dbsrv1 tg]$ ls -l
total 13840
-rwxr-xr-x 1 postgres postgres 14150306 Nov 28 22:00 j2re-1_4_2_01-linux-i586.bin
[postgres@dbsrv1 tg]$ ./j2re-1_4_2_01-linux-i586.bin
               Sun Microsystems, Inc.
             Binary Code License Agreement

                  for the

JAVATM 2 RUNTIME ENVIRONMENT (J2RE), STANDARD EDITION, VERSION 1.4.2_X

SUN MICROSYSTEMS, INC. ("SUN") IS WILLING TO LICENSE THE SOFTWARE IDENTIFIED
BELOW TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS
CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND SUPPLEMENTAL LICENSE
TERMS (COLLECTIVELY "AGREEMENT"). PLEASE READ THE AGREEMENT CAREFULLY. BY
DOWNLOADING OR INSTALLING THIS SOFTWARE, YOU ACCEPT THE TERMS OF THE

( * * * * snip * * * * )

For inquiries please contact: Sun Microsystems, Inc., 4150 Network Circle,
Santa Clara, California 95054, U.S.A.
(LFI#130039/Form ID#011801)

Do you agree to the above license terms? [yes or no]
yes< input "yes" and press enter here.
Unpacking...
Checksumming...

( * * * * snip * * * * )

Creating j2sdk1.4.2_01/jre/javaws/javaws.jar
Done.
[postgres@dbsrv1 tg]$ ls
j2re-1_4_2_01-linux-i586.bin j2re1.4.2_01
[postgres@dbsrv1 tg]$
 

To the next, execute "java" command and make sure "java" will run without error.

 
* COMMAND-LINE SAMPLE
[postgres@dbsrv1 tg]$ cd j2re1.4.2_01/bin
[postgres@dbsrv1 bin]$ ./java -version
java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
[postgres@dbsrv1 bin]$
 

 

  Step2 - Determine install directory for TG -

Extract TG ZIP package to a folder of your choice. In this section, it is assumed that "/home/postgres/tg" directory is used.

 
* COMMAND-LINE SAMPLE
[mysql@dbsrv1 tg]$ pwd
/home/mysql/tg
[mysql@dbsrv1 tg]$ unzip tg080.zip
Archive: tg080.zip
inflating: tg080/clean.bat
creating: tg080/conf/


( * * * * snip * * * * )

inflating: tg080/tgc.init
extracting: tg080/tgc.jar
[mysql@dbsrv1 tg]$ cd tg080
[mysql@dbsrv1 tg]$
 
The directory "/home/postgres/tg/tg080" contains these subdirectories and files :
 

- tgc.bat
- tgc.jar
- tg.bat
- tg.sh
- tg.conf
- tg.jar
- jobs
- lib
- conf

:
:
:
:
:
:
:
:
:

Startup TGC - TG Controller -.
Contains classes for TGC.
Startup TG on Windows systems.
Startup TG on Linux, UNIX systems.
Contains parameters for TG.
Contains classes for TG.
Contains scripts for JOB.
Contains java libraries.
Contains confifration files for TG.

 

 

  Step3 - Create a symbolic link to J2RE -

Create the symbolic link "/home/postgres/tg/tg080/j2re" to "/home/postgres/tg/j2re1.4.2_01".
Make sure you can run "java" command via the symbolic link.

 
* COMMAND-LINE SAMPLE
[postgres@dbsrv1 tg080]$ pwd
/home/postgres/tg/tg080
[postgres@dbsrv1 tg080]$ ln -s j2re1.4.2_01 j2re
[postgres@dbsrv1 tg080]$ ./j2re/bin/java -version
java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
[postgres@dbsrv1 tg080]$
 

 

  Step4 - Copy JDBC driver and edit "tg.sh" -

Copy JDBC driver into "/home/postgres/tg/tg080/lib" directory. In this section it assumes that "jdbc7.1-1.2.jar" is used as a JDBC driver.

Edit the shell script "tg.sh" which is used to startup TG. And, set "CLASSPATH" environmental value to contain JDBC driver file.

 
* COMMAND-LINE SAMPLE
[postgres@dbsrv1 tg080]$ cp jdbc7.1-1.2.jar /home/postgres/tg/tg080/lib
[postgres@dbsrv1 tg080]$
 
* COMMAND-LINE SAMPLE
[postgres@dbsrv1 tg080]$ vi tg.sh
 
* "tg.sh" SAMPLE
#! /bin/sh
# -- TG - Transaction Generator - [ Version 0.X ] initialization script v.2 --

OPTION1=$1
OPTION2=$2
OPTION3=$3

PATH=./j2re/bin:${PATH}
export PATH

# MySQL JDBC DRIVER :
# CLASSPATH=./lib/mysql-connector-java-5.1.0-bin.jar:${CLASSPATH}

# PostgreSQL JDBC DRIVER :
CLASSPATH=./lib/jdbc7.1-1.2.jar:${CLASSPATH}

# ORACLE JDBC DRIVER :
#CLASSPATH=${ORACLE_HOME}/jdbc/lib/ojdbc14.jar:${CLASSPATH}

# General setting :
CLASSPATH=./tg.jar:.:${CLASSPATH}
export CLASSPATH

java -Xmx512m tg ${OPTION1} ${OPTION2} ${OPTION3}

exit
 

After editing, give "tg.sh" execute permission.

 
* COMMAND-LINE SAMPLE
[postgres@dbsrv1 tg080]$ chmod 755 tg.sh
 

 

  Step5 - Make sure you can run TG -

Run "tg.sh" to startup TG.
When your setup has been done correctly, the following message will be displayed.

 
* COMMAND-LINE SAMPLE
[postgres@dbsrv1 tg080]$ ./tg.sh
TG - Transaction Generator - [ Version 0.80 ] Wed Jun 13 23:49:11 JST 2007

Loading configuration file... Failed.
ERROR : Configuration file does not exist. : /home/postgres/tg/tg080/tg.conf

type "HELP" or "h" to print help messages.

TG>
 

*The example above is assumed that the configuration file of TG (tg.conf) does not exist. Therefore "Loading configuration file... Failed." message is displayed. For the details of "tg.cpmf", please see "Command-line mode" and "Parameter reference" pages.

 

 

  Step6 - Make sure you can load JDBC driver -

Type "check driver postgresql " on TG command prompt and press "Enter" key. When JDBC driver is correctly loaded, the following message will be displayed.

 
* COMMAND-LINE SAMPLE
TG> check driver postgresql
Loading JDBC driver "org.postgresql.Driver" ... OK.

TG>
 

*If you recieved following messages, TG failed to load JDBC driver.

Loading JDBC driver "org.postgresql.Driver" ... Failed.

See section Step4 - Copy JDBC driver and edit "tg.sh", Edit the shell script and correct "CLASSPATH" environmental value.

 

 

     
   >> TOP > Usage
> Install steps for PostgreSQL(Linux)
 

 

Copyright 2003 - 2008 tgmstr. All rights reserved.