LoginSignup
10
4

SwingbenchでOracle Databaseへ負荷をかけてみてみた

Last updated at Posted at 2020-08-12

■ 目的

Swingbenchは、Oracleデータベースのストレステスト用に設計された無料の負荷ジェネレーター(およびベンチマーク)で負荷を生成し、トランザクション/応答時間をグラフ化できます。
Swingbenchを使用して、Real Application Clusters、オンラインテーブル再構築、スタンバイデータベース、オンラインバックアップとリカバリなどのテクノロジーを実証およびテストできます。
SwingBenchに同梱されるコードには、OrderEntry、SalesHistory、TPC-DS Like、JSON、CallingCircle、StressTestなどのベンチマークが含まれています。
ということで、Swingbenchを設定し、負荷をかける動作テストをしてみてみます。

■ 環境

構成.png

Swinfbenchのコンピュートは、OCIのIaaS Cpmpute (OS: Oracle Linux)
DBは、前回Market PlaceでインストールしたOralce Database 19c を使用します。
Oracle Cloud: 東京-大阪リージョン間で手動Data Guardしてみてみた
あと、On-PremisesのMac BookからsshでSwingbench-inst01へアクセスし、前回X Windowの設定をしてSwingbenchのGUIを出力できるようにしています
Macへ X Window Systemで GUI表示してみてみた

■ Swingbenchインストール

あらかじめ用意したLinuxコンピューターへswingbenchインストールしていきます。

● yumデータ更新

[opc@swingbench-inst01 ~]$ sudo yum makecache fast
	読み込んだプラグイン:langpacks, ulninfo
	ksplice-uptrack                                                                                                               |  951 B  00:00:00
	ol7_UEKR5                                                                                                                     | 2.5 kB  00:00:00
	ol7_addons                                                                                                                    | 2.5 kB  00:00:00
	ol7_developer                                                                                                                 | 2.5 kB  00:00:00
	ol7_developer_EPEL                                                                                                            | 2.7 kB  00:00:00
	ol7_latest                                                                                                                    | 2.7 kB  00:00:00
	ol7_optional_latest                                                                                                           | 2.5 kB  00:00:00
	ol7_software_collections                                                                                                      | 2.5 kB  00:00:00
	(1/17): ol7_UEKR5/x86_64/updateinfo                                                                                           |  70 kB  00:00:00
	(2/17): ol7_addons/x86_64/updateinfo                                                                                          |  91 kB  00:00:00
	(3/17): ol7_addons/x86_64/primary_db                                                                                          | 164 kB  00:00:00
	(4/17): ol7_UEKR5/x86_64/primary_db                                                                                           |  10 MB  00:00:00
	(5/17): ol7_developer/x86_64/updateinfo                                                                                       | 7.2 kB  00:00:00
	(6/17): ol7_developer_EPEL/x86_64/group                                                                                       | 365 kB  00:00:00
	(7/17): ol7_developer/x86_64/primary_db                                                                                       | 683 kB  00:00:00
	(8/17): ol7_latest/x86_64/updateinfo                                                                                          | 2.9 MB  00:00:00
	(9/17): ol7_developer_EPEL/x86_64/updateinfo                                                                                  | 6.4 kB  00:00:00
	(10/17): ol7_latest/x86_64/group                                                                                              | 660 kB  00:00:00
	(11/17): ol7_optional_latest/x86_64/updateinfo                                                                                | 1.0 MB  00:00:00
	(12/17): ol7_software_collections/x86_64/updateinfo                                                                           | 8.7 kB  00:00:00
	(13/17): ol7_developer_EPEL/x86_64/primary_db                                                                                 |  17 MB  00:00:00
	(14/17): ol7_optional_latest/x86_64/primary_db                                                                                | 7.0 MB  00:00:00
	(15/17): ol7_software_collections/x86_64/primary_db                                                                           | 7.2 MB  00:00:00
	(16/17): ol7_latest/x86_64/primary_db                                                                                         |  35 MB  00:00:00
	(17/17): ksplice-uptrack/7Server/x86_64/primary                                                                               | 3.4 kB  00:00:00
	ksplice-uptrack                                                                                                                                17/17
	メタデータのキャッシュを作成しました

● Java JDK 8 インストール

Swingbenchは JDK 8が必要なので次の2つをインストール

