select
object_name,
object_type,
session_id,
type,
lmode,
request,
block,
ctime
from
v$locked_object, all_objects, v$lock
where
v$locked_object.object_id = all_objects.object_id AND
v$lock.id1 = all_objects.object_id AND
v$lock.sid = v$locked_object.session_id
order by
session_id, ctime desc, object_name;
Example:
SQL> lock table ext_tab_db in exclusive mode;
Table(s) Locked.
Elapsed: 00:00:00.11
SQL> select
2 object_name,
3 object_type,
4 session_id,
5 type,
6 lmode,
7 request,
8 block,
9 ctime
10 from
11 v$locked_object, all_objects, v$lock
12 where
13 v$locked_object.object_id = all_objects.object_id AND
14 v$lock.id1 = all_objects.object_id AND
15 v$lock.sid = v$locked_object.session_id
16 order by
17 session_id, ctime desc, object_name;
OBJECT_NAME OBJECT_TYPE SESSION_ID TY LMODE
------------------------------ ------------------- ---------- -- ----------
REQUEST BLOCK CTIME
---------- ---------- ----------
EXT_TAB_DB TABLE 31 TM 6
0 2 8
Elapsed: 00:00:00.17
SQL>
No comments:
Post a Comment