(1)先找到o.object_name=‘’表对应的blocking_session ,比如blocking_session=222
select ls.INST_ID instance_id,ls.username user_name,ls.type lock_type,o.object_name object, decode(ls.lmode,1,null,2,'Row Share',3,'Row Exclusive',4,'Share',5,'Share Row Exclusive',6,'Exclusive',null) lock_mode, o.owner,ls.sid,ls.serial# serial#,ls.sql_id,ls.logon_time,ls.event,ls.blocking_session from sys.dba_objects o, (select s.INST_ID,s.username,l.type, s.paddr,l.lmode,s.sid,s.serial#,nvl(s.sql_id, s.prev_sql_id) sql_id,s.event,s.logon_time, s.BLOCKING_SESSION,l.id1 from gv$session s, gv$lock l where s.sid = l.sid) ls where o.object_id = ls.id1 --and o.object_name = 'EF_HEAD_INVOICE' and ls.BLOCKING_SESSION is not null order by o.owner, o.object_name
(2)根据查到的blocking_session ,执行下面sql,得到sid,serial#
select * from v$session e where e.sid = 222 ;
(3)再执行下面sql
alter system kill session '222,56331'; --对应sid,serial#