Check locked objects : v_lock « System Tables Data Dictionary « Oracle PL/SQL Tutorial






SQL>
SQL> create table myTable ( x int );

Table created.

SQL> create table myTable2 ( x int );

Table created.

SQL> insert into myTable values ( 1 );

1 row created.

SQL> insert into myTable2 values ( 1 );

1 row created.

SQL> select (select username from v$session where sid = v$lock.sid) username,
  2         sid,
  3         id1,
  4         id2,
  5         lmode,
  6         request, block, v$lock.type
  7    from v$lock
  8   where sid = (select sid
  9                  from v$mystat
 10                 where rownum=1)
 11  /

USERNAME                              SID        ID1        ID2      LMODE
------------------------------ ---------- ---------- ---------- ----------
   REQUEST      BLOCK TYPE
---------- ---------- ------
JAVA2S                                 28      21330          0          3
         0          0 TM

JAVA2S                                 28      21331          0          3
         0          0 TM

JAVA2S                                 28       8655          1          3
         0          0 TO

JAVA2S                                 28     196641        871          6
         0          0 TX


SQL>
SQL>
SQL> drop table myTable;

Table dropped.

SQL> drop table myTable2;

Table dropped.








30.116.v_lock
30.116.1.Check locked objects