测试数据库数据所在硬件写性能的脚本
2015-10-09 18:40
267 查看
思路:连续增加多次大数据文件到某个表空间,根据时间花费计算出每秒的写字节数。如果数据库是RAC架构,存储是SAN架构的话,可以在每个节点都执行该脚本来测试每个节点链路的IO性能。
脚本的输出:
#!/bin/sh ############ByCompard 2015.10.9############## result=0 i=0 for SZ in 8 10 20 30; #for SZ in 2 4; do start_s=$(date +%s) echo begin at `date`,size=${SZ}GB sqlplus -s '/ as sysdba' <<EOF alter tablespace users add datafile '+DATA_DG/dqprd/datafile/user_01_compard.dbf' size ${SZ}g; exit; EOF end_s=$(date +%s) echo end at `date` tcost_s=$(( $end_s - $start_s )) if [ $tcost_s -gt 0 ] ; then ed=`echo "${SZ}*1000/${tcost_s}"|bc` result=`echo "${result}+${ed}"|bc` echo begin_S=${start_s}, end_s=${end_s}, cost_s=${tcost_s}S i=`expr $i + 1` fi sqlplus -s "/ as sysdba" <<! Alter tablespace users drop datafile '+DATA_DG/dqprd/datafile/user_01_compard.dbf'; exit; ! done result=`echo "scale=2;${result}/$i"|bc` echo =================write speed is ${result} MB\/S===================
脚本的输出:
[oracle@compardraca ~]$ . ./testIO.sh begin at Fri Oct 9 18:29:51 CST 2015,size=8GB Tablespace altered. end at Fri Oct 9 18:30:20 CST 2015 begin_S=1444386591, end_s=1444386620, cost_s=29S Tablespace altered. begin at Fri Oct 9 18:30:22 CST 2015,size=10GB Tablespace altered. end at Fri Oct 9 18:30:56 CST 2015 begin_S=1444386622, end_s=1444386656, cost_s=34S Tablespace altered. begin at Fri Oct 9 18:30:58 CST 2015,size=20GB Tablespace altered. end at Fri Oct 9 18:32:04 CST 2015 begin_S=1444386658, end_s=1444386724, cost_s=66S Tablespace altered. begin at Fri Oct 9 18:32:06 CST 2015,size=30GB Tablespace altered. end at Fri Oct 9 18:33:46 CST 2015 begin_S=1444386726, end_s=1444386826, cost_s=100S Tablespace altered. =================write speed is 293.00 MB/S===================
相关文章推荐
- mac下修改mysql的默认字符集为utf8
- QSqlDatabase类 创建db文件
- Memcached 工作原理
- ORACLE LOB 大对象处理
- memcached look status
- mysql忘记ROOT密码怎么办?
- MySQL 二进制文件安装
- ORACLE数据库中如何使用instr语法
- 数据库锁了
- [logstash-input-redis]插件使用详解
- mysql tinyInt1isBit 控制jdbc是否把tinyint(1) 类型当成boolean返回。
- oracle误删表数据以后的还原方法
- 关于Mongodb的全面总结
- MySQL 数据(字段)类型
- mac启动mysql
- mysql创建定时器(event),查看定时器,打开定时器,设置定时器时间
- Redis 缓存 + Spring 的集成示例
- Database 数据库
- 五、oracle 表的管理
- 四、oracle 用户管理二