Showing posts with label SwingBench. Show all posts
Showing posts with label SwingBench. Show all posts

Monday, July 7, 2008

SwingBenchException: Oracle jdbc classes not found

Problem Description:
---------------------------------------

After running swingbench product you get the following message,

11:18:57 07/08 [EROR] UserSession com.dom.benchmarking.swingbench.kernel.SwingBenchException: Oracle jdbc classes not found

Reason of The Problem:
-----------------------------------------

The Oracle jdbc class is not found. Possibly there is wrong settings of CLASSPATH in the $SWINGHONE/swingbench.env file.

Solution of The Problem:
------------------------------------------

For example if you just install oracle instant client then change the CLASSPATH location to the point of ojdbc14.jar.
There was the settings of ,
# The following is needed for 10g environments
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/jdbc/lib/ojdbc14.jar

Now you point to your instant client and fing ojdbc14.jar. Locate the location to the CLASSPATH variable in the swingbench.env, change it to correct location and start the swingbench.

export CLASSPATH=$CLASSPATH:$ORACLE_HOME/ojdbc14.jar

Sunday, July 6, 2008

How to develop own transactions load with Swingbench

Swingbench is a free tool to generate load on database. This product has four benchmark and you can test those benchmark easily. Almost no extra work needed. Just import schema tablespaces and load data and test load with predefined transaction.

But how you can test load with your transaction based on your data?

While configuring swingbench you may have troubles to load your own defined transaction into it and then test your load. In this topic I will write how easily you can proceed with swingbench to test load with your defined transaction.

With swingbench to test your own defined transaction there are two approaches. Either by writing PL/SQL procedures or by writing JAVA programs. The steps are discussed below using stored procedures.

1. Unzip swingbench product.
2. Open the file $SWINGHONE/sql/storedprocedures.sql with an vi editor and edit the procedures. There are six stored procedures by defaults. You can add more if you wish. For example here I have edited storedprocedure3 to add a delete statement like below.

function storedprocedure3(min_sleep integer, max_sleep integer) return integer_return_array is
begin
init_dml_array();
execute immediate 'DELETE FROM TEST where name= ''1''';
increment_deletes(1);
sleep(min_sleep, max_sleep);
return dml_array;
end storedprocedure3;


3. In this way you can add several procedures like insert , update, delete etc. and save the file. Like save it as stored.sql
4. Log on to the user on which you want to test load and then execute the script. For example,
SQL>conn arju/a
SQL>@stored.sql

A typical output is,
SQL> @/export/home/oracle/stored.sql

Type created.


Package created.


Package body created.

If you get any error then try to fix the error.

5.Now edit the $SWINGHONE/bin/swingconfig.xml file and along with username, passowrd etc entry edit the transaction entry to include the StoredProceduren class where n may be from 1 to ... as you ran script in to your database. Like here I added storedprocedure4 in the configuration file.

[Transaction]
[Id]UpdateCount[/Id]
[ShortName]Update Count Table[/ShortName] [ClassName]com.dom.benchmarking.swingbench.storedprocedures.
StoredProcedure4[/ClassName]
[Weight]20[/Weight]
[Enabled]true[/Enabled]
[/Transaction]

Use <> instead of [].

Along with class name you can edit ID and shortname for better understanding.

6. Now save the swingconfig.xml file and run the swingbench. If you have syntactically correct in your swingconfig.xml swingbench will run and test your load.

7.You can edit the configuration as your wish. You can give different load in the configuration tab.

Related Documents:

Automatic Load Generation tool in Database
Swingbench Exception: Oracle jdbc classes not found

Wednesday, June 25, 2008

Automatic Load Generation tool in Database

Today I work with automatic and free load generation tool in my database. It is quite essential to experiment on test database performance by generating load on it before going to production database. There are many tools that may load workload. But I today work with tool named Swingbench and it is free to use.

If you need to download any load generation tool you can download swingbench from link,

http://www.dominicgiles.com/downloads.html

The main problem of this product it is free and has no support.

There is one user's manual of this software which can be downloaded from
http://www.dominicgiles.com/swingbench/swingbench22.pdf

You must have JVM installed on the client platform to run swingbench. It also requires an Oracle client. This can either be in the form of a full blown Oracle database install or the Oracle instant client downloadable from the OTN (Oracle Technology Network).

http://www.oracle.com/technology/software/tech/oci/instantclient/index.html


In order to use the product no need to install. Just download the zip file and save it in your computer. Then unzip it where you want to resides the program.

Before using this tool you have to at first modify swingbench.env file and change your JAVAHOME, SWINGHOME location according to your wish. On Windows the file is $SWINGHOME/swingbenchenv.bat. Note that java must be installed before using this product.

For unix based user use swingbench which is under $SWINGHOME/bin directory and for windows based user use $SWINGHOME/winbin directory.

The swingbench by default has a configuration file. Swingbench reads its configuration properties from a file called swingconfig.xml located in the $SWINGHOME/bin directory. In the file you can set general variable like host, user name, password etc.

It can be worked with the default swingbench environment ships with the source code for 4 benchmarks.
• CallingCircle
• OrderEntry (PL/SQL)
• OrderEntry (jdbc)
• PL/SQL stubs

The callingcircle schema can be loaded with ccwizrd and corresponding settings is in ccwizzard.xml
The order entry schema can be loaded with oewizard and corresponding settings in in oewizard.xml

After loading data you can run swingbench.

Related Documents:
------------------------------

How to develop own transactions load with Swingbench