orcale表解锁

 ----------查看被锁的对象
select c.object_type AS 对象类型,c.object_name AS 对象名称,c.owner AS 所有者,b.username AS 用户,b.sid,b.serial#,
       b.STATUS,b.SCHEMANAME AS 所属架构,b.OSUSER 客户端用户,b.MACHINE 客户端名称
       ,b.TERMINAL AS 终端,b.PROGRAM AS 程序
       ,b.TYPE AS 会话类型,b.STATE AS 进程状态,b.SERVICE_NAME AS  服务器名,b.logon_time AS 登陆时间
from v$locked_object a,v$session b,dba_objects c
where a.session_id=b.sid and a.OBJECT_ID=c.object_id
      and c.object_name='T_SNC_BU_SHARE_APPR_QUERY'
     
----------杀掉等待的进程
select 'alter system kill session '''|| s.sid||','||s.SERIAL#||''''||';'           
from v$locked_object l,dba_objects o ,v$session s           
where l.object_id = o.object_id and l.session_id=s.sid
      and o.object_name='T_SNC_BU_SHARE_APPR_QUERY';  
     

你可能感兴趣的:(orcale)