Oracle中事务锁(锁住的表、锁住的会话)
今天又学会一招,查看Oracle数据库中由于会话非正常退出而导致的事务锁:
1.查看锁住的表
SELECT b.owner,b.object_name,a.session_id,a.locked_mode
FROM v$locked_object a ,dba_objects b
WHERE b.object_id = a.object_id;
2.查看被锁住的会话
SELECT b.username,b.sid,b.serial#,logon_time
FROM v$locked_object a,v$session b
WHERE a.session_id = b.sid order by b.logon_time;
3.如果要断开某个会话,执行
Alter system kill session ‘sid,serial#’
相关推荐
spurity 2020-11-10
LeeLuffy 2020-10-16
DriveCar 2020-09-07
zjuwangleicn 2020-09-04
quniMdejiangyou 2020-08-15
gamestart0 2020-08-15
loviezhang 2020-08-08
gaozhennan 2020-08-03
mcvsyy 2020-08-02
happinessaflower 2020-07-29
花落花开春去秋来 2020-07-29
heniancheng 2020-07-26
牧场SZShepherd 2020-07-20
jakefei 2020-07-19
牧场SZShepherd 2020-07-19
qingjiuquan 2020-07-18
云之飞踢 2020-07-08
zhanbuquan 2020-07-04