ITPUB??ì3
新一届的微软MVP评选已经开始,欢迎各位推荐!
ITPUB论坛 » Oracle专题深入讨论 » delayed block cleanout 与 ORA-1555的关系

标题: [精华] delayed block cleanout 与 ORA-1555的关系
离线 hqs4500
老会员



精华贴数 1
个人空间 0
技术积分 1282 (1346)
社区积分 249 (2115)
注册日期 2002-7-10
论坛徽章:4
授权会员2008北京奥运纪念徽章:乒乓球2008北京奥运纪念徽章:马术生肖徽章2007版:鼠  
      

发表于 2003-6-12 13:39 
delayed block cleanout 与 ORA-1555的关系

很多资料都把delayed block cleanout 作为产生ORA-1555的一个原因。我觉得ora-1555的原因有二:相应的transaction table slot被覆盖或相应的undo information被覆盖。想不明白为什么单独把delayed block cleanout作为一个原因:它可以归结为上述原因之一。
谁帮忙解释一下。
另外一个问题:如果transaction table slot被覆盖,block cleanout能成功吗?它的commit SCN从那里得到?
谢谢!


只看该作者    顶部
离线 hqs4500
老会员



精华贴数 1
个人空间 0
技术积分 1282 (1346)
社区积分 249 (2115)
注册日期 2002-7-10
论坛徽章:4
授权会员2008北京奥运纪念徽章:乒乓球2008北京奥运纪念徽章:马术生肖徽章2007版:鼠  
      

发表于 2003-6-12 15:16 
up

问题太简单还是坛中已有相关帖子?
我在黑暗中,清指出一条明路。


只看该作者    顶部
离线 overtime
老会员


精华贴数 2
个人空间 0
技术积分 3088 (485)
社区积分 36 (5692)
注册日期 2001-9-24
论坛徽章:3
授权会员生肖徽章2007版:鼠生肖徽章2007版:鸡   
      

发表于 2003-6-12 16:47 
相应的transaction table slot被覆盖.oracle不能确定数据块在查询开始的SCN时是否是commit的。

cleanout 能成功,只要进行cleanout的这个事务不发生1555。rbs header里有个SCN的上限值,cleanout时会记录这个SCN,而不是事务实际的SCN了。


__________________
SQL  Trace 在线分析工具:TraceReport
只看该作者    顶部
离线 hqs4500
老会员



精华贴数 1
个人空间 0
技术积分 1282 (1346)
社区积分 249 (2115)
注册日期 2002-7-10
论坛徽章:4
授权会员2008北京奥运纪念徽章:乒乓球2008北京奥运纪念徽章:马术生肖徽章2007版:鼠  
      

发表于 2003-6-12 17:33 
这样理解正确否?

TRANSACTION SLOT OVERWRITTEN,所以不知该BLOCK的COMMIT SCN与QUERY SCN孰大孰小,所以无从得到CONSISTENT IMAGE。对吗?
谢谢楼上仁兄。


只看该作者    顶部
离线 biti_rainy
人生就是如此



精华贴数 37
个人空间 0
技术积分 110928 (4)
社区积分 11774 (124)
注册日期 2001-12-12
论坛徽章:41
现任管理团队成员ITPUB长老会成员ITPUB元老年度论坛发贴之星年度论坛发贴之星ITPUB北京九华山庄2008年会纪念徽章
管理团队2007贡献徽章参与2007年甲骨文全球大会(中国上海)纪念ITPUB北京香山2007年会纪念徽章管理团队2006纪念徽章会员2007贡献徽章会员2006贡献徽章

发表于 2003-6-12 18:29 
参考

一致读的步骤:
    1. Read the Data Block.

2. Read the Row Header.

3. Check the Lock Byte to determine whether there's an ITL entry.

4. Read the ITL entry to determine the Transaction ID (Xid).

5. Read the Transaction Table using the Transaction ID. If the transaction has been committed and has a System Commit Number less than the query's System Change Number, update the status of the block (block cleanout) and start over at step 1.

6. Read the last undo block (Uba).

7. Compare the block transaction ID with the transaction table transaction ID. If the Transaction ID in the undo block doesn't equal the Transaction ID from the Transaction Table, then issue ORA-1555, Snapshot Too Old.

8. If the Transaction IDs are identical, make a copy of the data block in memory. Starting with the head undo entry, apply the changes to the copied data block.

9. If the tail undo entry (the actual first undo entry in the chain, or the last in the chain going backwards!) indicates another data block address, read the indicated undo block into memory and repeat steps 7 and 8 until the undo entries don't contain a value for the data block address.

10. When there's no "previous data block address," the transaction has been completely undone.

11. If the undo entry contains:

a. a pointer to a previous transaction undo block address, read the Transaction ID in the previous transaction undo block header and read the appropriate Transaction Table entry. Return to step 5.

