楼主: foxmile

[原创] 关于oracle数据块和操作系统块的关系。

[复制链接]
论坛徽章:
46
凯迪拉克
日期:2013-08-22 10:00:10Jeep
日期:2013-08-10 07:21:13ITPUB社区12周年站庆徽章
日期:2013-10-08 14:57:28ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-01-04 11:49:54ITPUB 11周年纪念徽章
日期:2012-10-09 18:05:07奥运会纪念徽章:体操
日期:2008-10-24 13:08:31会员2007贡献徽章
日期:2007-09-26 18:42:10马上加薪
日期:2014-04-11 09:34:11秀才
日期:2015-09-06 10:19:32
51#
发表于 2008-11-12 19:41 | 只看该作者
原帖由 sqysl 于 2008-11-8 08:39 发表
谢谢YONGHUANG版主的答复,我说的意思不是绕过文件系统,我的意思是:ORACLE的I/O并不是次都先申请OS,然后由OS来完成,很多时候,ORACLE的I/O是自己完成的,不是由OS来完成后返回给ORACLE系统,我记得以前看过这方面的资料,主要目的就是为了提高ORACLE的I/O的效率,如果每个I/O都申请OS,再由OS去执行,然后把I/O数据返回给ORACLE是件很麻烦的事情,所以,记得ORACLE在某个版本上做了以上改进,我虽记得有这么回事情,但不是很确定,有时间我找找那个资料。



你指的是Oracle的RAW方式.

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
52#
发表于 2008-11-13 07:04 | 只看该作者
> 对照文件系统的I/O栈图,还是没能理解YongHuang所说的IO  Trunksize 跟ORACLE BLOCK的关系
> 参照上面的两个图,YongHuang所说的“OS space allocation block size ”
> 是指Block device的block的大小吗?

