Oracle PL/SQL Tutorial/System Tables Data Dictionary/v lock

Материал из SQL эксперт
Перейти к: навигация, поиск

30. 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
---------- ---------- ------
sqle                                 28      21330          0          3
         0          0 TM
sqle                                 28      21331          0          3
         0          0 TM
sqle                                 28       8655          1          3
         0          0 TO
sqle                                 28     196641        871          6
         0          0 TX

SQL>
SQL>
SQL> drop table myTable;
Table dropped.
SQL> drop table myTable2;
Table dropped.