首页 > 数据库 > Oracle > 除了orion,我们还有什么办法测试IO?
一直以来,都是用DD或者ORION来测试I/O 的mps或iops,但是,DD不准,Orion用起来有比较麻烦。好在,Oracle也意识到了这个问题,在Oracle 11g中提供了一个程序包,来对IO系统进行简单的测试,这个程序包就是:
DBMS_RESOURCE_MANAGER.CALIBRATE_IO
先来看看使用条件:
1。用户必须具有SYSDBA权限
2。timed_statistics必须设置为TRUE3。必须打开异步IO,当使用文件系统时,可以设置FILESYSTEMIO_OPTIONS=SETALL,可以通过如下SQL查询是否启用了异步IO
COL NAME FORMAT A50
SELECT NAME,ASYNCH_IO FROM V$DATAFILE F,V$IOSTAT_FILE I WHERE F.FILE#=I.FILE_NO AND FILETYPE_NAME='Data File';
4。一个实例只运行一个CALIBRATE_IO程序
方法:
SET SERVEROUTPUT ON
DECLARE
lat INTEGER;
iops INTEGER;
mbps INTEGER;
BEGIN
-- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (, , iops, mbps, lat);
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 10, iops, mbps, lat);
DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
dbms_output.put_line('max_mbps = ' || mbps);
end;
/
还有,几个注意事项:
Only run one calibration at a time on databases that use the same storage subsystem. If you simultaneously run the calibration across separate databases that use the same storage subsystem, the calibration will fail.
Quiesce the database to minimize I/O on the instance.
For Oracle Real Application Clusters (Oracle RAC) configurations, ensure that all instances are opened to calibrate the storage subsystem across nodes.
For an Oracle Real Application Clusters (Oracle RAC) database, the workload is simultaneously generated from all instances.
The num_physical_disks input parameter is optional. By setting the num_physical_disks
parameter to the approximate number of physical disks in the database's
storage system, the calibration can be faster and more accurate.
In some cases, asynchronous I/O is permitted for data files, but the I/O subsystem for submitting asynchronous I/O may be maximized, and I/O calibration cannot continue. In such cases, refer to the port-specific documentation for information about checking the maximum limit for asynchronous I/O on the system.
下面,看看具体的使用例子:
[@more@]SQL*Plus: Release 11.2.0.1.0 Production on 星期一 10月 25 09:56:05 2010
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SUNDOG315>conn / as sysdba
已连接。
SUNDOG315>show parameter timed
NAME TYPE
------------------------------------ --------------------------------
VALUE
------------------------------
timed_os_statistics integer
0
timed_statistics boolean
TRUE
SUNDOG315>col name format a50
SUNDOG315>select name,asynch_io from v$datafile f,v$iostat_file i
2 where f.file#=i.file_no
3 and filetype_name='Data File';
NAME ASYNCH_IO
-------------------------------------------------- ---------
C:ORACLEAPPADMINISTRATORORADATATESTSYSTEM01. ASYNC_ON
DBF
C:ORACLEAPPADMINISTRATORORADATATESTSYSAUX01. ASYNC_ON
DBF
C:ORACLEAPPADMINISTRATORORADATATESTUNDOTBS01 ASYNC_ON
.DBF
C:ORACLEAPPADMINISTRATORORADATATESTUSERS01.D ASYNC_ON
BF
NAME ASYNCH_IO
-------------------------------------------------- ---------
SUNDOG315>set serveroutput on
SUNDOG315>DECLARE
2 lat INTEGER;
3 iops INTEGER;
4 mbps INTEGER;
5 BEGIN
6 -- DBMS_RESOURCE_MANAGER.CALIBRATE_IO (
7 DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 10, iops, mbps, lat);
8
9 DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
10 DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
11 dbms_output.put_line('max_mbps = ' || mbps);
12 end;
13 /
max_iops = 77
latency = 12
max_mbps = 43
PL/SQL 过程已成功完成。
SUNDOG315>
具体请参见官方文档:http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/iodesign.htm#CHDFBGFB
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/19423/viewspace-1040357/ ,如需转载,请注明出处,否则将追究法律责任。