java-1.8.0-openjdk.x86_64
java-1.8.0-openjdk-headless.x86_64
[opc@swingbench-inst01 ~]$ sudo yum install java-1.8.0-openjdk.x86_64
	読み込んだプラグイン:langpacks, ulninfo
	ksplice-uptrack                                                                                                               |  951 B  00:00:00
	ol7_UEKR5                                                                                                                     | 2.8 kB  00:00:00
	・・・
	インストール:
	java-1.8.0-openjdk.x86_64 1:1.8.0.262.b10-0.el7_8

	依存性関連をインストールしました:
	alsa-lib.x86_64 0:1.1.8-1.el7                     atk.x86_64 0:2.28.1-2.el7                         cairo.x86_64 0:1.15.12-4.el7
	fribidi.x86_64 0:1.0.2-1.el7_7.1                  gdk-pixbuf2.x86_64 0:2.36.12-3.el7                giflib.x86_64 0:4.1.6-9.el7
	graphite2.x86_64 0:1.3.10-1.el7_3                 gtk-update-icon-cache.x86_64 0:3.22.30-5.el7      gtk2.x86_64 0:2.24.31-1.el7
	harfbuzz.x86_64 0:1.7.5-2.el7                     hicolor-icon-theme.noarch 0:0.12-7.el7            jasper-libs.x86_64 0:1.900.1-33.el7
	jbigkit-libs.x86_64 0:2.0-11.el7                  libXcomposite.x86_64 0:0.4.4-4.1.el7              libXdamage.x86_64 0:1.1.4-4.1.el7
	libXtst.x86_64 0:1.2.3-1.el7                      libdrm.x86_64 0:2.4.97-2.el7                      libglvnd.x86_64 1:1.0.1-0.8.git5baa1e5.el7
	libglvnd-egl.x86_64 1:1.0.1-0.8.git5baa1e5.el7    libglvnd-glx.x86_64 1:1.0.1-0.8.git5baa1e5.el7    libpciaccess.x86_64 0:0.14-1.el7
	libthai.x86_64 0:0.1.14-9.el7                     libtiff.x86_64 0:4.0.3-32.el7                     libwayland-client.x86_64 0:1.15.0-1.el7
	libwayland-server.x86_64 0:1.15.0-1.el7           libxshmfence.x86_64 0:1.2-1.el7                   mesa-libEGL.x86_64 0:18.3.4-7.el7_8.1
	mesa-libGL.x86_64 0:18.3.4-7.el7_8.1              mesa-libgbm.x86_64 0:18.3.4-7.el7_8.1             mesa-libglapi.x86_64 0:18.3.4-7.el7_8.1
	pango.x86_64 0:1.42.4-4.el7_7                     ttmkfdir.x86_64 0:3.0.9-42.el7                    xorg-x11-font-utils.x86_64 1:7.5-21.el7
	xorg-x11-fonts-Type1.noarch 0:7.5-9.el7

	完了しました!
[opc@swingbench-inst01 ~]$ sudo yum install java-1.8.0-openjdk-headless.x86_64
	読み込んだプラグイン:langpacks, ulninfo
	依存性の解決をしています
	--> トランザクションの確認を実行しています。
	---> パッケージ java-1.8.0-openjdk-headless.x86_64 1:1.8.0.262.b10-0.el7_8 を インストール
	・・・
	インストール:
	java-1.8.0-openjdk-headless.x86_64 1:1.8.0.262.b10-0.el7_8

	依存性関連をインストールしました:
	avahi-libs.x86_64 0:0.6.31-20.el7                copy-jdk-configs.noarch 0:3.3-10.el7_5         cups-libs.x86_64 1:1.6.3-43.el7
	javapackages-tools.noarch 0:3.4.1-11.el7         libjpeg-turbo.x86_64 0:1.2.90-8.el7            libxslt.x86_64 0:1.1.28-5.0.1.el7
	lksctp-tools.x86_64 0:1.0.17-2.el7               pcsc-lite-libs.x86_64 0:1.8.8-8.el7            python-javapackages.noarch 0:3.4.1-11.el7
	python-lxml.x86_64 0:3.2.1-4.el7                 tzdata-java.noarch 0:2020a-1.el7

	完了しました!

● JAVA Version確認

[opc@swingbench-inst01 ~]$ java -version
	openjdk version "1.8.0_262"
	OpenJDK Runtime Environment (build 1.8.0_262-b10)
	OpenJDK 64-Bit Server VM (build 25.262-b10, mixed mode)

● install the swingbench code

1) swingbench ダウンロード
Swingbench のダウンロード・リンクにある最新の SwingBenchをダウンロードします。
・URL: http://www.dominicgiles.com/downloads.html
downloads.jpg
ダウンロード・リンクの URLを使用してcurl もしくは、wgetでダウンロードできます。
今回は、curlの調子が悪かったので、wgetでダウンロードしています
※ダウンロードリンクはバージョンにより変わることがあります。

・curlコマンド

[opc@swingbench-inst01 ~]$ curl http://www.dominicgiles.com/swingbench/swingbenchlatest.zip -o swingbenchlatest.zip

・wgetコマンド

[opc@swingbench-inst01 ~]$ wget http://www.dominicgiles.com/swingbench/swingbenchlatest.zip
	--2020-08-09 01:39:28--  http://www.dominicgiles.com/swingbench/swingbenchlatest.zip
	www.dominicgiles.com (www.dominicgiles.com) をDNSに問いあわせています... 199.204.248.104
	www.dominicgiles.com (www.dominicgiles.com)|199.204.248.104|:80 に接続しています... 接続しました。
	HTTP による接続要求を送信しました、応答を待っています... 200 OK
	長さ: 29278500 (28M) [application/zip]
	`swingbenchlatest.zip' に保存中

	100%[===========================================================================================================>] 29,278,500  8.89MB/s 時間 3.7s

	2020-08-09 01:39:32 (7.60 MB/s) - `swingbenchlatest.zip' へ保存完了 [29278500/29278500]

	[opc@swingbench-inst01 ~]$ ls -as
	合計 28616
		4 .       4 .bash_logout       4 .bashrc      0 .config      4 swingbench.zip.old
		0 ..      4 .bash_profile      0 .cache       0 .ssh     28596 swingbenchlatest.zip

・swingbenchlatest.zipダウンロード確認

[opc@swingbench-inst01 ~]$ ls -la
	合計 28612
	drwx------. 5 opc  opc      4096  8月  9 01:42 .
	drwxr-xr-x. 3 root root       17  8月  9 01:18 ..
	-rw-r--r--. 1 opc  opc        18 11月 22  2019 .bash_logout
	-rw-r--r--. 1 opc  opc       193 11月 22  2019 .bash_profile
	-rw-r--r--. 1 opc  opc       231 11月 22  2019 .bashrc
	drwxrwxr-x. 3 opc  opc        18  8月  9 01:19 .cache
	drwxrwxr-x. 3 opc  opc        18  8月  9 01:19 .config
	drwx------. 2 opc  opc        29  8月  9 01:18 .ssh
	-rw-rw-r--. 1 opc  opc  29278500  6月  5 20:31 swingbenchlatest.zip

2) swingbench.zip解凍

[opc@swingbench-inst01 ~]$ unzip swingbenchlatest.zip
	Archive:  swingbench.zip
	End-of-central-directory signature not found.  Either this file is not
	a zipfile, or it constitutes one disk of a multi-part archive.  In the
	latter case the central directory and zipfile comment will be found on
	the last disk(s) of this archive.
	unzip:  cannot find zipfile directory in one of swingbench.zip or
			swingbench.zip.zip, and cannot find swingbench.zip.ZIP, period.

3) swingbench.zip解凍確認

[opc@swingbench-inst01 ~]$ ls -la ./swingbench
	合計 52
	drwx------. 12 opc opc 4096  6月  5 20:17 .
	drwx------.  6 opc opc 4096  8月  9 01:44 ..
	-rw-rw-rw-.  1 opc opc 6082  1月  7  2019 README.txt
	drwxr-xr-x.  3 opc opc 4096  6月  5 09:25 bin
	drwxr-xr-x.  2 opc opc 4096  9月  6  2018 configs
	drwxr-xr-x.  2 opc opc 4096  1月 23  2020 launcher
	drwxr-xr-x.  3 opc opc 4096  6月  5 20:17 lib
	drwxr-xr-x.  2 opc opc    6  3月  3  2010 log
	drwxr-xr-x.  3 opc opc   50  6月  5 20:17 source
	drwxr-xr-x.  2 opc opc 8192  6月  5 20:17 sql
	drwxr-xr-x.  2 opc opc   61 11月  7  2018 utils
	drwx------.  3 opc opc 4096  6月  5 09:25 winbin
	drwxr-xr-x.  2 opc opc 4096  3月 30 14:35 wizardconfigs

■ Oracle Clientインストール

swingbenchで、Oracle Databaseへ接続するための Clientをインストール
今回は、oracle-instantclientをインストールします

● Oracle Clientインストールディレクトリ作成

[opc@swingbench-inst01 ~]$ mkdir ~/oracle
[opc@swingbench-inst01 ~]$ cd ~/oracle

● Oracle Instant Client ダウンロード

1) yum list確認
yumでインストールできるoracle-instantclientを確認
今回は、18.3がインストールできますが、最新の19cをインストールしたいのでyumインストールはやめておきます

[opc@swingbench-inst01 ~]$ sudo yum list available | grep oracle-instant
	oracle-instantclient18.3-basic.x86_64 18.3.0.0.0-2      ol7_developer

2) Oracle Instant Client 19c ダウンロードURL確認
最新の19cをダウンロードしたいので、Instant ClientのURLから、最新バージョンのZIPファイルURLをコピーしてwgetでダウンロード

 ・Linux x86-64用Oracle Instant Clientのダウンロード(64ビット)

今回、最バージョン19.6.0.0.0が最新なので、ここにあるzipファイルのURLを使用してwgetします。

3) Instant Client Basicパッケージ(ZIP)ダウンロード

