728x90
Oracle Insert TX-Lock 발생
링크 - https://uhesse.com/2017/11/27/why-insert-causes-tx-row-lock-contention-or-tm-contention-in-oracle/
## SESSION 1TEST> create table check_lock ( a1 number, a2 varchar2(100));Table created.TEST> create unique index xuk_check_lock on check_lock ( a2 );Index created.TEST> insert into check_lock values ( 1, 'a');1 row created.TEST>## SESSION 2TEST> insert into check_lock values ( 1, 'a');## MONITORING SESSIONTEST> select2 (select username from v$session where sid=a.sid) blocker,3 a.sid,4 ' is blocking ',5 (select username from v$session where sid=b.sid) blockee,6 b.sid7 from8 v$lock a,9 v$lock b10 where11 a.block = 112 and13 b.request > 014 and15 a.id1 = b.id116 and17 a.id2 = b.id2;BLOCKER SID 'ISBLOCKING' BLOCKEE SID------------------------------ ---------- ------------- ------------------------------ ----------SYS 42 is blocking SYS 34TEST>