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>
每行的結果都是如此。
總結
以上是生活随笔為你收集整理的oracle中的tx锁影响查询吗,如何找到TM锁对应的TX锁?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 第十五期:真相了,中台到底“出路”还是“
- 下一篇: 【java集合框架源码剖析系列】java