当前位置: 首页 > 工具软件 > Swingbench > 使用案例 >

java 测试工具 oracle_SwingBench—ORACLE压力测试工具

陆昕
2023-12-01

■■描述

Swingbench is a free load generator (and benchmarks) designed to stress test an Oracle database (12c, 18c, 19c).

SwingBench是Oracle UK的一个员工在一个被抛弃的项目的基础上开发的。目前稳定版本2.6,基于JDK。该工具是免费的,可以在作者的网站上自由下载,并且拥有详细的使用文档。Swingbench 可 以执行4种不同的标准测试(benchmark),拥有三种前端展示方式Swingbench/Charbench/Minibench,其中 Charbench是字符模式的,另外两种是GUI模式的。另外还可以通过ClusterOverview可以聚合显示所有的结果。Swingbench 的开发目的主要是用来展示RAC的负载和测试,但也可用于单实例环境。2.3版本开始支持TimesTen。

SwingBench下载地址:另有Data Generator、CPU Monitor等工具

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

wget http://www.dominicgiles.com/swingbench/swingbenchlatest.zip

■■win配置

配置好jdk环境,在win上运行swingbench\winbin下的oewizard.bat脚本,create the order entry创建测试数据,connect string的格式为//oracle数据库所在主机的IP地址/oracle数据库的实例名,如:【//192.168.222.69/prod_taf】。一步一步走,根据情况选择测试数据的大小,可以选较小的1G测试数据。等待大约十几分钟后创建测试数据完毕。

■win测试

运行swingbench\winbin\swingbench.bat脚本,可以进行压力测试。

■■linux配置

【非常简单,以下为官方readme文档介绍】

swingbench Install

^^^^^^^^^^^^^^^^^^

Unizip the swingbenchlatest.zip file

Change into the newly created swingbench directory and then either the "bin" directory

for Linux/Unix or the "winbin" for windows systems.

Ensure java (Java 8 or later) is in your executable path.

You should then be able to run swingbench or any of the wizards.

1

2

3

4

5

6

7

swingbenchInstall

^^^^^^^^^^^^^^^^^^

Uniziptheswingbenchlatest.zipfile

Changeintothenewlycreatedswingbenchdirectoryandtheneitherthe"bin"directory

forLinux/Unixorthe"winbin"forwindowssystems.

Ensurejava(Java8orlater)isinyourexecutablepath.

Youshouldthenbeabletorunswingbenchoranyofthewizards.

■所以只需配置java环境即可

export JAVA_HOME=/home/ituser/ljg/soft/jdk1.8.0_212

export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

■初始化sh数据,未执行

[oracle@localhost bin]$ ll sh-rwxr-xr-x. 1 oracle dba 128 Nov 17 2010 shwizard

-rwx------. 1 oracle dba 2499 Aug 28 2010 shwizard.xml

■初始化soe数据,ok

[oracle@localhost bin]$ ll oe

-rwxr-xr-x. 1 oracle dba 120 Nov 17 2010 oewizard

-rwx------. 1 oracle dba 3279 Jul 27 2010 oewizard.xml

■初始化cc数据,未执行

[oracle@localhost bin]$ ll ccwizard*

-rwxr-xr-x. 1 oracle dba 120 Nov 17 2010 ccwizard

-rwx------. 1 oracle dba 4086 Jul 27 2010 ccwizard.xml

■执行sh压力测试

./swingbench -c /swingbench/configs/shconfig.xml

■执行soe压力测试

./swingbench -c /swingbench/configs/soeconfig.xml

■执行cc压力测试

./swingbench -c /swingbench/configs/ccconfig.xml

■测试结果

为了能够收集系统的io和cpu,需要登录系统(configuration–>connect pooling–>distributed controls)

 类似资料: