2 Replies Latest reply: Aug 27, 2001 8:27 AM by 3004 RSS

    locks

    3004
      Hi Guys, in the v$lock table i can know the sessionID, username, but how can i know which
      table is locked.
      thanks
        • 1. locks
          3004
          Hi,

          Try this,

          select * from v$lock where type like 'TX';
          • 2. locks
            3004
            Hi,

            I usually use this below code to find out which table is locked and which statement is locked the table!

            select p.username pu, s.username su, s.status stat,
            s.sid ssid, s.serial# sser, substr(p.spid,1,8) spid,
            substr(sa.sql_text,1,2000) txt
            from
            v$process p, v$session s, v$sqlarea sa
            where
            p.addr=s.paddr
            and s.username is not null
            and s.sql_address=sa.address(+)
            and s.sql_hash_value=sa.hash_value(+)
            and s.status = 'ACTIVE'
            order by
            1,2,7
            /

            Hope this helps,