您的位置:首页 > 数据库 > Oracle

ORACLE数据库表解锁record is locked by another user

2017-11-13 15:41 1091 查看
转自 : https://www.cnblogs.com/xusweeter/p/5942852.html

今天同事在操作Oracle数据库表删数据时突然断网,再次连接的时候删数据就提示“record is locked by another user”,然后就百度找到了如下解决方案。

方案步骤:

1、查锁

select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 where t1.session_id=t2.sid order by t2.logon_time;

2、解锁(KILL)

--alter system kill session 'sid,serial#';

alter system kill session '151,14678';      --151是sid,14678是serial#

运行以上命令后,就可以解决此问题。

 

操作记录:

1、数据库表被锁;





 

2、查锁

select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 where t1.session_id=t2.sid order by t2.logon_time;


结果:

1    BCSA    64    40449    2016/10/9 15:38:05
2    BCSA    64    40449    2016/10/9 15:38:05
3    BCSA    64    40449    2016/10/9 15:38:05
4    BCSA    64    40449    2016/10/9 15:38:05


 

3、解锁

alter system kill session '64,40449';
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: