查看数据库是否有死锁信息并处理(MSSQL/ORACLE)

2018-11-16  本文已影响0人  丶年华

SQL SERVER


select    
    request_session_id spid,   
    OBJECT_NAME(resource_associated_entity_id) tableName    
from    
    sys.dm_tran_locks   
where     
    resource_type='OBJECT' 
 KILL 82 --干掉进程

ORACLE


select sess.sid, 
sess.serial#, 
lo.oracle_username, 
lo.os_user_name, 
ao.object_name, 
lo.locked_mode, 
SESS.machine 
from v$locked_object lo, 
dba_objects ao, 
v$session sess 
where ao.object_id = lo.object_id and lo.session_id = sess.sid; 

alter system kill session '855,6061';  --干掉进程

上一篇下一篇

猜你喜欢

热点阅读