原文鏈接:
http://www.eygle.com/special/Use.Orastress.2.Test.Oracle.db.htm
Orastress!的作者是Geoff Ingram,也就是我們前面介紹的orabm的作者,他曾經(jīng)為Oracle工作數(shù)年,是High Performance Oracle" (ISBN: 0471224367)一書的作者.
該書現(xiàn)在你可以在本站下載.
關(guān)于該工具的官方網(wǎng)頁在這里可以找到:
http://www.linxcel.co.uk/orabm/index.Html
Orastress!你可以在原網(wǎng)站下載,或選擇本地下載.
該工具不是開源的,缺省的只能使用一個(gè)session測試,你可以從作者那里申請(qǐng)臨時(shí)Key,通過以下頁面我們可以獲得7天的無功能限制使用版:
http://www.linxcel.co.uk/7505/10218_trialkey_orastress!.html
Orastress!需要在windows上運(yùn)行,你需要安裝Oracle客戶端.
收到Key以后,注冊(cè)方式如下:
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!需要的數(shù)據(jù)和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
注重:這里構(gòu)建的假如是10個(gè)Warehouses的數(shù)據(jù),那么大約需要1G的空間.
這里我建議對(duì)單節(jié)點(diǎn)數(shù)據(jù)庫分別采用1,2,3,5,10個(gè)Warehouses進(jìn)行1,2,4,6,10個(gè)并發(fā)的50000個(gè)事務(wù)的測試.
對(duì)于多節(jié)點(diǎn)RAC建議采用1,2,3,5,10個(gè)Warehouses進(jìn)行1,3,4,7,10個(gè)并發(fā)的50000個(gè)事務(wù)的測試.
這一部分安裝日志可以參考:安裝日志
得到測試數(shù)據(jù)以后,還需要運(yùn)行如下腳本:
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日志
命令行執(zhí)行方式如下:
orastress! –s sess-iterations-list –t transacts-per-sess –c tns-alias-list –m mode [ -s batchsize]
這里需要如下參數(shù):
-s 指定session數(shù)量
-t 指定每個(gè)session執(zhí)行的事物數(shù)量.
-c 指定聯(lián)結(jié)串
-m 指定運(yùn)行模式.包括Read OLTP INS DIO
-s 指定對(duì)于INS或DIO模式下提交批量,缺省是10000里
Note: 假如 Orastress! 對(duì)單個(gè)Warehouse運(yùn)行在read模式,那么代碼執(zhí)行和orabm相同.
對(duì)于四種運(yùn)行模式說明如下:
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.
以下是一些運(yùn)行舉例:
Example 1:
orastress!
–s 1 –t 50000 –c inst1.world –m oltp
Run one iteration - comPRising 50000 transactions in 1 session - against inst1.world.
進(jìn)行一組測試,通過一個(gè)session,包含50000個(gè)事務(wù),對(duì)inst1.world數(shù)據(jù)庫進(jìn)行測試.
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:
運(yùn)行一組測試,對(duì)兩個(gè)數(shù)據(jù)庫(inst1.world,inst2.world)各發(fā)出兩個(gè)并發(fā)session,每個(gè)session運(yùn)行50000個(gè)事務(wù),這兩個(gè)數(shù)據(jù)庫可以是:
·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:
運(yùn)行3組測試,分別以1,2,4個(gè)并發(fā)session對(duì)四個(gè)實(shí)例,各執(zhí)行50000個(gè)事務(wù):
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--輸出結(jié)果:
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:
輸出結(jié)果和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
在這里簡單說明一下:
對(duì)于Benchmark測試來說,最重要的是標(biāo)準(zhǔn),假如大家有統(tǒng)一的模型及標(biāo)準(zhǔn),那么測試數(shù)據(jù)也就有了意義,否則以不同的并發(fā)、數(shù)據(jù)進(jìn)行各不相同的測試是不具有太大意義的.
標(biāo)準(zhǔn)、比較、參考,這對(duì)于測試來說是最重要的.
這里有一篇文章可供參考:
性能測試指標(biāo)介紹
以下給出我的一些測試數(shù)據(jù):
1.10個(gè)Warehouse的測試數(shù)據(jù)
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個(gè)warehouse的測試數(shù)據(jù)
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