用root 用户安装:
export CC=cc
export CXX=c++
export CFLAGS="-m64 -I /home/app/oracle/product/12.1.0.2/db_1/rdbms/public"
export CXXFLAGS="$CFLAGS"
export ORACLE_HOME=/home/app/oracle/product/12.1.0.2/db_1
export LD_LIBRARY_PATH=/home/app/oracle/product/12.1.0.2/db_1/lib
yum install m4 autoconf automake libtool -y
./configure --prefix=/usr/local/sysbench --with-oracle --libdir=/home/app/oracle/product/12.1.0.2/db_1/lib --without-mysql
make ORA_LIBS=/home/app/oracle/product/12.1.0.2/db_1/lib/libclntsh.so
make install
echo "export PATH=$PATH:/usr/local/sysbench/bin">>/etc/profile
source /etc/profile
一般语法
prepare :用于文件IO和数据库OLTP测试的数据准备阶段。
run :性能测试阶段
cleanup :移除测试过程中产生的数据
sysbench --test=oltp --oracle-user=lianguser --oracle-password=oracle --oracle-db=LGJDB --db-driver=oracle --oltp-table-size=1000000 --oltp-num-tables=10 prepare
sysbench --test=oltp --oracle-user=lianguser --oracle-password=oracle --oracle-db=LGJDB --db-driver=oracle cleanup
sysbench --num-threads=12 --max-requests=10 --test=oltp --oracle-user=lianguser --oracle-password=oracle --oracle-db=LGJDB --db-driver=oracle --oltp-test-mode=complex --oltp-table-size=1000000 --oltp-num-tables=10 run