Home Database Mysql Tutorial Oracle 11g中的IO Calibrate(IO校准)

Oracle 11g中的IO Calibrate(IO校准)

Jun 07, 2016 pm 04:48 PM

Oracle数据库发展到今天,ldquo;IO为王rdquo;已经是一种发展方向趋势。ExtraData一体机的重要特色之一就是最大程度的发挥IO能力

Oracle数据库发展到今天,“IO为王”已经是一种发展方向趋势。ExtraData一体机的重要特色之一就是最大程度的发挥IO能力、提高IO吞吐量。

相比CPU和内存,IO存储有其特殊性。我们讨论IO,通常成为I/O栈(I/O Stack)。I/O栈设计的对象是一系列关键组件层,包括HBA、Storage Switches、Storage Array和Physical Disks。这些对象共同合力,才能形成系统整体的IO能力。
 
四层关键组件,共同形成“木桶效应”。只要有一个层面存在不足,必然成为IO中的短板。I/O难调,也就是在这个方面。但是对于Oracle而言,我们需要关注的是IO整体性能,也就是整体的效果。
 
Oracle 11g有两个对于性能方面的测试工具,一个就是RAT(Real Application Test),另一个就是IO校准(Calibrate IO)。RAT是一种负载重演组件,当进行系统软硬件升级的时候,我们一个很关注的问题是:此次变化能否提升系统性能、能提升多少,会不会有新的瓶颈。这个在过去是不能实现的,只能够在升级之后通过实践去发现。但是RAT可以捕获实际系统负载情况,将其在新环境下进行重演,并且进行度量比较。IO调教的作用也是IO负载模拟,从而判断出实际真实的系统IO情况。
 
本篇我们就介绍IO校准特性。

 

1、发现IO校准

 

首先聊聊为什么要进行校准。IO是一个多组件共同影响的统一体,多个组件之间大部分情况下是不能够完全如同理想情况下工作的。所以需要进行硬件标准指标和实际情况之间进行校准,来获取准确的IO数据。
 
获取精确IO有什么用途呢?根源还是Oracle自动化和智能化的需要。进入11g之后,Oracle向智能化的步子是在加快的过程。Oracle从CBO开始,进行自动化并行决策的Auto DOP就需要IO校准的信息。
 
 

2、配置IO校准

 

我们进行配置过程,首先选择Oracle 11gR2进行测试。

 

SQL> select * from v$version;

 

BANNER

---------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production

PL/SQL Release 11.2.0.3.0 - Production

CORE 11.2.0.3.0 Production

 

TNS for Linux: Version 11.2.0.3.0 - Production

NLSRTL Version 11.2.0.3.0 - Production

 

11g中有一个视图v$io_calibration_status,记录了系统进行校准过程信息。和统计量不同,,Oracle是不会自动进行IO校准的,而需要DBA手工完成。
 
 

SQL> select * from v$io_calibration_status;

STATUS        CALIBRATION_TIME

------------- --------------------------------------------------------------------------------
 
NOT AVAILABLE

 

注意:进行校准过程,一般需要配置异步IO功能。

 

SQL> show parameter disk_asy

 

NAME                                TYPE        VALUE

------------------------------------ ----------- ------------------------------

disk_asynch_io                      boolean    TRUE

 

 

SQL> 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' or filetype_name='Temp File');

 

NAME                                              ASYNCH_IO

-------------------------------------------------- ---------

+DATA/ora11g/datafile/system.256.825944325        ASYNC_ON

+DATA/ora11g/datafile/system.256.825944325        ASYNC_ON

+DATA/ora11g/datafile/sysaux.257.825944327        ASYNC_ON

+DATA/ora11g/datafile/undotbs1.258.825944329      ASYNC_ON

+DATA/ora11g/datafile/users.259.825944329          ASYNC_ON

+DATA/ora11g/datafile/example.265.825944513        ASYNC_ON

 

