1. 程式人生 > >Oracle 解決表死鎖

Oracle 解決表死鎖

tin sel gtest 避免 machine active rac pre from

 1         select  alter system kill session ‘‘‘ || SID || , || SERIAL# || ‘‘‘; 
 2 
 3          from (        
 4 
 5         select distinct a.sid,a.Serial#,status,machine,LOCKWAIT,logon_time       
 6 
 7              from v$session a, v$locked_object b        
 8 
 9        where (a.status =
ACTIVE or a.status = INACTIVE) 10 11 and a.sid = b.session_id 12 13 and b.ORACLE_USERNAME = SWYBGTEST --加上用戶名是避免把其他系統的會話也關閉,以免傷及無辜 14 15 );

Oracle 解決表死鎖