用orabm测试oracle服务器的TPS值

发表于:2007-9-21 13:58

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:fwj0407    来源:fwj0407的专栏

        还好的是,orabm预先提供windows版本的数据装载程序,在 orabm/bin/windows 目录下就是。
        将orabm拷贝或者FTP到windows平台的机器上,配置好oracle连接,即可装载数据了,如下:

E:\temp>set LOCAL=ccbver

E:\temp>orabmload Warehouse 1

Connected to ORACLE as user: ORABM
using timestamp=20050126103630
TPCC Data Load Started...
Loading Item
.................... 20000
.................... 40000
.................... 60000
.................... 80000
.................... 100000
Item Done.
Loading Warehouse
Loading Stock Wid=1
.................... 20000
.................... 40000
.................... 60000
.................... 80000
.................... 100000
 Stock Done.
Loading District
Loading Customer for DID=1, WID=1
...Customer Done.
Loading Customer for DID=2, WID=1
...Customer Done.
Loading Customer for DID=3, WID=1
...Customer Done.
Loading Customer for DID=4, WID=1
...Customer Done.
Loading Customer for DID=5, WID=1
...Customer Done.
Loading Customer for DID=6, WID=1
...Customer Done.
Loading Customer for DID=7, WID=1
...Customer Done.
Loading Customer for DID=8, WID=1
...Customer Done.
Loading Customer for DID=9, WID=1
...Customer Done.
Loading Customer for DID=10, WID=1
...Customer Done.
Loading Orders for D=1, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=2, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=3, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=4, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=5, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=6, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=7, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=8, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=9, W= 1
. 1000
. 2000
. 3000
Orders Done.
Loading Orders for D=10, W= 1
. 1000
. 2000
. 3000
Orders Done.

...DATA LOADING COMPLETED SUCCESSFULLY

        成功装载数据,需要的时间可能有点长。

(4)建索引、分析表和索引、建压力测试存储过程、将数据装载到cache
        对应于安装进度表中的第4、5、6、7步骤
        这几个步骤都是执行SQL脚本,在oracle服务器上执行即可。
$ cd  install
$ ls
orabm_analyze.sql            orabm_ind.sql                orabm_serverside_stress.sql  orabm_tab_rm.sql
orabm_cache.sql              orabm_query_cache.sql        orabm_tab.sql                orabm_user.sql
$ sqlplus "/ as sysdba" @orabm_ind
SQL*Plus: Release 9.2.0.1.0 - Production on Wed Jan 26 14:32:48 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
With the Partitioning and OLAP options
JServer Release 9.2.0.1.0 - Production
......
$ sqlplus "/ as sysdba" @ orabm_analyze
...........
$ sqlplus "/ as sysdba" @ orabm_serverside_stress
......
$ sqlplus "/ as sysdba" @ orabm_cache
......

        这后面执行的SQL脚本都不会有什么问题,记住步骤顺序即可。

        至此,orabm的安装已经完成了。

3、测试TPS值
        Orabm安装完成以后,就可以开始测试oracle服务器的TPS值了。
        同样的,在本次测试中,由于应用程序没有AIX版本,所以只能在windows平台作为oracle客户端来执行测试程序了。

(1)orabm的原理
        我们先通过作者主页上的一段话来了解一下orabm的原理。

Orabm works by running a user-specified number of database transactions in each of a user-specified number of concurrent database sessions. 
        Orabm通过在用户指定的并发下运行指定数量的事务来测试系统性能.
The transactions are executed by the ORABM_SERVERSIDE_STRESS stored procedure, under the schema ORABM. 
        事务通过执行orabm用户的ORABM_SERVERSIDE_STRESS过程来实现.

For each concurrent session, ORABM_SERVERSIDE_STRESS runs the number of transactions specified on the orabm command line, and returns the transactions per second (TPS) value for that session during the sampling interval on completion. 
        对于每个并发session,ORABM_SERVERSIDE_STRESS运行在orabm命令行指定数量的事务,并返回在完成所有任务的采样间隔内每秒的事务数量.
To ensure that all concurrent sessions are processing transactions during the sampling interval, the TPS value only includes results from the middle 80% of transactions: the first 10% and last 10% are ignored.
        为了保证准确性,TPS值只取中间的80%数据,头尾的10%都将被忽略.

The transactions are loosely based on the TPC-C Order-Status and Stock-Level transactions, using a predefined distribution of transactions. 
        事务是松散的,基于标准的TPC-C测试的订单、库存事务模型,使用预定义的事务分布.
The transaction split, which is based on data returned by the DBMS_RANDOM package, should be:
        事务基于DBMS_RANDOM包的返回值进行分割,应该是:

Stock-Level:Order-by-Customer-Name:Order-by-Customer-Id
50% :30% :20%


The string returned by ORABM_SERVERSIDE_STRESS includes the transaction split during the test, to ensure that the transaction distribution is correct, subject to random fluctuations e.g.:
        为了确保事务分布的正确性,ORABM_SERVERSIDE_STRESS的输出包含事务分割比例,输出结果具有随机波动,例如:

...sl=4042(50.5%) on=2384(29.8%) oi=1573(19.7%)...

Once you have set up the test tables, data, and indexes, you're ready to run orabm. The following command shows orabm running 20000 transactions in a single session against the Oracle database identified by ORACLE_SID in the UNIX environment:
        在成功安装了orabm之后,在UNIX下定义好了ORACLE_SID环境变量之后,我们可以如下运行orabm命令进行测试:

$ orabm 1 20000

This command line runs the same workload against a remote database identified by the Oracle Net alias linxceld1.co.uk from a Windows command box:
        以下是在WINDOWS下远程运行方式:

C:\> orabm 1 20000 linxceld1.co.uk

Note: running against a remote database has little (if any), affect on the transaction throughput, because all processing takes place on the DBMS server.

Execution of a single Orabm session should show a single CPU at close to 100% utilization, provided that all table and index data is present in the Oracle block buffer cache and no other workload is running on the database server. On UNIX or Linux, you can use the “top” command to confirm this, or check that no "db file sequential read" event waits are taking place for the Oracle session using info in the V$SESSION_EVENT view - these indicate waits for physical I/O.

        如果所有的测试表和相关索引都已经Cache到内存中,系统上没有其他任务运行,那么你可以看到单个Orabm Session会使用将近100%的CPU资源.在Linux或者Unix上,可以使用Top来查看CPU使用情况,或者检察数据库中不存在"db file sequential read"等待事件.

Alternatively, if your Oracle DBMS is running on Linux, you can use the gkrellm performance monitor to show that CPU utilization of a single CPU is at ~100% and no physical I/O is taking place. Gkrellm can be downloaded from:

http://web.wt.net/~billw/gkrellm/gkrellm.html

Here's an example of the command line you would use to run 10000 transactions against a local Oracle database for three iterations. In the first iteration, one session runs, in the second iteration two concurrent sessions run, and in the third iteration, six concurrent sessions run:

32/3<123>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号