以下一个小测试来说明blocking_session的含义


SQL> select sid from v$mystat where rownum=1;


       SID
----------
       129


SQL> insert into test.test01(id) values (2);


1 row created.


SQL> commit;


Commit complete.


SQL> update test.test01 set id=3 where id=2;


1 row updated.


 


启动另外一个session


       SID
----------
       128



SQL> update test.test01 set id=4 where id=2;


 


在前面的sid=129的session上查询


SQL> select sid,blocking_session from v$session where blocking_session is not null;


       SID BLOCKING_SESSION
---------- ----------------
       128              129
      
SQL> select sid,blocking_session ,event from v$session where blocking_session is not null;


       SID BLOCKING_SESSION EVENT
---------- ---------------- ------------------------------
       128              129 enq: TX - row lock contention
       
       
       
       

以上测试不难看出blocking_session字段表示了128这个session被blocking_session字段的值即129session阻塞了。