oracle中的tx锁影响查询吗,如何找到TM锁对应的TX锁?

我昨天也这样试过,但出来的结果和预料相差很远。

wyq@ORCL>update emp set ename = ename;

12 rows updated.

wyq@ORCL>get lock

line 16 truncated.

1  /* showalllock.sql */

2  column username format a6

3  column object_name format a13

4  column o_name format a13

5  column lock_type format a13

6  column object_name format a13

7  column type format a5

8  select s.username,l.sid,l.type,l.id1,l.id2,o.object_name,

9      decode(l.lmode,0,'None', 1,'Null', 2,'Row Share',

10      3,'Row Exclusive', 4,'Share', 5,'Share Row Exclusive',

11      6,'Exclusive') lock_type,l.request,l.ctime,l.block

12  from v$lock l,v$session s,dba_objects o

13  where l.type in ('TX','TM')

14  and l.sid = s.sid

15* and l.id1 = o.object_id(+)

16

wyq@ORCL>ed

Wrote file afiedt.buf

1  select s.username,l.sid,l.type,l.id1,l.id2,o.object_name,

2      decode(l.lmode,0,'None', 1,'Null', 2,'Row Share',

3      3,'Row Exclusive', 4,'Share', 5,'Share Row Exclusive',

4      6,'Exclusive') lock_type,l.request,l.ctime,l.block,x.sql_text

5  from v$lock l,v$session s,dba_objects o,v$sql x

6  where l.type in ('TX','TM')

7  and l.sid = s.sid

8  and l.id1 = o.object_id(+)

9* and s.sql_hash_value = x.hash_value

wyq@ORCL>/

USERNA        SID TYPE         ID1        ID2 OBJECT_NAME   LOCK_TYPE        REQUEST      CTIME      BLOCK

------ ---------- ----- ---------- ---------- ------------- ------------- ---------- ---------- ----

SQL_TEXT

----------------------------------------------------------------------------------------------------

WYQ            18 TX        393238        112               Exclusive              0        120          0

BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;

WYQ            18 TM          6492          0 EMP           Row Exclusive          0        120          0

BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;

wyq@ORCL>

每行的结果都是如此。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值