运用ASMIOSTAT脚本监控asm disk磁盘性能
1,脚本作用: 类似于OS的iostat检查磁盘的I/O性能,ASMIOSTAT 脚本用来检查ASM磁盘的性能,
2,下载AMSIOSTAT脚本https://files.cnblogs.com/files/guilingyang/asmiostat.zip也可以从博客下面参考的两个地方下载得到该脚本
3,检查参数:
[grid@fff1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Sep 21 10:06:14 2016
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL> show parameter timed_statistics
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
timed_statistics boolean TRUE
4,运用脚本
把脚本放在grid用户下,授予可执行权限,查看帮助信息
[grid@fff1 ~]$ ./asmiostat.sh help=y
Invalid parameter: <interval> must be > 0; <count> must be >= 0
./asmiostat.sh [-s ASM ORACLE_SID] [-h ASM ORACLE_HOME] [-g diskgroup] [<interval>] [<count>]
-s 跟上ASM的ORACLE_SID一般为+ASM,RAC环境一般为+ASM1/+ASM2,查看环境变量确定
-h 跟上ASM的ORACLE_HOME,也就是grid的ORACLE_HOME环境变量
-g跟上磁盘组的名字
interval 间隔时间
count 检查次数
Output:
DiskPath - Path to ASM disk ASM磁盘路径
DiskName - ASM disk name ASM磁盘名
Gr - ASM disk group number
Dsk - ASM disk number
Reads - Reads 指定时间内I/O读请求次数
Writes - Writes 指定时间内I/O写请求次数
AvRdTm - Average read time (in msec) 平均每次I/O读请求所需时间(in msec)
AvWrTm - Average write time (in msec) 平均每次I/O写请求所需时间(in msec)
KBRd - Kilobytes read 指定时间内读操作的量(kb)
KBWr - Kilobytes written 指定时间内写操作的量(kb)
AvRdSz - Average read size (in bytes) 平均每次I/O读请求得到的数据量(b)
AvWrSz - Average write size (in bytes) 平均每次I/O写请求得到的数据量(b)
RdEr - Read errors 指定时间内I/O读请求错误次数
WrEr - Write errors 指定时间内I/O写请求错误次数
[grid@fff1 ~]$ ./asmiostat.sh -s $ORACLE_SID -h $ORACLE_HOME -g DATA1 1 3
Date: Wed Sep 21 10:13:18 CST 2016 Interval: 1 secs Disk Group: DATA1
DiskPath – DiskName Gr Dsk Reads Writes AvRdTm AvWrTm KBRd KBWr AvRdSz AvWrSz RdEr WrEr
/dev/oracleasm/disks/DIS1 - DATA1_0000 1 0 0 1 0.0 3001.0 0 4 0 4096 0 0
/dev/oracleasm/disks/DIS2 - DATA1_0001 1 1 3 0 0.2 0.0 0 0 0 0 0 0
/dev/oracleasm/disks/DIS3 - DATA1_0002 1 2 2 2 0.4 3.1 0 0 0 0 0 0
Date: Wed Sep 21 10:13:19 CST 2016 Interval: 1 secs Disk Group: DATA1
DiskPath - DiskName Gr Dsk Reads Writes AvRdTm AvWrTm KBRd KBWr AvRdSz AvWrSz RdEr WrEr
/dev/oracleasm/disks/DIS1 - DATA1_0000 1 0 0 0 0.0 0.0 0 0 0 0 0 0
/dev/oracleasm/disks/DIS2 - DATA1_0001 1 1 0 0 0.0 0.0 0 0 0 0 0 0
/dev/oracleasm/disks/DIS3 - DATA1_0002 1 2 3 2 0.3 0.3 0 0 0 0 0 0
Date: Wed Sep 21 10:13:20 CST 2016 Interval: 1 secs Disk Group: DATA1
DiskPath - DiskName Gr Dsk Reads Writes AvRdTm AvWrTm KBRd KBWr AvRdSz AvWrSz RdEr WrEr
/dev/oracleasm/disks/DIS1 - DATA1_0000 1 0 0 0 0.0 0.0 0 0 0 0 0 0
/dev/oracleasm/disks/DIS2 - DATA1_0001 1 1 0 0 0.0 0.0 0 0 0 0 0 0
/dev/oracleasm/disks/DIS3 - DATA1_0002 1 2 2 2 0.2 0.3 0 0 0 0 0 0
5,参考
【1】http://www.xifenfei.com/2013/05/%e7%9b%91%e6%8e%a7asm-disk%e7%a3%81%e7%9b%98%e6%80%a7%e8%83%bd.html
【2】ASMIOSTAT Script to collect iostats for ASM disks (Doc ID 437996.1)