楼主: biti_rainy

关于回滚段使用的一点讨论

[复制链接]
论坛徽章:
10
ITPUB元老
日期:2005-02-28 12:57:002010广州亚运会纪念徽章:保龄球
日期:2011-01-30 11:57:03祖国60周年纪念徽章
日期:2009-10-09 08:28:00参与2009年中国云计算大会纪念
日期:2009-06-05 10:02:28ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452009新春纪念徽章
日期:2009-01-04 14:52:28生肖徽章2007版:鼠
日期:2008-01-02 17:35:53会员2006贡献徽章
日期:2006-04-17 13:46:34授权会员
日期:2005-10-30 17:05:33ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41
11#
发表于 2002-4-29 12:45 | 只看该作者

回滚段环状结构的本质是链表

链表的特点是,在任意的位置增加、减少节点都很方便。Free list如果要插入一个节点很麻烦。

使用道具 举报

回复
论坛徽章:
10
ITPUB元老
日期:2005-02-28 12:57:002010广州亚运会纪念徽章:保龄球
日期:2011-01-30 11:57:03祖国60周年纪念徽章
日期:2009-10-09 08:28:00参与2009年中国云计算大会纪念
日期:2009-06-05 10:02:28ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452009新春纪念徽章
日期:2009-01-04 14:52:28生肖徽章2007版:鼠
日期:2008-01-02 17:35:53会员2006贡献徽章
日期:2006-04-17 13:46:34授权会员
日期:2005-10-30 17:05:33ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41
12#
发表于 2002-5-4 00:42 | 只看该作者

我想大家应该澄清几个概念

1.对于一个回滚段,头指针、尾指针指的是什么?
  我认为:头指针就是所谓的Current extent。尾指针不知道是什么。

2.对于一个extent,什么是占用,什么是空?
  是否可以理解为:占用就是有这个extent被一个或一个以上的active transaction使用。空是没有任何active trasaction正在使用吗?

3.Active trasaction
  我想这应当没有疑问,没有提交或回滚的事务呗。

4.Avalible extent
  不太确定。是否是:no any active transaction using it ?


如果想对回滚段的运行机制有更精确的理解,我想先把概念弄清楚是很有必要的。不知我的看法大家同意否。

使用道具 举报

回复
论坛徽章:
10
ITPUB元老
日期:2005-02-28 12:57:002010广州亚运会纪念徽章:保龄球
日期:2011-01-30 11:57:03祖国60周年纪念徽章
日期:2009-10-09 08:28:00参与2009年中国云计算大会纪念
日期:2009-06-05 10:02:28ITPUB北京2009年会纪念徽章
日期:2009-02-09 11:42:452009新春纪念徽章
日期:2009-01-04 14:52:28生肖徽章2007版:鼠
日期:2008-01-02 17:35:53会员2006贡献徽章
日期:2006-04-17 13:46:34授权会员
日期:2005-10-30 17:05:33ITPUB十周年纪念徽章
日期:2011-11-01 16:19:41
13#
发表于 2002-5-9 13:03 | 只看该作者
谢谢你!

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
14#
发表于 2002-5-4 06:03 | 只看该作者
I like fromeast’s way to discus the questions, at least durning the discussion we know we are following   
the same concepts.

对于一个回滚段,头指针、尾指针指的是什么?
When a DML (insert, update or delete) a row of a table, the change is made to the current version of the data block containing the row, and an ITL (interested transaction list) is created in the block.  The ITL is used to mark the row locked until the transaction is either committed or rolled back.  
The ITL contains the Transaction ID, which constitutes a POINTER (头指针) ( it is not inside of rollback segment, just point to it) to a SLOT  within the transaction table within the rollback segment header.
In the SLOT, there is another POINTER (尾指针) to the actual undo records for the transaction, which are located in the body of the rollback segment.

Between the  头指针 and 尾指针 have no anything to do with rollback segment extents allocate, but
trigger it to allocate, how rollback allocate the extent is according to LRU/Round Robin style.

占用= have active transactions

空= no active Tx

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
15#
发表于 2002-5-5 10:51 | 只看该作者
Before a DML transaction (inserts, updates, or deletes) a row of a table, an ITL is allocated in this DATA block containing this row. The ITL is used to mark the row as locked until the transaction is either committed or rolled back. The ITL contains the transaction identifier (txid=pointer (头指针)point to rollback segment head slot).

txid = usn.slot.wrap (undo_segment_number.transaction slot id.SCN wrap)

When a slot is allocated in the transaction table that is in the head of a rollback segment. This is the physical expression of a UNDO transaction record in a rollback’s extent. Undo information is also generated and is stored in the rollback segment. The slot in transaction table, which is inside of rollback head contains a pointer (尾指针) to the undo transaction record.
头指针 = point to rollback segment head slot
尾指针 = a slot from transaction table, which reside in rollback segment head point to undo transaction record
When querying v$lock, usn.slot shows up as id1 and wrap shows up as id2.

Between the 头指针 and 尾指针 have no anything to do with rollback segment extents allocate.

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
16#
发表于 2002-5-5 19:04 | 只看该作者
Yes, Rollback segment is one of kernel parts in RDBMS have many very complex actions happen at same time when a transaction  occur.
I suggest you read the following reference first, and then come back with your questions again.

ORACLE Database Administrator's Guide

ORACLE RDBMS Performance Tuning Guide

Note: 10579.1 - HOW MANY ROLLBACK SEGMENTS TO HAVE

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
17#
发表于 2002-4-26 11:08 | 只看该作者
最初由 richking 发布
[B]回滚段中一个extent中能有多个事务? [/B]


是的.

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
18#
发表于 2002-4-26 11:13 | 只看该作者

Re: 关于回滚段使用的一点讨论

最初由 biti_rainy 发布
[B]根据回滚段选择算法:

假如存在这么一种情况
1:
一个用户插入一条记录使用了某回滚段的尾(是初始extents)
但用户长时间没有提交或者回滚,但用户连接还在线。这其中有不少事务已经提交,因此造成回滚段头指针和尾指针间有大量空闲空间而无法利用,此时是不是比较危险,或者oracle可否有解决机制?

2:由于设置了optimal参数,回滚段扩展到了很大,假设是区间n,而区间n-1由于同上一类问题久久没有释放,但n-2以下空间早已释放,这是又怎样,很麻烦?

2种情况出现的概率多大?
分别在何种情况下容易出现(假设1不允许自动扩展)
大家探讨探讨?

呵呵
2出现的概率太小太小,除非是所有回滚段都被大事务占用且都扩展,新的小事务出现,而大事务都提交了但小事务一直没有完成。这已经是DBA严重失职了……
[/B]


I think neither case will happen. Let's discuss.

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
19#
发表于 2002-4-27 13:06 | 只看该作者
"所以:
. Oracle will check 1 ,2 ,3, 4, 5, 6 and find 7 is available and use it.

这句话是不正确的,当检查到5正被使用的时候,立即扩展新空间"

我没看懂。

For a new transaction, it will check all extents to find a avalable one. So if 1-6 are in used, it will use 7 if it is free.

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
20#
发表于 2002-4-26 16:42 | 只看该作者
斑竹置顶好不好,我要去开会,f**k.

使用道具 举报

回复

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

本版积分规则 发表回复

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