rem ASM disk performance analysis script by Valter Rehn
rem rem ATTENTION: Prerequisite: You HAVE to have access to a executable named sleep , otherwise it rem won't wait the 60 seconds necessary to get the correct measuring interval. rem Linux/Unix systems normally have it, or you can download GNU tool s for windows also. rem OR you can change it to dbms_lock.sleep if you have privileges. rem rem Jan 11, 2011 - v1.0 - analyses a single-disk in a single-instance rem Jan 11, 2011 - v1.1 - fixed error for zero I/O - thanks to Daniel_E_Santos rem Jan 11, 2011 - v1.21 - now sums values for all disks in a diskgroup, from a ll instances of the DB rem Jan 11, 2011 - v1.22 - removed READTIME_MILLISEC and WRITETIME_MILLISEC fro m results rem Jan 13, 2011 - v1.31 - changed scale (was in fact microseconds) to millisec onds (to be Grid Control compatible) - thanks to Victor_Lessa rem Jan 13, 2011 - v1.32 - added throughput (MB/s) and avg_response_time (these metrics show in Grid Control also) - thanks to Victor_Lessa rem Jan 14, 2011 - v1.4 - defaults to the largest diskgroup in case no diskgrou p is chosen rem Jan 14, 2011 - v1.5 - fixed column formatting to minimize doubts about deci mals rem select NAME,STATE,TYPE,TOTAL_MB,FREE_MB from v$asm_diskgroup asmdg / column thediskgname new_value v_diskgname noprint select name thediskgname from (select name from v$asm_diskgroup order by total_mb desc) where name like upper('%&diskgroupname%') and rownum=1; prompt prompt please allow 1 minute for the data gathering prompt column diskreadsold new_value dskreadsold noprint column diskwriteold new_value dskwriteold noprint column diskrtmold new_value dskrtmold noprint column diskwtmold new_value dskwtmold noprint column byreadold new_value bytereadold noprint column bywritold new_value bytewritold noprint select sum(READ_TIME) diskrtmold, sum(reads) diskreadsold, sum(write_time) diskwtmold, sum(writes) diskwriteold, sum(BYTES_READ/1024/1024) byreadold, sum(BYTES_WRITTEN/1024/1024) bywrito ld from gv$asm_disk where name like '%&v_diskgname%'; host sleep 60 column diskreadsnew new_value dskreadsnew noprint column diskwritenew new_value dskwritenew noprint column diskrtmnew new_value dskrtmnew noprint column diskwtmnew new_value dskwtmnew noprint column byreadnew new_value bytereadnew noprint column bywritnew new_value bytewritnew noprint select sum(READ_TIME) diskrtmnew, sum(reads) diskreadsnew, sum(write_time) diskwtmnew, sum(writes) diskwritenew, sum(BYTES_READ/1024/1024) byreadnew, sum(BYTES_WRITTEN/1024/1024) bywritn ew from gv$asm_disk where name like '%&v_diskgname%'; col "READ_MB/s" for 999999.9 col "WRITE_MB/s" for 999999.9 col READ_AVG_SPEED_MSEC for 999990.000 col WRITE_AVG_SPEED_MSEC for 999990.000 col AVG_RESP_TIME_MSEC for 999990.000 select '&v_diskgname' diskgroup_name, &dskreadsnew-&dskreadsold reads, &dskwritenew-&dskwriteold writes, trunc((&bytereadnew-&bytereadold)/60,1) "READ_MB/s", trunc((&bytewritnew-&bytewritold)/60,1) "WRITE_MB/s", trunc((&dskrtmnew-&dskrtmold)/(decode(&dskreadsnew-&dskreadsold,0,1,&d skreadsnew-&dskreadsold))*10,3) read_avg_speed_msec, trunc((&dskwtmnew-&dskwtmold)/(decode(&dskwritenew-&dskwriteold,0,1,&d skwritenew-&dskwriteold))*10,3) write_avg_speed_msec, trunc(((&dskrtmnew-&dskrtmold)+(&dskwtmnew-&dskwtmold))/((&dskreadsnew-&ds kreadsold)+(&dskwritenew-&dskwriteold))*10,3) avg_resp_time_msec from dual;