Version 19.6.0.0.0 ダウンロードURL
https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
[opc@swingbench-inst01 ~]$ wget https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
	--2020-08-09 13:47:37--  https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
	download.oracle.com (download.oracle.com) をDNSに問いあわせています... 23.217.124.4
	download.oracle.com (download.oracle.com)|23.217.124.4|:443 に接続しています... 接続しました。
	HTTP による接続要求を送信しました、応答を待っています... 200 OK
	長さ: 75462547 (72M) [application/zip]
	`instantclient-basic-linux.x64-19.6.0.0.0dbru.zip' に保存中

	100%[===========================================================================================================>] 75,462,547   167MB/s 時間 0.4s

	2020-08-09 13:47:37 (167 MB/s) - `instantclient-basic-linux.x64-19.6.0.0.0dbru.zip' へ保存完了 [75462547/75462547]

4) Instant Client SQL*Plusパッケージ(ZIP)ダウンロード

Version 19.6.0.0.0 ダウンロードURL
https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip
[opc@swingbench-inst01 ~]$ wget https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip
	--2020-08-09 13:50:25--  https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip
	download.oracle.com (download.oracle.com) をDNSに問いあわせています... 23.217.124.4
	download.oracle.com (download.oracle.com)|23.217.124.4|:443 に接続しています... 接続しました。
	HTTP による接続要求を送信しました、応答を待っています... 200 OK
	長さ: 910905 (890K) [application/zip]
	`instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip' に保存中

	100%[===========================================================================================================>] 910,905     4.17MB/s 時間 0.2s

	2020-08-09 13:50:25 (4.17 MB/s) - `instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip' へ保存完了 [910905/910905]

5) ダウンロード確認

[opc@swingbench-inst01 oracle]$ ls -la
	合計 74596
	drwxrwxr-x. 2 opc opc     4096  8月  9 13:50 .
	drwx------. 7 opc opc     4096  8月  9 13:50 ..
	-rw-rw-r--. 1 opc opc 75462547  2月 12 17:30 instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
	-rw-rw-r--. 1 opc opc   910905  2月 12 17:30 instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip

● Oracle Instant Client インストール

作成したOracle Clientインストールディレクトリへzip解凍してインストール

1) unzipを解凍

[opc@swingbench-inst01 oracle]$ cd ~/oracle
[opc@swingbench-inst01 oracle]$ unzip instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
[opc@swingbench-inst01 oracle]$ unzip instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip
[opc@swingbench-inst01 oracle]$ ls -la
	合計 74600
	drwxrwxr-x. 3 opc opc     4096  8月  9 13:55 .
	drwx------. 7 opc opc     4096  8月  9 13:50 ..
	-rw-rw-r--. 1 opc opc 75462547  2月 12 17:30 instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
	-rw-rw-r--. 1 opc opc   910905  2月 12 17:30 instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zip
	drwxrwxr-x. 3 opc opc     4096  8月  9 13:55 instantclient_19_6

2) ORACLE環境変数設定
今回は、$HOME/oracle/instantclient_19_6 が ORACLE_HOMEになるので、以下のようにOracle Database用環境変数を設定

[opc@swingbench-inst01 ~]$ vi .bash_profile
	export ORACLE_BASE=$HOME/oracle
	export ORACLE_HOME=$HOME/oracle/instantclient_19_6
	export PATH=$PATH:$ORACLE_HOME
	export LD_LIBRARY_PATH=$ORACLE_HOME
	export NLS_LANG=Japanese_Japan.AL32UTF8
	export ORACLE_SID=tokyodb

3) ORACLE環境変数設定確認

[opc@swingbench-inst01 ~]$ source ~/.bash_profile
[opc@swingbench-inst01 ~]$ env | egrep 'ORA|LANG|PATH' 
	ORACLE_HOME=/home/opc/oracle/instantclient_19_6
	ORACLE_SID=tokyodb
	PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/opc/.local/bin:/home/opc/bin:/home/opc/oracle/instantclient_19_6
	LD_LIBRARY_PATH=/home/opc/oracle/instantclient_19_6
	LANG=ja_JP.UTF-8
	NLS_LANG=Japanese_Japan.AL32UTF8

● sqlplus接続設定

1) tnsnames.ora設定
Oracle Database接続するためのORACLE*NET tnsnames.oraを設定

[oracle@tokyo-db-inst01 ~]$ vi $ORACLE_HOME/network/admin/tnsnames.ora
tokyodbpdb =
	(DESCRIPTION =
		(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.2)(PORT = 1521))
		(CONNECT_DATA =
		(SERVER = DEDICATED)
		(SERVICE_NAME = tokyodbpdb)
		)
	)

2) sqloplus接続確認

[opc@swingbench-inst01 ~]$ sqlplus system/Ora_DB4U@tokyodbpdb

	SQL*Plus: Release 19.0.0.0.0 - Production on 日 8月 9 15:33:31 2020
	Version 19.6.0.0.0

	Copyright (c) 1982, 2019, Oracle.  All rights reserved.

	ERROR:
	ORA-28002: パスワードは、7日以内に期限切れになります。


	最終正常ログイン時間: 日 8月  09 2020 15:22:23 +00:00


	Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
	Version 19.5.0.0.0
	に接続されました。

