Oracle: How to find out if there is a transaction pending?

后端 未结 7 1856
太阳男子
太阳男子 2020-11-28 04:34

I\'m looking for a way to find out if there are uncommited INSERT, UPDATE or DELETE statements in the current session. One way would be to check v$lock with the current sid,

7条回答
  •  Happy的楠姐
    2020-11-28 05:08

    This is the query I normally use,

    select s.sid
          ,s.serial#
          ,s.username
          ,s.machine
          ,s.status
          ,s.lockwait
          ,t.used_ublk
          ,t.used_urec
          ,t.start_time
    from v$transaction t
    inner join v$session s on t.addr = s.taddr;
    

提交回复
热议问题