orcal查询锁表记录

doMore 799 2019-10-29

查询锁表记录:

select c.sid, c.serial#, c.username, c.osuser, b.owner, b.object_name, a.locked_mode, p.spid 
  from v$locked_object a, dba_objects b, v$session c, v$process p 
 where a.object_id = b.object_id 
   and a.session_id = c.sid 
   and c.paddr = p.addr ;

oracle解锁

alter system kill session 'sid, serial#' ;--填写对应的sid, serial#