■ Swingbench設定

Swingbench Installationを参考に設定していきます。
・参考: https://www.dominicgiles.com/swingbench/#installation

● Install workload schema

Swingbench用 soeスキーマ作成を以下oewizardコマンド実行

	./swingbench/bin/oewizard \
	-cs //"DB IPアドレス":1521/"DB Service Name" -dba "sys as sysdba" -dbap "sysユーザーパスワード" \
	-u soe -p "seoユーザーバスワード" -ts ”SOEスキーマ用表領域名” \
	-async_off \
	-scale 4 \
	-hashpart \
	-create \
	-cl \
	-v	

1) oewizardコマンド実行例

[opc@swingbench-inst01 ~]$ ./swingbench/bin/oewizard \
> -cs //10.0.0.2:1521/tokyodbpdb -dba "sys as sysdba" -dbap Ora_DB4U \
> -u soe -p password -ts SOE \
> -async_off \
> -scale 4 \
> -hashpart \
> -create \
> -cl \
> -v
	SwingBenchウイザード
	作者:	Dominic Giles
	バージョン:	2.6.0.1135

	ライトアウトモードで実行中。利用している設定ファイル :../wizardconfigs/oewizard.xml
	Connecting to : jdbc:oracle:thin:@//10.0.0.2:1521/tokyodbpdb
	Connected
	Running script ../sql/soedgcreatetablespace.sql
	Script completed in 0 hour(s) 1 minute(s) 6 second(s) 277 millisecond(s)
	Running script ../sql/soedgcreateuser.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 219 millisecond(s)
	Starting run
	Starting script ../sql/soedgdrop2.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 25 millisecond(s)
	Starting script ../sql/soedgcreatetableshash2.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 218 millisecond(s)
	Starting script ../sql/soedgviews.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 14 millisecond(s)
	Starting script ../sql/soedgsqlset.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 94 millisecond(s)
	Inserting data into table ADDRESSES_8
	Inserting data into table ADDRESSES_5
	Inserting data into table ADDRESSES_7
	Inserting data into table ADDRESSES_1
	Inserting data into table ADDRESSES_2
	Inserting data into table ADDRESSES_6
	Inserting data into table ADDRESSES_4
	Inserting data into table ADDRESSES_3
	Inserting data into table CUSTOMERS_8
	Inserting data into table CUSTOMERS_1
	Inserting data into table CUSTOMERS_5
	Inserting data into table CUSTOMERS_4
	Inserting data into table CUSTOMERS_3
	Inserting data into table CUSTOMERS_2
	Inserting data into table CUSTOMERS_7
	Inserting data into table CUSTOMERS_6
	Inserting data into table ORDER_ITEMS_5004258
	Completed processing table CUSTOMERS_1 in 0:01:33
	Inserting data into table ORDERS_8
	Completed processing table CUSTOMERS_6 in 0:01:37
	Completed processing table CUSTOMERS_7 in 0:01:37
	Inserting data into table ORDER_ITEMS_1429788
	Inserting data into table ORDERS_3
	Completed processing table CUSTOMERS_8 in 0:01:38
	Completed processing table CUSTOMERS_5 in 0:01:38
	Inserting data into table ORDERS_2
	Inserting data into table ORDER_ITEMS_714894
	Completed processing table CUSTOMERS_3 in 0:01:39
	Completed processing table CUSTOMERS_4 in 0:01:40
	Inserting data into table ORDERS_4
	Inserting data into table ORDER_ITEMS_2144682
	Completed processing table CUSTOMERS_2 in 0:01:40
	Completed processing table ADDRESSES_5 in 0:01:55
	Inserting data into table ORDER_ITEMS_3574470
	Inserting data into table ORDERS_6
	Completed processing table ADDRESSES_3 in 0:01:56
	Completed processing table ADDRESSES_1 in 0:01:59
	Inserting data into table ORDER_ITEMS_2859576
	Inserting data into table ORDERS_5
	Completed processing table ADDRESSES_6 in 0:02:00
	Inserting data into table ORDER_ITEMS_4289364
	Inserting data into table ORDERS_7
	Completed processing table ADDRESSES_4 in 0:02:00
	Completed processing table ADDRESSES_2 in 0:02:00
	Inserting data into table ORDER_ITEMS_0
	Inserting data into table ORDERS_1
	Completed processing table ADDRESSES_8 in 0:02:00
	Completed processing table ADDRESSES_7 in 0:02:00
	Completed processing table ORDERS_6 in 0:03:48
	Inserting data into table CARD_DETAILS_8
	Completed processing table ORDERS_3 in 0:04:06
	Inserting data into table CARD_DETAILS_3
	Completed processing table ORDER_ITEMS_3574470 in 0:03:52
	Inserting data into table CARD_DETAILS_1
	Completed processing table ORDER_ITEMS_1429788 in 0:04:12
	Inserting data into table CARD_DETAILS_4
	Completed processing table ORDERS_2 in 0:04:12
	Inserting data into table CARD_DETAILS_2
	Completed processing table ORDERS_8 in 0:04:21
	Inserting data into table CARD_DETAILS_5
	Completed processing table ORDERS_4 in 0:04:14
	Inserting data into table CARD_DETAILS_7
	Completed processing table ORDER_ITEMS_714894 in 0:04:17
	Inserting data into table CARD_DETAILS_6
	Completed processing table ORDERS_7 in 0:03:59
	Inserting data into table LOGON_8
	Completed processing table ORDER_ITEMS_5004258 in 0:04:26
	Inserting data into table LOGON_6
	Completed processing table ORDER_ITEMS_2144682 in 0:04:19
	Inserting data into table LOGON_7
	Completed processing table ORDER_ITEMS_4289364 in 0:04:03
	Inserting data into table LOGON_1
	Completed processing table ORDERS_1 in 0:04:04
	Inserting data into table LOGON_2
	Completed processing table ORDERS_5 in 0:04:05
	Inserting data into table LOGON_3
	Completed processing table ORDER_ITEMS_0 in 0:04:09
	Inserting data into table LOGON_4
	Completed processing table ORDER_ITEMS_2859576 in 0:04:10
	Inserting data into table LOGON_5
	Inserting data into table PRODUCT_INFORMATION
	Inserting data into table INVENTORIES
	Completed processing table CARD_DETAILS_1 in 0:01:23
	Completed processing table CARD_DETAILS_8 in 0:01:28
	Completed processing table PRODUCT_INFORMATION in 0:00:00
	Inserting data into table PRODUCT_DESCRIPTIONS
	Completed processing table PRODUCT_DESCRIPTIONS in 0:00:00
	Inserting data into table WAREHOUSES
	Completed processing table WAREHOUSES in 0:00:00
	Completed processing table CARD_DETAILS_4 in 0:01:24
	Completed processing table CARD_DETAILS_7 in 0:01:23
	Completed processing table CARD_DETAILS_3 in 0:01:34
	Completed processing table CARD_DETAILS_5 in 0:01:30
	Completed processing table INVENTORIES in 0:00:14
	Completed processing table CARD_DETAILS_6 in 0:01:32
	Completed processing table CARD_DETAILS_2 in 0:01:38
	Completed processing table LOGON_1 in 0:01:48
	Completed processing table LOGON_8 in 0:01:56
	Completed processing table LOGON_7 in 0:01:56
	Completed processing table LOGON_3 in 0:01:54
	Completed processing table LOGON_6 in 0:02:00
	Completed processing table LOGON_2 in 0:01:56
	Completed processing table LOGON_4 in 0:01:52
	Connection cache closed
	Starting script ../sql/soedganalyzeschema2.sql
	Script completed in 0 hour(s) 3 minute(s) 32 second(s) 113 millisecond(s)
	Starting script ../sql/soedgconstraints2.sql
	Script completed in 0 hour(s) 0 minute(s) 46 second(s) 364 millisecond(s)
	Starting script ../sql/soedgindexes2.sql
	Script completed in 0 hour(s) 1 minute(s) 46 second(s) 442 millisecond(s)
	Starting script ../sql/soedgsequences2.sql
	Script completed in 0 hour(s) 0 minute(s) 5 second(s) 200 millisecond(s)
	Starting script ../sql/soedgpackage2_header.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 210 millisecond(s)
	Starting script ../sql/soedgpackage2_body.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 181 millisecond(s)
	Starting script ../sql/soedgsetupmetadata.sql
	Script completed in 0 hour(s) 0 minute(s) 0 second(s) 943 millisecond(s)

	============================================
	|           Datagenerator Run Stats        |
	============================================
	Connection Time                        0:00:00.002
	Data Generation Time                   0:08:02.384
	DDL Creation Time                      0:06:11.853
	Total Run Time                         0:14:14.240
	Rows Inserted per sec                      125,937
	Data Generated (MB) per sec                   10.1
	Actual Rows Generated                   60,795,377
	Commits Completed                            3,106
	Batch Updates Completed                    304,039

	Connecting to : jdbc:oracle:thin:@//10.0.0.2:1521/tokyodbpdb
	Connected

	Post Creation Validation Report
	===============================
	The schema appears to have been created successfully.

	Valid Objects
	=============
	Valid Tables : 'ORDERS','ORDER_ITEMS','CUSTOMERS','WAREHOUSES','ORDERENTRY_METADATA','INVENTORIES','PRODUCT_INFORMATION','PRODUCT_DESCRIPTIONS','ADDRESSES','CARD_DETAILS'
	Valid Indexes : 'PRD_DESC_PK','PROD_NAME_IX','PRODUCT_INFORMATION_PK','PROD_SUPPLIER_IX','PROD_CATEGORY_IX','INVENTORY_PK','INV_PRODUCT_IX','INV_WAREHOUSE_IX','ORDER_PK','ORD_SALES_REP_IX','ORD_CUSTOMER_IX','ORD_ORDER_DATE_IX','ORD_WAREHOUSE_IX','ORDER_ITEMS_PK','ITEM_ORDER_IX','ITEM_PRODUCT_IX','WAREHOUSES_PK','WHS_LOCATION_IX','CUSTOMERS_PK','CUST_EMAIL_IX','CUST_ACCOUNT_MANAGER_IX','CUST_FUNC_LOWER_NAME_IX','ADDRESS_PK','ADDRESS_CUST_IX','CARD_DETAILS_PK','CARDDETAILS_CUST_IX'
	Valid Views : 'PRODUCTS','PRODUCT_PRICES'
	Valid Sequences : 'CUSTOMER_SEQ','ORDERS_SEQ','ADDRESS_SEQ','LOGON_SEQ','CARD_DETAILS_SEQ'
	Valid Code : 'ORDERENTRY'
	Schema Created

