oracle压力测试之orastress!

<p>
<span style="font-size: x-small;">orastress主要测试数据库的压力。它可以测试数据库的CPU或者内存的压力(以只读方式),也可以使用包括普通INSERT和直接路径INSERT两种方式测试数据库的I/O能力。<br>
orastress只能运行在windows下,但它也可以测试远程服务器的压力。</span></p>
<p><span style="font-size: x-small;">1、下载<br>
下载地址是</span>
<a href="http://www.linxcel.co.uk/orabm/orastress.zip"><span style="font-size: x-small;">http://www.linxcel.co.uk/orabm/orastress.zip</span>
</a>
</p>
<p><span style="font-size: x-small;">2、安装<br>
orastress!使用的用户和数据和orabm类似,它的安装方法和orabm也类似。</span>
</p>
<p><span style="font-size: x-small;">1) 扩充表空间<br>
orastress!使用orabm用户作为测试用户,orabm用户默认使用tools表空间作为默认表空间,在本测试中要导入10个Warehouses的数据,数据库大概在1G左右,所以,要保证orabm所用的表空间大于1G<br>
SQL> alter database datafile 'E:ORACLEORADATAORACLE9ITOOLS01.DBF' resize 1500m; <br>
2) 删除orabm用户<br>
如果你的数据库没有orabm用户,则跳过这步<br>
DROP USER ORABM CASCADE;<br>
3) 创建用户<br>
sqlplus system/pwd @orabm_user<br>
远程数据库使用:<br>
sqlplus </span>
<a href="mailto:system/pwd@tnsname"><span style="font-size: x-small;">system/pwd@tnsname</span>
</a>
<span style="font-size: x-small;"> @orabm_user<br>
4) 创建表<br>
sqlplus system/pwd @orabm_tab<br>
远程数据库使用:<br>
sqlplus </span>
<a href="mailto:system/pwd@tnsname"><span style="font-size: x-small;">system/pwd@tnsname</span>
</a>
<span style="font-size: x-small;"> @orabm_tab<br>
5) 装载数据<br>
orabmload Warehouses 10<br>
这里装载10个warehouses的数据进行测试。数据量大概在1G左右,执行时间估计在15分钟左右。<br>
如果是远程数据库,则先<br>
set LOCAL=tnsname<br>
然后再执行orabmload<br>
6) 创建索引<br>
sqlplus system/pwd @orabm_ind<br>
远程数据库使用:<br>
sqlplus </span>
<a href="mailto:system/pwd@tnsname"><span style="font-size: x-small;">system/pwd@tnsname</span>
</a>
<span style="font-size: x-small;"> @orabm_ind<br>
7) 分析表和索引<br>
sqlplus system/pwd @orabm_analyze<br>
远程数据库使用:<br>
sqlplus </span>
<a href="mailto:system/pwd@tnsname"><span style="font-size: x-small;">system/pwd@tnsname</span>
</a>
<span style="font-size: x-small;"> @orabm_analyze<br>
8) 授权<br>
连接到目标服务器,以sys执行<br>
GRANT EXECUTE ON DBMS_LOCK TO ORABM <br>
9) 创建压力测试插入记录所用的表 <br>
sqlplus orabm/orabm @orastress_tab.sql<br>
远程数据库使用:<br>
sqlplus </span>
<a href="mailto:orabm/orabm@tnsname"><span style="font-size: x-small;">orabm/orabm@tnsname</span>
</a>
<span style="font-size: x-small;"> @orastress_tab.sql<br>
10) 创建orastress!用到的包和存储过程<br>
创建包:<br>
sqlplus orabm/orabm @orastress.plh<br>
创建包体:<br>
sqlplus orabm/orabm @orastress.plb<br>
远程数据库使用:<br>
sqlplus </span>
<a href="mailto:orabm/orabm@tnsname"><span style="font-size: x-small;">orabm/orabm@tnsname</span>
</a>
<span style="font-size: x-small;"> @orastress.plh<br>
sqlplus </span>
<a href="mailto:orabm/orabm@tnsname"><span style="font-size: x-small;">orabm/orabm@tnsname</span>
</a>
<span style="font-size: x-small;"> @orastress.plb<br>
11) 申请注册码<br>
经过以上步骤,在oracle的测试环境基本搭建完成,可以使用orastress!开始测试了。但orastress!是共享软件,没有注册只能使用1个并发测试数据库,我们可以申请一个有效期为20天的、功能无限制的试用注册码。<br>
申请注册码的步骤是:<br>
首先运行<br>
D:programeroracle tools压力orastress>"orastress!.exe"<br>
Serial: 1274-0B71<br>
Licensed to: DEFAULT<br>
Evaluation version: 1 session only per database<br>
得到的1274-0B71就是序列号(不同的机器有不同的序列号)<br>
然后登录</span>
<a href="http://www.linxcel.co.uk/software_orastress_key.html"><span style="font-size: x-small;">http://www.linxcel.co.uk/software_orastress_key.html</span>
</a>
<br><span style="font-size: x-small;">输入相关信息,邮件地址一定要正确填写,并在最后一个输入框中输入序列号,提交后如果审核通过的话能拿到一个注册码</span>
</p>
<p><span style="font-size: x-small;">拿到注册码后运行<br>
D:programeroracle tools压力orastress>"orastress!.exe" register<br>
在弹出的对话框中填入注册信息即可。</span>
</p>
<p><span style="font-size: x-small;">很可惜,到目前位置我还没有能拿到key。</span>
</p>
<p><span style="font-size: x-small;">3、使用<br>
orastress!可以运行在4种模式下:<br>
READ :只读,测试CPU和内存。如果只测试单个实例,效果和orabm一样<br>
OLTP :模拟在线事务交易系统测试<br>
INS :测试普通insert的I/O压力<br>
DIO :测试直接路径insert的I/O压力</span>
</p>
<p><span style="font-size: x-small;">orastress!的使用方式是:<br>
orastress! –s sess-iterations-list –t transacts-per-sess –c tns-alias-list –m mode [ -s batchsize]<br>
其中:<br>
sess-iterations-list:并发的个数。如果要测试多种数量的并发数,则多种数量之间用都好分割<br>
transacts-per-sess:每个并发执行的事务数<br>
tns-alias-list:被测试的实例列表。如果要测试多个实例,则各个实例用逗号分割。<br>
mode:运行模式。参看上文。<br>
batchsize:可选。在IDS和DIO模式下用到。默认值是1000。在IDS和DIO模式下,插入的记录数达到batchsize就会提交一次。</span>
</p>
<p><br><span style="font-size: x-small;">建议对单节点数据库分别采用1,2,3,5,10个Warehouses进行1,2,4,6,10个并发的50000个事务的测试.<br>
对于多节点RAC建议采用1,2,3,5,10个Warehouses进行1,3,4,7,10个并发的50000个事务的测试.</span>
</p>
<p><br><span style="font-size: x-small;">下面的一些运行举例</span>
</p>
<p><span style="font-size: x-small;">Example 1:</span>
</p>
<p><span style="font-size: x-small;">orastress! –s 1 –t 50000 –c inst1.world –m oltp</span>
</p>
<p><span style="font-size: x-small;">Run one iteration - comprising 50000 transactions in 1 session - against inst1.world.<br>
进行一组测试,通过一个session,包含50000个事务,对inst1.world数据库进行测试.</span>
</p>
<p><span style="font-size: x-small;">Example 2:</span>
</p>
<p><span style="font-size: x-small;">orastress! –s 2 –t 50000 –c inst1.world,inst2.world –m oltp</span>
</p>
<p><span style="font-size: x-small;">运行一组测试,对两个数据库(inst1.world,inst2.world)各发出两个并发session,每个session运行50000个事务,这两个数据库可以是:<br>
. 同一个rac的两个实例<br>
. 同一个服务器上不同的实例(非rac)<br>
. 不同服务器上的不同实例(非rac)</span>
</p>
<p><span style="font-size: x-small;">Example 3:</span>
</p>
<p><span style="font-size: x-small;">orastress! –s 1,2,4 –t 50000 –c inst1,inst2,inst3,inst4 –m read<br>
运行3组测试,分别以1,2,4个并发session对四个实例,各执行50000个事务:</span>
</p>
<p><span style="font-size: x-small;">Orastress!的输出结果和orabm类似。</span>
</p>
<p><span style="font-size: x-small;">D:programeroracle tools压力orastress>"orastress!.exe" -s 1 -t 100 -c oracle9<br>
i -m oltp<br>
Evaluation version: 1 session only per database<br>
---begin mode=oltp sess=1 txn=100 TNS=oracle9i Thu Sep 21 17:59:06 2006<br>
oracle9i#1 w=9 txn(all)=100 xn(sam)=79 t(sam)=12 tps=6.6 d=2(2.5%) n=34(43%) o=8<br>
(10.1%) p=33(41.8%) s=2(2.5%) end=210906-17:59:22<br>
---end - Thu Sep 21 17:59:22 2006</span>
</p>
<p><span style="font-size: x-small;">D:programeroracle tools压力orastress>"orastress!.exe" -s 1 -t 1000 -c oracle<br>
9i -m oltp<br>
Evaluation version: 1 session only per database<br>
---begin mode=oltp sess=1 txn=1000 TNS=oracle9i Fri Sep 22 10:07:49 2006<br>
oracle9i#1 w=2 txn(all)=1000 xn(sam)=799 t(sam)=65 tps=12.3 d=40(5%) n=304(38%)<br>
o=39(4.9%) p=385(48.2%) s=31(3.9%) end=220906-10:09:27<br>
---end - Fri Sep 22 10:09:27 2006</span>
</p>
<p><span style="font-size: x-small;">这个测试比较缓慢,大家在测试的时候要给点耐性。</span>
</p>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值