超时分布式事务处理等待锁解决办法

--使用SYS as sysdba用户角色登录

--查找被死锁的语句

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;

--把死锁的进程kill:

--alter system kill session sid,serial#;

--(其中sid=l.session_id

比如:

alter system kill session '12,244'; --(其中sid=l.session_id)

 

你可能感兴趣的:(超时分布式事务处理等待锁解决办法)