SQL> SELECT sid,event,username,SQL.sql_text 2 FROM v$session s,v$sql SQL 3 WHERE s.sql_id=SQL.sql_id 4 AND SQL.sql_text LIKE 'update emp set ename%'; SID EVENT USERNAME --- ------------------------------ ---------- 79 enq: TX - ROW LOCK contention ENMOTECH SQL_TEXT --------------------------------------------------- UPDATE emp SET ename='ENMOTECH' WHERE empno=7369 |
SQL> SELECT SID,INST_ID,BLOCKING_INSTANCE, BLOCKING_SESSION FROM gv$session WHERE INST_ID=2 AND SID=79; SID INST_ID BLOCKING_INSTANCE BLOCKING_SESSION --- ------- ----------------- ---------------- 79 2 1 73 |
SQL> SELECT TYPE,ID1,ID2,LMODE,REQUEST FROM v$lock WHERE sid=79; TY ID1 ID2 LMODE REQUEST -- ---------- ---------- ----- ------- TX 589854 26267 0 6 AE 100 0 4 0 TM 79621 0 3 0 SQL> SELECT INST_ID,SID,TYPE,LMODE,REQUEST FROM gv$Lock WHERE ID1=589854 AND ID2=26267; INST_ID SID TY LMODE REQUEST ---------- ---- -- ---------- ---------- 2 79 TX 0 6 1 73 TX 6 0 |
SQL> SELECT SID,SERIAL# [size=10.5000pt] FROM gv$session [size=10.5000pt] WHERE INST_ID=1 AND SID=73; [size=10.5000pt] SID SERIAL#[size=10.5000pt] ---------- ---------- 73 15625 |
SQL> ALTER system [size=10.5000pt] KILL SESSION '73,15625,@1'; [size=10.5000pt] System altered. |
SQL> UPDATE emp SET ename='ENMOTECH' [size=10.5000pt] WHERE empno=7369;[size=10.5000pt] 1 ROW updated. |
SQL> SELECT ID1_TAG,ID2_TAG [size=10.5000pt] FROM V$LOCK_TYPE WHERE TYPE='TX'; [size=10.5000pt] ID1_TAG ID2_TAG[size=10.5000pt] --------------- ----------[size=10.5000pt] usn<<16 | slot SEQUENCE |
SQL> SELECT taddr FROM v$session WHERE sid=73; TADDR ---------------- 000000008E3B65C0 SQL> SELECT XIDUSN,XIDSLOT,XIDSQN FROM v$transaction WHERE addr='000000008E3B65C0'; XIDUSN XIDSLOT XIDSQN ---------- ---------- ---------- 9 30 26267 |
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) | Powered by Discuz! X3.2 |