--是否存在死锁 Status: 状态,active表示被死锁
select username,lockwait,status,machine,program from v$session where sid in
(select session_id from v$locked_object);
--查看死锁的语句
select sql_text from v$sql where hash_value in
(select sql_hash_value from v$session where sid in
(select session_id from v$locked_object));
--查看进程
SELECT s.username,l.OBJECT_ID,l.SESSION_ID,s.SERIAL#,
l.ORACLE_USERNAME,l.OS_USER_NAME,l.PROCESS
FROM V$LOCKED_OBJECT l,V$SESSION S WHERE l.SESSION_ID=S.SID;
--结束进程
alter system kill session '869,28287';