欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

oralce 锁表解决

程序员文章站 2024-01-13 16:44:28
...
select sess.sid, 
    sess.serial#, 
    lo.oracle_username, 
    lo.os_user_name, 
    ao.object_name, 
    lo.locked_mode 
    from v$locked_object lo, 
    dba_objects ao, 
    v$session sess 
where ao.object_id = lo.object_id and lo.session_id = sess.sid; 

查看锁表进程SQL语句2: 
select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID; 

杀掉锁表进程: 
如有记录则表示有lock,记录下SID和serial# ,将记录的ID替换下面的333,2222,即可解除LOCK 
alter system kill session '333,2222'; 
相关标签: 锁表