Oracle一个表update锁住了,怎么杀掉session
Oracle一个表update锁住了,怎么杀掉session
1. 查看被锁的表
SELECT p.spid,
a.serial#,
c.object_name,
b.session_id,
b.oracle_username,
b.os_user_name
FROM v$process p, v$session a, v$locked_object b, all_objects c
WHERE p.addr = a.paddr
AND a.process = b.process
AND c.object_id = b.object_id;
2. 查看是哪个进程锁的
SELECT sid, serial#, username, osuser
FROM v$session
where osuser = 'Administrator' ---》OS_USER_NAME
AND username = 'KAIFA'; --->ORACLE_USERNAME
3. 杀掉这个进程 al
alter system kill session '10,157'; --->里面的2个值是sid 和serial#