● 作成された Schema確認

以下コマンドで作成されたSOEスキーマ・オブジェクト数確認

SOEスキーマ・オブジェクト数確認コマンド
	/sbutil -soe -cs //"DB IPアドレス":1521/"DB Service Name” -u soe -p "seoユーザーバスワード" -val

1) SOEスキーマ・オブジェクト数確認コマンド実行

[opc@swingbench-inst01 bin]$ ./sbutil -soe -cs //10.0.0.2:1521/tokyodbpdb -u soe -p Wpassword -val
	The Order Entry Schema appears to be valid.
	--------------------------------------------------
	|Object Type    |     Valid|   Invalid|   Missing|
	--------------------------------------------------
	|Table          |        10|         0|         0|
	|Index          |        26|         0|         0|
	|Sequence       |         5|         0|         0|
	|View           |         2|         0|         0|
	|Code           |         1|         0|         0|
	--------------------------------------------------

● SOEスキーマの統計情報を収集

できたてのSOEスキーマのデータベース・オブジェクトのオプティマイザ統計を収集して、
オプティマイザによって最適ではない問合せの実行計画が選択されないように、統計を最新にします

SOEスキーマの統計情報収集コマンド
	./sbutil -soe -cs //"DB IPアドレス":1521/"DB Service Name” -u soe -p "seoユーザーバスワード" -stats

