Oracle查看锁表并解锁

1.查看被锁的表信息


select b.username,b.sid,b.serial# serial,logon_time,c.object_name

    from v$locked_object a,v$session b,dba_objects c

    where a.session_id = b.sid  and  c.object_id = a.object_id


2.手动解锁


alter system kill session '1922【sid】,62935【serial】'


3.存储过程解锁


create or replace procedure kills

      (v_sid  in char,v_serial  in char)

      is

      v_sql    varchar2(1000);

begin

  v_sql := 'alter system kill session ''' || v_sid || ',' ||v_serial || '''';

  execute immediate v_sql ;

end kills;


你可能感兴趣的:(Oracle查看锁表并解锁)