6 rows selected

 

IO校准并不是单独的列出功能,而是融入到Oracle的Resource Manager功能包里面。调用IO校准的功能包DBMS_RESOURCE_MANAGER.CALIBRATE_IO,其中两个输入参数,一个是磁盘的个数,另一个是允许的最大IO延迟。这两个参数可以通过咨询运维团队和厂商实现。
 
调用过程如下:

 

 

SQL> set serveroutput on;

SQL> DECLARE

  2    lat INTEGER;

  3    iops INTEGER;

  4    mbps INTEGER;

  5  BEGIN

  6  --DBMS_RESOURCE_MANAGER.CALIBRATE_IO(, ,iops, mbps, lat);
 
  7    DBMS_RESOURCE_MANAGER.CALIBRATE_IO (2, 10, iops, mbps, lat);

  8    DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);

  9    DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);

 10    dbms_output.put_line('max_mbps = ' || mbps);

 11  end;

 12  /

 

max_iops = 111

latency = 8

max_mbps = 62

 

PL/SQL procedure successfully completed

 

Executed in 811.547 seconds

 

这个执行过程执行超过800s,时间不算短。最后计算出测算出的最大iops、延迟和最大mbps(每秒MB)。

在执行过程中,我们查看视图v$io_calibration_status。

 

 

 

SQL> select * from v$io_calibration_status;

 

STATUS        CALIBRATION_TIME

------------- --------------------------------------------------------------------------------
 
IN PROGRESS  14-12月-13 11.20.20.120 上午

 

 

此时的状态,从Not Available变为Ready。在校准过程中,Oracle会形成对存储的大量IO读写操作。我们借助Linux下的sar命令,监控全部过程。
 
 

 

[root@SimpleLinux ~]# sar -b 5 100 -o /tmp/res2

Linux 2.6.18-128.el5 (SimpleLinux.localdomain)  12/13/2013

 

11:25:08 AM      tps      rtps      wtps  bread/s  bwrtn/s

11:25:13 AM      8.33      0.00      8.33      0.00    134.92

11:25:18 AM    23.02      1.59    21.43    50.79    311.90

11:25:23 AM      5.96      1.59      4.37    50.89    85.88

11:25:28 AM      7.14      1.59      5.56    50.79    89.68

11:25:33 AM      2.78      0.00      2.78      0.00    44.44

11:25:38 AM      5.96      1.59      4.37    50.89    85.88

11:25:43 AM    257.65    253.28      4.37  4141.55    76.34

11:25:48 AM    281.75    276.19      5.56  4415.87    219.05

11:25:53 AM    278.33    273.56      4.77  4427.83    89.07

11:25:58 AM    289.50    266.53    22.97  4264.55    237.62

11:26:03 AM    232.14    228.97      3.17  3688.89    50.79

11:26:08 AM    268.53    264.14      4.38  4608.76    92.43

 

 

注意TPS的变化过程。启动校准之后,Oracle生成大量的IO操作,来判断存储的极限。这个过程也就是让我们了解当前IO架构的上限。

我们通过Excel画出全过程的TPS、RTPS和WTPS趋势。

结束IO校准之后,我们可以查看到IO调教过程信息。

 

 

SQL> select * from v$io_calibration_status;

 

STATUS        CALIBRATION_TIME

------------- --------------------------------------------------------------------------------
 
READY        14-12月-13 11.39.10.194 上午

更多详情见请继续阅读下一页的精彩内容:

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you drop a table in MySQL using the DROP TABLE statement? How do you drop a table in MySQL using the DROP TABLE statement? Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you create indexes on JSON columns? How do you create indexes on JSON columns? Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do you represent relationships using foreign keys? How do you represent relationships using foreign keys? Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

Explain InnoDB Full-Text Search capabilities. Explain InnoDB Full-Text Search capabilities. Apr 02, 2025 pm 06:09 PM

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.

See all articles