1) SOEスキーマの統計情報収集コマンド実行

[opc@swingbench-inst01 bin]$ ./sbutil -soe -cs //10.0.0.2:1521/tokyodbpdb -u soe -p password -stats
	Collecting statistics for the schema
	Collected statistics in : 0:02:26.122

● SOEスキーマのテーブル確認

[opc@swingbench-inst01 bin]$ ./sbutil -soe -cs //10.0.0.2:1521/tokyodbpdb -u soe -p password -tables
	Order Entry Schemas Tables
	----------------------------------------------------------------------------------------------------------------------
	|Table Name                  |                Rows|              Blocks|           Size|   Compressed?|  Partitioned?|
	----------------------------------------------------------------------------------------------------------------------
	|ORDER_ITEMS                 |          28,692,931|             238,706|          1.9GB|              |           Yes|
	|ORDERS                      |           5,719,160|              83,096|        669.0MB|              |           Yes|
	|ADDRESSES                   |           6,006,487|              72,134|        573.0MB|              |           Yes|
	|CUSTOMERS                   |           4,006,481|              69,866|        555.0MB|              |           Yes|
	|CARD_DETAILS                |           6,006,481|              44,288|        352.0MB|              |           Yes|
	|LOGON                       |           9,531,936|              36,224|        288.0MB|              |           Yes|
	|INVENTORIES                 |             901,504|              11,123|         88.0MB|      Disabled|            No|
	|PRODUCT_INFORMATION         |               1,000|                 124|         1024KB|      Disabled|            No|
	|WAREHOUSES                  |               1,000|                 124|         1024KB|      Disabled|            No|
	|PRODUCT_DESCRIPTIONS        |               1,000|                 124|         1024KB|      Disabled|            No|
	|ORDERENTRY_METADATA         |                   4|                 124|         1024KB|      Disabled|            No|
	----------------------------------------------------------------------------------------------------------------------
																Total Space           4.3GB

● Workload実行

charbenchコマンドでベンチマークツール実行
実行するとTPS(秒間のトランザクション数)が計られます

Workload実行コマンド
	./charbench -c ../configs/SOE_Server_Side_V2.xml \
	-cs //10.0.0.2:1521/tokyodbpdb -u soe -p password \
	-v users,tpm,tps,vresp \
	-intermin 0 \
	-intermax 0 \
	-min 0 \
	-max 0 \
	-uc 20 \
	-di SQ,WQ,WA \
	-rt 0:0.30	

1) Workload実行例

