欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Oracle 锁表查询

程序员文章站 2022-06-02 11:48:47
...
select sess.sid, 
    sess.serial#, 
    lo.oracle_username, 
    lo.os_user_name, 
    ao.object_name, 
    lo.locked_mode 
    from v$locked_object lo, 
    dba_objects ao, 
    v$session sess 
where ao.object_id = lo.object_id and lo.session_id = sess.sid; 
SELECT * FROM v$lock;
SELECT * FROM v$sqlarea;
SELECT * FROM v$session;
SELECT * FROM v$process ;
SELECT * FROM v$locked_object;
SELECT * FROM all_objects;
SELECT * FROM v$session_wait;

SELECT b.owner, b.object_name, a.session_id, a.locked_mode
  FROM v$locked_object a, dba_objects b
 WHERE b.object_id = a.object_id;


SELECT b.username, b.sid, b.serial#, logon_time
  FROM v$locked_object a, v$session b
 WHERE a.session_id = b.sid
 ORDER BY b.logon_time;
SELECT sid, serial#, username, osuser FROM v$session;

SELECT s.sid, s.serial#, s.username, s.schemaname, s.osuser, s.process, s.machine,
s.terminal, s.logon_time, l.type
FROM v$session s, v$lock l
WHERE s.sid = l.sid
AND s.username ='HDM'
ORDER BY sid;


alter system kill session'210,11562';