监控ASM磁盘组IO吞吐量是管理ASM的基础功能,这篇文章讨论通过asmiostat.sh脚本和asmcmd iostat命令监控ASM磁盘组IO吞吐量,它类似于大部分Unix操作系统提供的iostat命令。
一.Oracle 11gR2 Database之前的版本参考如下文章使用asmiostat.sh脚本。
ASMIOSTAT Script to collect iostats for ASM disks (文档 ID 437996.1)
修改时间:2013-2-15类型:SCRIPT
In this Document
Purpose Requirements Configuring Instructions Script Sample OutputAPPLIES TO:
Oracle Database - Enterprise Edition - Version 10.1.0.3 to 11.1.0.7 [Release 10.1 to 11.1]
Information in this document applies to any platform.
***Checked for relevance on 27-Feb-2011***
The OS command iostat is normally used to monitoring system input/output device load. This script will provide similar information like iostat but specific for the ASM disks.
For details about iostat (ie cumulative or not, and so on) please refer to the man of iostat.
We use v$asm_disk_stat instead of v$asm_disk because the information is exactly the same.
The only difference is v$asm_disk_stat is the information available in memory while v$asm_disk access the disks to re-collect some information. Since the information required doesn't require to "re-collect" it from the disks, v$asm_disk_stat is more appropriate here.
On Solaris, please use :
- the /usr/wpg4/bin/grep utility instead of /usr/bin/grep to avoid the following error:
"grep: illegal option -- q"
- the /usr/wpg4/bin/awk utility instead of /usr/bin/awk to avoid the following error:
"awk: syntax error near line 48"
On other platforms, it could sometime fail due to Shell compatibility issues.
In such case, retry using another Shell (ie: Bash instead of Ksh)
We do not guarantee that it will work for you, so be sure to test it in your environment before relying on it. This script is provided as an example. If it doesn't work, you must adapt it by yourself for your platform
In 10.1 asmcmd utility is not included:
asmcmd can be used against ASM versions 10gR1 (10.1.0.n) and 10gR2 (10.2.0.n). In ASM version 10.2 asmcmd is provided by default ASM installation.
To use asmcmd in ASM version 10.1 environment we can just copy relevant files from 10.2 installation into the 10.1
Not required.
INSTRUCTIONSNot required
CAUTIONProofread this sample code before using it! Due to the differences in the way text editors, e-mail packages and operating systems handle text formatting (spaces, tabs and carriage returns), this sample code may not be in an executable state when you first receive it. Check over the sample code to ensure that errors of this type are corrected.
SAMPLE OUTPUT
For every ASM disk, this is the output provided:
DiskName - ASM disk name
Gr - ASM disk group number
Dsk - ASM disk number
Reads - Reads
Writes - Writes
AvRdTm - Average read time (in msec)
AvWrTm - Average write time (in msec)
KBRd - Kilobytes read
KBWr - Kilobytes written
AvRdSz - Average read size (in bytes)
AvWrSz - Average write size (in bytes)
RdEr - Read errors
WrEr - Write errors
Script Output
/dev/asmdisk14 - DATA_0000 2 0 0 4 0.0 5.0 0 16 0 4096 0 0
/dev/asmdisk4 - DATA_0001 2 1 10 0 17.0 0.0 0 0 0 0 0 0
/dev/asmdisk17 - DATA_0002 2 2 0 1 0.0 0.0 0 0 0 512 0 0
/dev/asmdisk5 - DATA_0003 2 3 0 0 0.0 0.0 0 0 0 0 0 0
/dev/asmdisk16 - DATA_0004 2 4 3 3 6.7 3.3 0 0 0 0 0 0
/dev/asmdisk23 - DATA_0005 2 5 0 0 0.0 0.0 0 0 0 0 0 0
The asmiostat.txt output file can be used for .csv and graphical representation by using Doc 1373682.1
到Linux公社资源站下载asmiostat.zip工具。:
------------------------------------------分割线------------------------------------------
免费下载地址在 http://linux.linuxidc.com/
用户名与密码都是www.linuxidc.com
具体下载目录在 /2016年资料/4月/10日/监控ASM磁盘组IO吞吐量/
下载方法见
------------------------------------------分割线------------------------------------------
二.11gR2使用asmcmd工具下的iostat命令。
1.ASMCMD工具iostat命令。
ASMCMD [+] > help iostat
iostat
Displays I/O statistics for Oracle ASM disks in mounted disk groups.
iostat [-et][--io] [--suppressheader] [--region] [-G diskgroup] [interval]
iostat lists disk group statistics using the V$ASM_DISK_IOSTAT view.
The options for the iostat command are described below.
-e - Displays error statistics (Read_Err, Write_Err).
-G diskgroup - Displays statistics for the disk group name.
--suppressheader - Suppresses column headings.
--io - Displays information in number of I/Os, instead
of bytes.
-t - Displays time statistics (Read_Time, Write_Time).
--region - Displays information for cold and hot disk regions
(Cold_Reads, Cold_Writes, Hot_Reads, Hot_Writes).
interval - Refreshes the statistics display based on the
interval value (seconds).
The attribute descriptions for iostat command output are described
below. To view the complete set of statistics for a disk group,
use the V$ASM_DISK_IOSTAT view.
Group_Name Name of the disk group.
Dsk_Name Name of the disk.
Reads Total number of bytes read from the disk.
If the --io option is entered, then the value
is displayed as number of I/Os.
Writes Total number of bytes written from the disk.
If the --io option is entered, then the value
is displayed as number of I/Os.
Cold_Reads Total number of bytes read from the cold disk
region. If the --io option is entered, then
the value is displayed as number of I/Os.
Cold_Writes Total number of bytes written from the cold
disk region. If the --io option is entered,
then the value is displayed as number of I/Os.
Hot_Reads Total number of bytes read from the hot
disk region. If the --io option is entered,
then the value is displayed as number of I/Os.
Hot_Writes Total number of bytes written from the hot disk
region. If the --io option is entered, then the
value is displayed as number of I/Os.
Read_Err Total number of failed I/O read requests for
the disk.
Write_Err Total number of failed I/O write requests for
the disk.
Read_Time Total I/O time (in hundredths of a second) for
read requests for the disk if the
TIMED_STATISTICS initialization parameter is
set to TRUE (0 if set to FALSE).
Write_Time Total I/O time (in hundredths of a second) for
write requests for the disk if the
TIMED_STATISTICS initialization parameter is
set to TRUE (0 if set to FALSE).
The following are examples of the iostat command. The first example
displays disk I/O statistics for the data disk group in total number
of bytes. The second example displays disk I/O statistics for the data
disk group in total number of I/O operations.
2.执行下面的命令,5秒钟显示一次data磁盘组的IO吞吐量,Reads,Writes单位是bytes。
ASMCMD [+] > iostat -G data 5
Group_Name Dsk_Name Reads Writes
DATA DISK1 233472 6602752
DATA DISK2 32768 8192
Group_Name Dsk_Name Reads Writes
DATA DISK1 0.00 1638.40
DATA DISK2 0.00 0.00
Group_Name Dsk_Name Reads Writes
DATA DISK1 0.00 819.20
DATA DISK2 0.00 0.00
Group_Name Dsk_Name Reads Writes
DATA DISK1 0.00 1638.40
DATA DISK2 0.00 0.00
Group_Name Dsk_Name Reads Writes
DATA DISK1 0.00 1638.40
DATA DISK2 0.00 0.00
Group_Name Dsk_Name Reads Writes
DATA DISK1 0.00 819.20
DATA DISK2 0.00 0.00
--end--
如何修改ASM的sys密码
如何将ASM中的数据文件复制到操作系统中
Oracle 11g RAC ASM磁盘全部丢失后的恢复
Oracle 11g从入门到精通 PDF+光盘源代码
RHEL6 ASM方式安装Oracle 11g R2
Oracle 10g 手工创建ASM数据库
Ubuntu 12.04(amd64)安装完Oracle 11gR2后各种问题解决方法
如何修改Oracle 10g ASM的sys密码
: