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

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

作者: 丶年华 | 来源:发表于2018-11-16 11:13 被阅读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';  --干掉进程
    
    

    相关文章

      网友评论

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

          本文链接:https://www.haomeiwen.com/subject/lkwpfqtx.html