解决方法如下:
1:查V$DB_OBJECT_CACHE
SELECT * FROM V$DB_OBJECT_CACHE WHERE name='CUX_OE_ORDER_RPT_PKG' AND LOCKS!='0';
注意:CUX_OE_ORDER_RPT_PKG 为存储过程的名称。
发现 locks=2
2:按对象查出sid的值
select /*+ rule*/ SID from V$ACCESS WHERE object='CUX_OE_ORDER_RPT_PKG';
注意:CUX_OE_ORDER_RPT_PKG 为存储过程的名称。
3:查sid,serial#
SELECT SID,SERIAL#,PADDR FROM V$SESSION WHERE SID='刚才查到的SID';
4:alter system kill session 'sid值,serial#值' immediate;
如:
SELECT * FROM V$DB_OBJECT_CACHE WHERE name='PROC_SYNC_ADM_DIFF_ORDER' AND LOCKS!='0';
select SID from V$ACCESS WHERE object='PROC_SYNC_ADM_DIFF_ORDER';
SELECT SID,SERIAL#,PADDR FROM V$SESSION WHERE SID='25';
alter system kill session '25,1367' immediate;