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

关于ITL的重用与读一致性问题

[复制链接]
论坛徽章:
0
11#
发表于 2006-6-30 00:24 | 只看该作者
如果前面的ITL不可以重用,后面的ITL即使已经提交也不可以重用

回滚段为何会增长,上面是其中一个原因。

使用道具 举报

回复
论坛徽章:
22
2010新春纪念徽章
日期:2010-03-01 11:08:33马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:09
12#
发表于 2006-6-30 09:15 | 只看该作者
最初由 bulkaunt 发布
[B]如果前面的ITL不可以重用,后面的ITL即使已经提交也不可以重用

回滚段为何会增长,上面是其中一个原因。 [/B]


你这句话是什么意思? 不明白啊..

使用道具 举报

回复
论坛徽章:
22
2010新春纪念徽章
日期:2010-03-01 11:08:33马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:092012新春纪念徽章
日期:2012-02-13 15:08:09
13#
发表于 2006-6-30 09:30 | 只看该作者
下面是一段Jonathan Lewis关于itl的表述,, 我针对着做了一个测试..

做了一个测试, Jonathan 并不需要知道内情就可以得到这个结论..

测试过程.
第一步, 准备相关数据..
create table t (id number,name varchar2(20)) initrans 2 maxtrans 2; insert into t values (1,'value 1'); insert into t values (2,'value 2'); insert into t values (3,'value 3'); commit; select dbms_rowid.ROWID_BLOCK_NUMBER(rowid) from t; DBMS_ROWID.ROWID_BLOCK_NUMBER(
18406
18406
18406

确保3条记录在同一个block中..

第二步, 测试.
在session 9 执行,
update t set name = 'value 11' where id = 1;

在session 11 执行
update t set name = 'value 12' where id = 2;

在session 12执行
update t set name = 'value 13' where id = 3;
下面是session 12执行后的相关enqueue trace信息..
ela 是ms, 转化成秒就是3 + 2 = 5秒..

之后这个enqueue就会一直等待在session 11上, 哪怕我们将session 9提交之后, enqueue仍然没有结束,
直到我将session 11也提交之后, 才能观察到session 12不再等待enqueue

WAIT #1: nam='enqueue' ela= 3000344 p1=1415053316 p2=524296 p3=2174 WAIT #1: nam='enqueue' ela= 2000377 p1=1415053316 p2=524296 p3=2174 WAIT #1: nam='enqueue' ela= 3000528 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000498 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000528 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000498 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 2999893 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000529 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000176 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 2999692 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000567 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000354 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000072 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000285 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000092 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000391 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000151 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000502 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000399 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000494 p1=1415053316 p2=327696 p3=2264 WAIT #1: nam='enqueue' ela= 3000508 p1=1415053316 p2=327696 p3=2264

-----Original Message-----
From: jame.tongjw [mailto:jame.tongjw@alibaba-inc.com]
Sent: Wednesday, June 28, 2006 12:43 PM
To: dba@alibaba-inc.com
Subject: a short description of itl By Jonathan Lewis.


http://www.freelists.org/archives/oracle-l/02-2004/msg01473.html

Re: How do commits release row level locks?

    * From: "Jonathan Lewis" <jonathan@xxxxxxxxxxxxxxxxxx>
    * To: <oracle-l@xxxxxxxxxxxxx>
    * Date: Mon, 16 Feb 2004 16:29:54 -0000

Session 1 grabs an ITL slot
Session 2 grabs an ITL slot

Session three see all slots full, so picks and ITL slot 'at random' and (in version 9) sits on the
transaction table entry (in the Undo segment header) for 5 seconds - if nothing happens in this
time, the transaction goes round each slot in turn, just once, waiting for 5 seconds on each, hoping
to find an empty slot.  (This is v9 behaviour only, v8 would just stick on the first one).

After trying every slot for 5 seconds, the transaction sits on the either the first or last one it
tried (I can't remember which off-hand), and waits indefinitely for it to commit or rollback.

If one of the other transactions rolls back or commits, then an ITL slot is free, but the waiting
transaction does not see it.  The waiting transaction sets a call-back to itself every three seconds
(possibly to allow an moment for a deadlock detection message to be delivered).

An even stranger effect than the one you've described - if the transaction that yours is waiting on
rolls back to a savepoint (leaving some data still changed) that frees the ITL in the block that is
causing the problem, your transaction will not see it, because it's no longer looking at the ITL
list, it's looking at the transaction table. So it will still wait.


Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

  The educated person is not the person
  who can answer the questions, but the
  person who can question the answers -- T. Schick Jr


Next public appearances:
March 2004 Hotsos Symposium - The Burden of Proof  March 2004 Charlotte NC OUG - CBO Tutorial
April 2004 Iceland


One-day tutorials:
http://www.jlcomp.demon.co.uk/tutorial.html


Three-day seminar:
see http://www.jlcomp.demon.co.uk/seminar.html
____UK___February
____UK___June


The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

使用道具 举报

回复
论坛徽章:
0
14#
发表于 2006-6-30 11:39 | 只看该作者
如果前面的ITL不可以重用,后面的ITL即使已经提交也不可以重用

回滚段为何会增长,上面是其中一个原因。
--------------------------------------------------------------------------------
你这句话是什么意思? 不明白啊..


如果前面的ITL不可以重用,即这个回滚段不能回收重复利用,此时回滚必须增长以供数据库正常使用。

使用道具 举报

回复
论坛徽章:
10
ITPUB十周年纪念徽章
日期:2011-11-01 16:26:59马上有对象
日期:2014-02-18 16:44:082014年新春福章
日期:2014-02-18 16:44:082013年新春福章
日期:2013-02-25 14:51:24灰彻蛋
日期:2013-01-10 11:04:47ITPUB 11周年纪念徽章
日期:2012-10-09 18:16:002012新春纪念徽章
日期:2012-02-07 09:59:352012新春纪念徽章
日期:2012-01-04 11:58:18鲜花蛋
日期:2011-11-21 00:02:23马上加薪
日期:2014-04-30 16:46:19
15#
发表于 2011-12-13 13:05 | 只看该作者
好东西。。

使用道具 举报

回复

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

本版积分规则 发表回复

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