b. an ITL record, restore the ITL record to the data block. Return to step 4.


__________________
眼界决定边界,态度决定高度
blog:
人生就是如此
只看该作者    顶部
离线 overtime
老会员


精华贴数 2
个人空间 0
技术积分 3088 (485)
社区积分 36 (5692)
注册日期 2001-9-24
论坛徽章:3
授权会员生肖徽章2007版:鼠生肖徽章2007版:鸡   
      

发表于 2003-6-12 19:05 
to hqs4500:
  我认为你的理解是对的。

to biti:
你的文章里并没有提到transaction table slot找不到(被覆盖)的情况。


__________________
SQL  Trace 在线分析工具:TraceReport
只看该作者    顶部
离线 biti_rainy
人生就是如此



精华贴数 37
个人空间 0
技术积分 110928 (4)
社区积分 11774 (124)
注册日期 2001-12-12
论坛徽章:41
现任管理团队成员ITPUB长老会成员ITPUB元老年度论坛发贴之星年度论坛发贴之星ITPUB北京九华山庄2008年会纪念徽章
管理团队2007贡献徽章参与2007年甲骨文全球大会(中国上海)纪念ITPUB北京香山2007年会纪念徽章管理团队2006纪念徽章会员2007贡献徽章会员2006贡献徽章

发表于 2003-6-12 20:11 
仔细看

5,6,7,8

假如 transaction table slot 和 undo  block 都被覆盖,则返回 1555,假如transaction table slot被覆盖,但是 undo  block 没有被覆盖,这时一定满足这样其中情况,就是 事务已经提交并且 commit  SCN  > select SCN (假如commit SCN < select SCN的话在5已经停止往下走了),于是产生consistent reads

8. If the Transaction IDs are identical, make a copy of the data block in memory. Starting with the head undo entry, apply the changes to the copied data block.

把 data block 产生一个拷贝,把 回滚段内容应用于 拷贝上


transaction table slot找不到  也是标志 事务被提交的情况的一种,实际上已经包含在上述的文字中了


__________________
眼界决定边界,态度决定高度
blog:
人生就是如此
只看该作者    顶部
离线 overtime
老会员


精华贴数 2
个人空间 0
技术积分 3088 (485)
社区积分 36 (5692)
注册日期 2001-9-24
论坛徽章:3
授权会员生肖徽章2007版:鼠生肖徽章2007版:鸡   
      

发表于 2003-6-13 15:04 
"假如 transaction table slot 和 undo block 都被覆盖,则返回 1555"
这种 情况下并不一定要会返回1555,只有当Oracle无法判断出commitSCN<querySCN时才会返回1555.(这种时候Oracle还有可能有办法得到一个COMMIT SCN的上限值,可以通过上限值来比较来判断是否commitSCN<querySCN)


__________________
SQL  Trace 在线分析工具:TraceReport
只看该作者    顶部
离线 biti_rainy
人生就是如此



精华贴数 37
个人空间 0
技术积分 110928 (4)
社区积分 11774 (124)
注册日期 2001-12-12
论坛徽章:41
现任管理团队成员ITPUB长老会成员ITPUB元老年度论坛发贴之星年度论坛发贴之星ITPUB北京九华山庄2008年会纪念徽章
管理团队2007贡献徽章参与2007年甲骨文全球大会(中国上海)纪念ITPUB北京香山2007年会纪念徽章管理团队2006纪念徽章会员2007贡献徽章会员2006贡献徽章

发表于 2003-6-13 15:10 
hehe



QUOTE:
最初由 overtime 发布
"假如 transaction table slot 和 undo block 都被覆盖,则返回 1555"
这种 情况下并不一定要会返回1555,只有当Oracle无法判断出commitSCN<querySCN时才会返回1555.(这种时候Oracle还有可能有办法得到一个COMMIT SCN的上限值,可以通过上限值来比较来判断是否commitSCN<querySCN)


commit SCN 是真切地存在于回滚段中,如果都被覆盖了,还从哪里来?其他地方能存储么?可是好多的说

应该是没有办法

BTW: 偶还是比较信任给出这份文字的人的说


__________________
眼界决定边界,态度决定高度
blog:
人生就是如此
只看该作者    顶部
离线 hqs4500
老会员



精华贴数 1
个人空间 0
技术积分 1282 (1346)
社区积分 249 (2115)
注册日期 2002-7-10
论坛徽章:4
授权会员2008北京奥运纪念徽章:乒乓球2008北京奥运纪念徽章:马术生肖徽章2007版:鼠  
      

发表于 2003-6-13 17:37 
容我消化消化

没想到biti_rainy也来了,有些激动。
但是感觉overtime说法更合理,先消化消化看是否还有其他问题。


只看该作者    顶部
相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问