12
返回列表 发新帖
楼主: ccsnmoracle

关于Oracle11g数据库的redo并行机制

[复制链接]
论坛徽章:
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
11#
发表于 2012-8-24 12:24 | 只看该作者
本帖最后由 Yong Huang 于 2012-8-24 09:53 编辑

> 由于组提交的原因,比如某一session执行了commit操作的话,那么其他session所属的private strand中的redo信息也都要随之一起被写入redo 文件中吧?

Are you sure when one session commits, another session's private redo will also be flushed and written to the logfile? I just did a simple test. It's Oracle 11.2.0.1, not RAC, no supplemental logging, no flashback database:

Session 2 records session 1's redo size statistic, 0. Session 1 makes a small (< 128kb on 64-bit Oracle) transaction (insert a row into a one number column table). Session 2 says session 1's redo size remains 0 (the redo is in private redo, not visible in v$sesstat). Session 3 makes a transaction and commits. Session 2 reports session 1's redo size is still 0. It changes to non-zero when it commits (or rolls back) its own transaction.

If my session 1 had flushed its private redo to public redo when session 3 committed, session 1's redo size statistic would be immediately shown in v$sesstat.

Your second message is about reduced redo allocation latch gets because of private redo. I'm sure that's true. I don't know the details. Think of some good tests and share with us.

使用道具 举报

回复
论坛徽章:
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
12#
发表于 2012-8-24 12:51 | 只看该作者
本帖最后由 Yong Huang 于 2012-8-24 09:47 编辑

> Redo entries in private strands are not directly written to the current logfile.
> They're copied to the public redo log buffer first, and then immediately written
> ...

I need to study a little more about that. There's a concept of "zero copy redo". Tanel Poder has an old message at
http://www.freelists.org/post/oracle-l/latchfree-SCN-scheme-10103,5
and Stephan Haisley has
http://www.teamycc.com/RMOUG_2008_Conference/PDF/Haisley.pdf (see "Improvement #3.5")

It's possible there's no actual copying operation from private to public redo buffer. It may be just some virtual memory address (pointer) manipulation.

[2012-08-24 update] If the parameter _log_private_parallelism ("Number of private log buffer strands for zero-copy redo") only controls whether to enable *zero-copy redo* of private strands, not whether to enable private strands, then zero-copy redo is disabled by default. You have to set _log_private_parallelism to true to enable it. It's a parameter in Oracle 10.1 to 11.1. I don't know if there's a replacement for it in 11.2.

使用道具 举报

回复
论坛徽章:
9
ITPUB9周年纪念徽章
日期:2010-10-08 09:28:522010广州亚运会纪念徽章:击剑
日期:2010-11-03 11:00:36ITPUB十周年纪念徽章
日期:2011-11-01 16:25:512012新春纪念徽章
日期:2012-01-04 11:56:19奥运会纪念徽章:摔跤
日期:2012-08-21 10:04:04优秀写手
日期:2014-02-15 06:00:132014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08马上加薪
日期:2014-05-19 11:17:08
13#
 楼主| 发表于 2012-8-24 21:34 | 只看该作者
Yong Huang 发表于 2012-8-24 12:24
> 由于组提交的原因,比如某一session执行了commit操作的话,那么其他session所属的private strand中的redo ...

>Session 2 records session 1's redo size statistic, 0. Session 1 makes a small (< 128kb on 64->bit Oracle) transaction (insert a row into a one number column table). Session 2 says session >1's redo size remains 0 (the redo is in private redo, not visible in v$sesstat). Session 3 makes >a transaction and commits. Session 2 reports session 1's redo size is still 0. It changes to non->zero when it commits (or rolls back) its own transaction.

Yong Huang sir,我会按照你的这个实验思路,在我的测试环境了试一试!

使用道具 举报

回复
论坛徽章:
86
2015中国数据库技术大会纪念徽章
日期:2015-04-24 16:04:24马上有车
日期:2014-02-19 11:55:14马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11优秀写手
日期:2013-12-18 09:29:11日产
日期:2013-10-17 08:44:39马自达
日期:2013-08-26 16:28:022013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-23 16:55:51马上有房
日期:2014-02-19 11:55:14
14#
发表于 2012-8-28 16:59 | 只看该作者
Yong Huang 发表于 2012-8-24 12:51
> Redo entries in private strands are not directly written to the current logfile.
> They're copie ...

就我的理解zero copy redo是在内存之间进行了映射,从log_buffer中空出一部分空间,将private stand映射过来,当lgwr写出时,逻辑上还是从log_buffer读,只是有一部分内容其实是从private stand映射过来的。

这个理解对么?

使用道具 举报

回复
论坛徽章:
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
15#
发表于 2012-8-29 00:04 | 只看该作者
> 就我的理解zero copy redo是在内存之间进行了映射,从log_buffer中空出一部分空间,将private stand映射过来,当lgwr写出时,
> 逻辑上还是从log_buffer读,只是有一部分内容其实是从private stand映射过来的。

Your understanding is exactly mine! I'm still not sure whether zero copy redo has to be enabled separately. That is, it may or may not be enabled even if private redo is already enabled.

使用道具 举报

回复

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

本版积分规则 发表回复

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