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

(急)为什么有的session只有一个TX lock而没有TM lock?

[复制链接]
招聘 : 数据库管理员
论坛徽章:
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
11#
发表于 2007-12-18 12:37 | 只看该作者
了解一下。

使用道具 举报

回复
论坛徽章:
0
12#
 楼主| 发表于 2007-12-20 17:12 | 只看该作者
原帖由 Yong Huang 于 2007-12-15 11:57 发表


Sometimes the SQLs you get from v$session.sql_hash_value or prev_hash_value are still not previous enough. The session could have done some distributed transactions earlier creating TM locks on the remote side and only TX locks locally.

Yong Huang


You are right. I can reproduce this problem by following steps:
1. Run a SQL in session A to query remote database.
2. Check V$LOCK, session A will hold a TX lock.
3. Run a SQL in session A to query local data.
4. Check V$LOCK, session A still hold the TX lock.

我本来以为如果做过distribute transaction都应该有一个DX的lock,即使是只做了query。所以之前没看到DX的lock就没往那里想。结果今天发现9i才会有DX的lock, 8i是没有的。

谢谢Yong Huang和大家的帮助。

使用道具 举报

回复
论坛徽章:
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
13#
发表于 2007-12-20 21:38 | 只看该作者
原帖由 lilyzhang918 于 2007-12-20 03:12 发表
...
我本来以为如果做过distribute transaction都应该有一个DX的lock,即使是只做了query。所以之前没看到DX的lock就没往那里想。结果今天发现9i才会有DX的lock, 8i是没有的。

谢谢Yong Huang和大家的帮助。


Actually, DX locks are in Oracle 7 and all later versions. The weird thing is that sometimes it does not show up in a session that does not create it. I mean, if you have a distributed transaction (including a query), the DX may not show up in a different session that monitors the first session. I think it only shows up if the first session's status is active (v$session.status='ACTIVE'). But in the first session itself, it should show.

Another weird thing is that if the database link is to the localhost (not to another DB server), DX locks won't show up.

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
14#
发表于 2007-12-23 22:16 | 只看该作者
意思是,在select 的时候也会有tx锁?

使用道具 举报

回复

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

本版积分规则 发表回复

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