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(
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 上午
更多详情见请继续阅读下一页的精彩内容:

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.

ToaddauserremotelytoMySQL,followthesesteps:1)ConnecttoMySQLasroot,2)Createanewuserwithremoteaccess,3)Grantnecessaryprivileges,and4)Flushprivileges.BecautiousofsecurityrisksbylimitingprivilegesandaccesstospecificIPs,ensuringstrongpasswords,andmonitori

TostorestringsefficientlyinMySQL,choosetherightdatatypebasedonyourneeds:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseTEXTforlong-formtextcontent.4)UseBLOBforbinarydatalikeimages.Considerstorageov

When selecting MySQL's BLOB and TEXT data types, BLOB is suitable for storing binary data, and TEXT is suitable for storing text data. 1) BLOB is suitable for binary data such as pictures and audio, 2) TEXT is suitable for text data such as articles and comments. When choosing, data properties and performance optimization must be considered.

No,youshouldnotusetherootuserinMySQLforyourproduct.Instead,createspecificuserswithlimitedprivilegestoenhancesecurityandperformance:1)Createanewuserwithastrongpassword,2)Grantonlynecessarypermissionstothisuser,3)Regularlyreviewandupdateuserpermissions

MySQLstringdatatypesshouldbechosenbasedondatacharacteristicsandusecases:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseBINARYorVARBINARYforbinarydatalikecryptographickeys.4)UseBLOBorTEXTforlargeuns


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

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.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version
SublimeText3 Linux latest version