The picture shows these three layers at the bottom: disk -> block device -> filesystem. Disk or hard drive has sector size, which is almost always 512 bytes (set by hard drive makers' low-level format). Block device can get the sector size. On Linux, the command is blockdev --getss. I still have some doubt about the meaning of fdisk (probably equivalent to mkdev on AIX) with -b, an option to "Specify the sector size of the disk. Valid values are 512, 1024, or 2048.  (Recent kernels know the sector size. Use this only on old kernels or to override the kernel’s ideas.)" If you can specify a sector size regardless the hard drive sector size, that means OS does have its own space allocation block size, independent of hard drive space allocation block size. If you can't, then it's only one sector, and I'd better drop the word "OS" from "OS space allocation block size". I'm asking the question to a guy that has some Linux kernel knowledge. You can also ask your AIX admin if you can specify a sector size for mkdev. Man page doesn't seem to have such an option.

Filesystem of course has its block size, and it *is* I/O chunk size.

> 第二个图(AIX IO栈)的 Block I/O to logical disk的一次I/O是不是就是指block device的block size?

Not necessarily. Since there's no filesystem, how big an I/O is is determined by the process or application such as Oracle. Of course the OS has minimum and maximum I/O limitation; between the min and max, it's up to the process to decide what the I/O size should be. Block device's block size is, as I said in the paragraph above, is for space allocation, although it may also serve the role of being the *minimum* I/O chunk size.

> 在make filesystem的时候要指定BLOCK的大小,这个block的大小是不是指“I/O Trunk size”? 也就是第二个图中的I/O to blocks in a filesystemde的block的大小。 对文件logical读写的操作,一次I/O是不是就是指I/O Trunk size?

Absolutely. But change "trunk" to "chunk". "Chunk" is a non-technical term. I just chose it to avoid confusion with the dual meanings of the word "block".

By the way, I think sqysl and bluemoon0083 keep talking about OS as if it was only filesystem. Oracle can bypass filesystem, but never OS. If it could, it would directly work with BIOS.

Yong Huang

[The part about AIX mkdev command should be removed; it's not the same as Linux fdisk.]

[ 本帖最后由 Yong Huang 于 2008-11-13 09:26 编辑 ]

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
25
生肖徽章2007版:龙
日期:2008-05-06 11:07:48咸鸭蛋
日期:2011-10-19 10:09:12ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-01-04 11:49:542013年新春福章
日期:2013-02-25 14:51:24
53#
 楼主| 发表于 2008-11-13 09:03 | 只看该作者
近两日很忙,没来看,大家讨论的更深入了。干完活,继续学习 。多谢大家。

使用道具 举报

回复
论坛徽章:
8
2009新春纪念徽章
日期:2009-01-04 14:52:28祖国60周年纪念徽章
日期:2009-10-09 08:28:002010新春纪念徽章
日期:2010-03-01 11:07:24ITPUB9周年纪念徽章
日期:2010-10-08 09:32:25ITPUB十周年纪念徽章
日期:2011-11-01 16:23:262013年新春福章
日期:2013-02-25 14:51:24沸羊羊
日期:2015-03-04 14:51:522015年新春福章
日期:2015-03-06 11:57:31
54#
发表于 2008-11-13 09:45 | 只看该作者
是啊,好现象,难得各路神仙在这里会齐,而且讨论这么热烈,让人高兴。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
25
生肖徽章2007版:龙
日期:2008-05-06 11:07:48咸鸭蛋
日期:2011-10-19 10:09:12ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-01-04 11:49:542013年新春福章
日期:2013-02-25 14:51:24
55#
 楼主| 发表于 2008-11-13 13:50 | 只看该作者
原帖由 shahand 于 2008-11-11 21:59 发表


是不是bypass filesystem cache,  direct IO 。

是否有这方面的资料?

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
25
生肖徽章2007版:龙
日期:2008-05-06 11:07:48咸鸭蛋
日期:2011-10-19 10:09:12ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-01-04 11:49:542013年新春福章
日期:2013-02-25 14:51:24
56#
 楼主| 发表于 2008-11-13 13:54 | 只看该作者
原帖由 feng_xin 于 2008-11-12 15:52 发表
如果ORACLE使用的是文件系统,应该通过调用OS 的文件系统来读取I/O

每个操作系统filesystem的具体实现方式都应该还有些区别
下面的图是AIX 的I/O栈图

566819


对于direct I/O 来讲,操作会跳过VMM那个阶段,也就是不经过虚拟内存管理,从用户缓冲区直接与磁盘进行数据传输。


请问,这里的用户缓冲区是指?和os是否有关。

使用道具 举报

回复
论坛徽章:
55
马上加薪
日期:2014-02-19 11:55:142010广州亚运会纪念徽章:排球
日期:2011-04-27 13:27:19SQL大赛参与纪念
日期:2011-04-13 12:08:172011新春纪念徽章
日期:2011-02-18 11:43:332011新春纪念徽章
日期:2011-01-25 15:42:562011新春纪念徽章
日期:2011-01-25 15:42:332011新春纪念徽章
日期:2011-01-25 15:42:152011新春纪念徽章
日期:2011-01-25 15:41:502011新春纪念徽章
日期:2011-01-25 15:41:01生肖徽章2007版:兔
日期:2011-01-20 12:58:49
57#
发表于 2008-11-13 13:58 | 只看该作者
学习了。。。

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
25
生肖徽章2007版:龙
日期:2008-05-06 11:07:48咸鸭蛋
日期:2011-10-19 10:09:12ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-01-04 11:49:542013年新春福章
日期:2013-02-25 14:51:24
58#
 楼主| 发表于 2008-11-13 14:02 | 只看该作者
By the way, I think sqysl and bluemoon0083 keep talking about OS as if it was only filesystem. Oracle can bypass filesystem, but never OS. If it could, it would directly work with BIOS.

Yong Huang ,你这句话的意思是,oracle并没有绕过OS,只是绕过了文件系统。
那么这种绕过是否和裸设备一样呢?如果它能做到相同,那还要裸设备做什么呢?

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
59#
发表于 2008-11-14 00:13 | 只看该作者
原帖由 foxmile 于 2008-11-13 00:02 发表
By the way, I think sqysl and bluemoon0083 keep talking about OS as if it was only filesystem. Oracle can bypass filesystem, but never OS. If it could, it would directly work with BIOS.

Yong Huang ,你这句话的意思是,oracle并没有绕过OS,只是绕过了文件系统。
那么这种绕过是否和裸设备一样呢?如果它能做到相同,那还要裸设备做什么呢?


Bypassing filesystem is the same as using raw devices. When I say Oracle can bypass filesystem, of course it can do so only with the help of OS, and optionally third-party software (Veritas Quick I/O etc).

By the way, using raw is not exactly the same as direct I/O (OS direct I/O, not Oracle direct path read or write), which bypasses only the page cache of filesystem (filesystem is more than just the page cache). I believe Oracle on Windows takes this approach by default. On Linux and Solaris, you can mount the filesystem with direct I/O option to do the same.

Yong Huang

使用道具 举报

回复
招聘 : 数据库管理员
论坛徽章:
25
生肖徽章2007版:龙
日期:2008-05-06 11:07:48咸鸭蛋
日期:2011-10-19 10:09:12ITPUB十周年纪念徽章
日期:2011-11-01 16:20:282012新春纪念徽章
日期:2012-01-04 11:49:542013年新春福章
日期:2013-02-25 14:51:24
60#
 楼主| 发表于 2008-11-14 10:58 | 只看该作者
嗯,我先想想,多谢。

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表