原文鏈接:
http://www.eygle.com/special/Use.Orastress.2.Test.Oracle.db.htm
Orastress!的作者是Geoff Ingram,也就是我們前面介紹的orabm的作者,他曾經為Oracle工作數年,是High Performance Oracle" (ISBN: 0471224367)一書的作者.
該書現在你可以在本站下載.
關于該工具的官方網頁在這里可以找到:
http://www.linxcel.co.uk/orabm/index.Html
Orastress!你可以在原網站下載,或選擇本地下載.
該工具不是開源的,缺省的只能使用一個session測試,你可以從作者那里申請臨時Key,通過以下頁面我們可以獲得7天的無功能限制使用版:
http://www.linxcel.co.uk/7505/10218_trialkey_orastress!.html
Orastress!需要在windows上運行,你需要安裝Oracle客戶端.
收到Key以后,注冊方式如下:
C:/orabm>orastress!
Serial: D5F8-C0A0
After receiving the key, install as follows by entering the Name and Key into the dialog box that displays when you run:
C:/orabm>orastress! register
Orastress!需要的數據和orabm類似,你可以參考Orabm的安裝方式.
具體安裝步驟如下:
#
Operation
Command
1
create the ORABM user (assumes TOOLS tablespace, TEMP temporary tablespace)
sqlplus system/pwd @orabm_user
2
create the tables
sqlplus system/pwd @orabm_tab
3
load the data
$ orabmload Warehouses n
4
create the indexes
sqlplus system/pwd @orabm_ind
5
analyze the tables and indexes
sqlplus system/pwd @orabm_analyze
6
Ensure ORABM can run the DBMS_LOCK package
As SYS run:
GRANT EXECUTE ON DBMS_LOCK TO ORABM
注重:這里構建的假如是10個Warehouses的數據,那么大約需要1G的空間.
這里我建議對單節點數據庫分別采用1,2,3,5,10個Warehouses進行1,2,4,6,10個并發的50000個事務的測試.
對于多節點RAC建議采用1,2,3,5,10個Warehouses進行1,3,4,7,10個并發的50000個事務的測試.
這一部分安裝日志可以參考:安裝日志
得到測試數據以后,還需要運行如下腳本:
sqlplus orabm/orabm@<your-TNS-alias> @orastress_tab.sql
sqlplus orabm/orabm@<your-TNS-alias> @orastress.plh
sqlplus orabm/orabm@<your-TNS-alias> @orastress.plb
日志參考:windows日志
命令行執行方式如下:
orastress! –s sess-iterations-list –t transacts-per-sess –c tns-alias-list –m mode [ -s batchsize]
這里需要如下參數:
-s 指定session數量
-t 指定每個session執行的事物數量.
-c 指定聯結串
-m 指定運行模式.包括Read OLTP INS DIO
-s 指定對于INS或DIO模式下提交批量,缺省是10000里
Note: 假如 Orastress! 對單個Warehouse運行在read模式,那么代碼執行和orabm相同.
對于四種運行模式說明如下:
READ:Runs the identical read-only workload as Orabm to stress CPU and memory.
OLTP:Uses all five TPC-C transactions: New-Order, Order-Status, Payment, Stock-Level and Delivery, in order to generate a mixed-transaction (SQL INSERT/UPDATE/DELETE) OLTP workload which stresses CPU, memory, and I/O.
INS:Runs an I/O intensive SQL INSERT workload by copying rows into the ITEM_INS table from the TPC-C ITEM table.
DIO:Runs an I/O intensive direct-path INSERT workload by copying rows into the ITEM_DIO table from the TPC-C ITEM table.
以下是一些運行舉例:
Example 1:
orastress!
–s 1 –t 50000 –c inst1.world –m oltp
Run one iteration - comPRising 50000 transactions in 1 session - against inst1.world.
進行一組測試,通過一個session,包含50000個事務,對inst1.world數據庫進行測試.
Example 2:
orastress! –s 2 –t 50000 –c inst1.world,inst2.world –m oltp
Run one iteration comprising 2 concurrent sessions of 50000 transactions on each of inst1.world,inst2.world giving a total of 4 concurrent sessions.The location of the instances specified by inst1.world,inst2.world is entirely down to the user. They could be:
運行一組測試,對兩個數據庫(inst1.world,inst2.world)各發出兩個并發session,每個session運行50000個事務,這兩個數據庫可以是:
·2 instances of a RAC cluster
·different non RAC instances on the same server
·different non RAC instances on different servers (e.g. one on linux, one on Solaris)
Example 3:
orastress! –s 1,2,4 –t 50000 –c inst1,inst2,inst3,inst4 –m read
Run 3 iterations each of 50000 transactions on each of four instances: inst1, inst2, inst3 and inst4, where the number of concurrent sessions in each iteration is:
運行3組測試,分別以1,2,4個并發session對四個實例,各執行50000個事務:
1st iteration: 1 concurrent session on each instance, giving 4 sessions total
2nd iteration: 2 concurrent sessions on each instance, giving 8 sessions total
3rd iteration: 4 concurrent sessions on each instance, giving 16 sessions
Results Output--輸出結果:
Output is very similar to Orabm, showing the transactions per second for each session in each iteration and the transaction split between the five TPC-C transactions for OLTP mode:
輸出結果和orabm非常類似,具體參考:
http://www.eygle.com/special/Use.orabm.2.Test.System.CPU.htm
---begin mode=oltp sess=1 txn=5000 TNS=l Fri Sep 19 22:11:06 2003
LXD1.WORLD #1 w=3 txn(all)=5000 xn(sam)=3999 t(sam)=431 tps=92.8 end=190903-12:25:39
---end - Fri Sep 19 22:20:19 2003
在這里簡單說明一下:
對于Benchmark測試來說,最重要的是標準,假如大家有統一的模型及標準,那么測試數據也就有了意義,否則以不同的并發、數據進行各不相同的測試是不具有太大意義的.
標準、比較、參考,這對于測試來說是最重要的.
這里有一篇文章可供參考:
性能測試指標介紹
以下給出我的一些測試數據:
1.10個Warehouse的測試數據
E:/OraDoc/ORACLE~4/BENCHM~1/ORASTR~1>"orastress!.exe" -s 1 -t 300 -c hsbill -m oltp---begin mode=oltp sess=1 txn=300 TNS=hsbill Thu Sep 30 10:35:09 2004HSBILL.HURRAY.COM.CN#1 w=3 txn(all)=300 xn(sam)=239 t(sam)=120 tps=2 d=13(5.4%) n=102(42.7%) o=6(2.5%) p=112(46.9%) s=6(2.5%) end=300904-10:34:38---end - Thu Sep 30 10:37:39 2004E:/OraDoc/ORACLE~4/BENCHM~1/ORASTR~1>"orastress!.exe" -s 2 -t 300 -c hsbill -m oltp---begin mode=oltp sess=2 txn=300 TNS=hsbill Thu Sep 30 10:41:40 2004HSBILL.HURRAY.COM.CN#1 w=4 txn(all)=300 xn(sam)=239 t(sam)=469 tps=.5 d=12(5%) n=103(43.1%) o=13(5.4%) p=101(42.3%) s=10(4.2%) end=300904-10:47:25HSBILL.HURRAY.COM.CN#1 w=4 txn(all)=300 xn(sam)=239 t(sam)=314 tps=.8 d=11(4.6%) n=92(38.5%) o=10(4.2%) p=119(49.8%) s=7(2.9%) end=300904-10:47:51---end - Thu Sep 30 10:50:51 2004E:/OraDoc/ORACLE~4/BENCHM~1/ORASTR~1>"orastress!
.exe" -s 2 -t 3000 -c hsbill -m oltp---begin mode=oltp sess=2 txn=3000 TNS=hsbill Thu Sep 30 11:26:02 2004HSBILL.HURRAY.COM.CN#1 w=8 txn(all)=3000 xn(sam)=2399 t(sam)=4991 tps=.5 d=109(4.5%) n=1016(42.4%) o=116(4.8%) p=1050(43.8%) s=108(4.5%) end=300904-13:09:23HSBILL.HURRAY.COM.CN#1 w=4 txn(all)=3000 xn(sam)=2399 t(sam)=5432 tps=.4 d=87(3.6%) n=997(41.6%) o=128(5.3%) p=1070(44.6%) s=117(4.9%) end=300904-13:13:50---end - Thu Sep 30 13:16:51 2004
2.5個warehouse的測試數據
E:/OraDoc/ORACLE~4/BENCHM~1/ORASTR~1>"orastress!.exe" -s 2 -t 300 -c hsbill -m oltp---begin mode=oltp sess=2 txn=300 TNS=hsbill Thu Sep 30 15:48:20 2004HSBILL.HURRAY.COM.CN#1 w=2 txn(all)=300 xn(sam)=239 t(sam)=13 tps=18.4 d=7(2.9%) n=97(40.6%) o=9(3.8%) p=119(49.8%) s=7(2.9%) end=300904-15:45:40HSBILL.HURRAY.COM.CN#1 w=5 txn(all)=300 xn(sam)=239 t(sam)=19 tps=12.6 d=7(2.9%) n=97(40.6%) o=11(4.6%) p=112(46.9%) s=12(5%) end=300904-15:45:47---end - Thu Sep 30 15:48:47 2004