系统中运行三个session,两个连接HR用户的用于测试lock,另一个为sys查看lock情况的,如下:
sys@ORCL112> select a.sid,a.type,a.lmode,a.request,a.block,trunc(a.id1/power(2,16)) rbs,bitand(a.id1,to_number('ffff','xxxx'))+0 lot,a.id2 from v$lock a,v$session b where a.sid=b.sid and b.username='HR'; SID TY LMODE REQUEST BLOCK RBS SLOT ID2 ---------- -- ---------- ---------- ---------- ---------- ---------- ---------- 200 AE 4 0 0 0 100 0 200 TM 3 0 0 1 8397 0 200 TX 6 0 0 8 20 1572 sys@ORCL112> select xidusn,xidslot,xidsqn,recursive from v$transaction; XIDUSN XIDSLOT XIDSQN REC ---------- ---------- ---------- --- 8 20 1572 NO sys@ORCL112> select xidusn,xidslot,xidsqn,recursive from v$transaction; XIDUSN XIDSLOT XIDSQN REC ---------- ---------- ---------- --- 8 20 1572 NO 2 3 1329 YES sys@ORCL112> select a.sid,a.type,a.lmode,a.request,a.block,trunc(a.id1/power(2,16)) rbs,bitand(a.id1,to_number('ffff','xxxx'))+0 lot,a.id2 from v$lock a,v$session b where a.sid=b.sid and b.username='HR'; SID TY LMODE REQUEST BLOCK RBS SLOT ID2 ---------- -- ---------- ---------- ---------- ---------- ---------- ---------- 200 AE 4 0 0 0 100 0 132 AE 4 0 0 0 100 0 132 TX 0 6 0 8 20 1572 200 TM 3 0 0 1 8397 0 132 TM 3 0 0 1 8397 0 200 TX 6 0 1 8 20 1572 已选择6行。
上述中
XIDUSN XIDSLOT XIDSQN REC
---------- ---------- ---------- ---
2 3 1329 YES
是什么??(又测试两遍,再也没有出现两个事务的情况),什么情况下同张表多用户操作会出现多个事务?
深入oracle,去透析oracle每个角落。
DBA、SQL开发技术人的集市,QQ高级群群号35448096