Mega Code Archive

 
Categories / Oracle PLSQL / System Tables Views
 

Check locked objects

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 ---------- ---------- ------ RNTSOFT                                 28      21330          0          3          0          0 TM RNTSOFT                                 28      21331          0          3          0          0 TM RNTSOFT                                 28       8655          1          3          0          0 TO RNTSOFT                                 28     196641        871          6          0          0 TX SQL> SQL> SQL> drop table myTable; Table dropped. SQL> drop table myTable2; Table dropped.