oracle锁的表查看及其解锁!

用DBA用户登陆:

1、查看锁

SELECT p.spid, a.serial#, c.object_name, b.session_id, b.oracle_username,
       b.os_user_name
  FROM v$process p, v$session a, v$locked_object b, all_objects c
WHERE p.addr = a.paddr AND a.process = b.process
       AND c.object_id = b.object_id
      
2. 查看是哪个进程锁的
SELECT sid, serial#, username, osuser FROM v$session  where osuser = 'tangpj'

3. 杀掉这个进程  alter system kill session 'sid,serial#';

你可能感兴趣的:(oracle)