search
HomeDatabaseMysql TutorialOracle 11g中的IO Calibrate(IO校准)

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
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
Explain the InnoDB Buffer Pool and its importance for performance.Explain the InnoDB Buffer Pool and its importance for performance.Apr 19, 2025 am 12:24 AM

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

MySQL vs. Other Programming Languages: A ComparisonMySQL vs. Other Programming Languages: A ComparisonApr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

Learning MySQL: A Step-by-Step Guide for New UsersLearning MySQL: A Step-by-Step Guide for New UsersApr 19, 2025 am 12:19 AM

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL: Essential Skills for Beginners to MasterMySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AM

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL: Structured Data and Relational DatabasesMySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AM

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL: Key Features and Capabilities ExplainedMySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AM

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

The Purpose of SQL: Interacting with MySQL DatabasesThe Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AM

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

MySQL for Beginners: Getting Started with Database ManagementMySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

See all articles

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.