[opc@swingbench-inst01 bin]$ ./charbench -c ../configs/SOE_Server_Side_V2.xml \
> -cs //10.0.0.2:1521/tokyodbpdb -u soe -p password \
> -v users,tpm,tps,vresp \
> -intermin 0 \
> -intermax 0 \
> -min 0 \
> -max 0 \
> -uc 20 \
> -di SQ,WQ,WA \
> -rt 0:0.30
	Author  :	 Dominic Giles
	Version :	 2.6.0.1135

	Results will be written to results.xml.
	Hit Return to Terminate Run...

	Time     Users       TPM      TPS     NCR   UCD   BP    OP    PO    BO    SQ    WQ    WA
	04:56:27 [0/20]      0        0       0     0     0     0     0     0     0     0     0
	04:56:28 [15/20]     0        0       0     0     0     0     0     0     0     0     0
	04:56:29 [20/20]     166      166     37    4     19    36    18    8     0     0     0
	04:56:30 [20/20]     851      685     29    5     26    51    16    25    0     0     0
	04:56:31 [20/20]     1624     773     31    2     17    40    13    7     0     0     0
	04:56:32 [20/20]     2306     682     31    1     23    67    29    6     0     0     0
	04:56:33 [20/20]     2958     652     25    2     22    54    20    7     0     0     0
	04:56:34 [20/20]     3739     781     10    1     6     53    17    4     0     0     0
	04:56:35 [20/20]     4645     906     8     1     12    54    11    5     0     0     0
	04:56:36 [20/20]     5544     899     24    8     10    45    32    10    0     0     0
	04:56:37 [20/20]     6342     798     17    5     3     51    11    7     0     0     0
	04:56:38 [20/20]     7173     831     12    2     21    63    13    3     0     0     0
	04:56:39 [20/20]     8078     905     8     3     7     20    17    16    0     0     0
	04:56:40 [20/20]     8911     833     14    5     27    45    13    16    0     0     0
	04:56:41 [20/20]     9774     863     23    12    9     21    21    18    0     0     0
	04:56:42 [20/20]     10652    878     20    14    11    69    12    2     0     0     0
	04:56:43 [20/20]     11602    950     4     3     11    57    15    6     0     0     0
	04:56:44 [20/20]     12585    983     13    4     26    14    18    5     0     0     0
	04:56:45 [20/20]     13494    909     6     3     7     58    19    3     0     0     0
	04:56:46 [20/20]     14399    905     13    3     2     50    17    13    0     0     0
	04:56:47 [20/20]     15284    885     16    7     5     54    24    12    0     0     0
	04:56:48 [20/20]     16194    910     5     12    9     48    20    26    0     0     0
	04:56:49 [20/20]     17125    931     7     2     26    33    18    11    0     0     0
	04:56:50 [20/20]     18008    883     19    1     7     30    44    2     0     0     0
	04:56:51 [20/20]     18946    938     13    9     10    67    21    2     0     0     0
	04:56:52 [20/20]     19925    979     20    6     12    41    13    4     0     0     0
	04:56:53 [20/20]     20883    958     19    1     6     53    8     2     0     0     0
	04:56:54 [20/20]     21839    956     16    5     26    49    4     14    0     0     0
	04:56:55 [20/20]     22773    934     17    1     19    33    7     8     0     0     0
	04:56:56 [20/20]     23688    915     5     4     27    28    15    8     0     0     0
	04:56:57 [20/20]     24594    906     14    4     19    67    8     2     0     0     0
	Saved results to results.xml
	04:56:58 [0/20]      24706    112     21    3     24    18    15    19    0     0     0

	Completed Run.

■ GUIでswingbench実行

今回ssh経由で、On-PremisesのMac Bookから、OCIのswingbench-inst01へアクセスしてるので、X window表示できるように、Xquartzで xtermコンソールからsshしてGUI表示させます
Macの X Window Systemで GUI表示は次が参考になります。

1) Xquartz実行Workload実行
Xquartz実行して、xtermターミナルを出力
MAC-HP14.png

2) xtermターミナルでssh実行
00.png

3) swingbenchコマンド実行
今回の環境は、$HOME配下に swingbench をインストールしたので、以下実行すると、GUIが表示されます

[opc@swingbench-inst01 ~]$ ./swingbench/bin/swingbench 

もしくは、あらかじめDB接続文字列と、実行時間を指定するには以下オプション追加して実行

-cs DB接続子
-dt ドライバ種類 : thinはJAVA Thinドライバ使用
-rt 実行時間: 0:05は5分
 ./swingbench -cs //10.0.0.2:1521/tokyodbpdb -dt thin  -rt 0:05
03.png

4) ベンチマーク選択
今回は、SOE_SERVER_SIDE_V2を選択
04.png

5) DB接続設定
左ペインにあるDB接続子、接続ドライバ種類を入力
05.png

6) Workload実行
再生ボタンをクリック
06.png

■ 参考

 ・ Swingbench Downloads...
 ・ Swingbench Documents
 ・ Swingbench Installation
 ・ What's cooking at Oracle – Rob Zoeteweij
 ・ Oracle Instant Client

10
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
4