• oracle 杀死被锁进程


    Oracle杀死死锁进程

    先查看哪些表被锁住了:

    select b.owner,b.object_name,a.session_id,a.locked_mode
    from v$locked_object a,dba_objects b
    where b.object_id = a.object_id;
    
    OWNER        OBJECT_NAME        SESSION_ID LOCKED_MODE
    ------------------------------ -----------------
    WSSB SBDA_PSHPFTDT      22 3
    WSSB_RTREPOS WB_RT_SERVICE_QUEUE_TAB      24 2
    WSSB_RTREPOS WB_RT_NOTIFY_QUEUE_TAB      29 2
    WSSB_RTREPOS WB_RT_NOTIFY_QUEUE_TAB      39 2
    WSSB SBDA_PSDBDT        47 3
    WSSB_RTREPOS WB_RT_AUDIT_DETAIL        47 3
    
    select b.username,b.sid,b.serial#,logon_time 
    from v$locked_object a,v$session b
    where a.session_id = b.sid order by b.logon_time;
    
    USERNAME      SID      SERIAL# LOGON_TIME
    ------------------------------ ---------- -------
    WSSB_RTACCESS        39        1178 2006-5-22 1
    WSSB_RTACCESS        29        5497 2006-5-22 1

    杀进程中的会话:
    alter system kill session 'sid,serial#';
    e.g
    alter system kill session '29,5497';

    如果有ora-00031错误,则在后面加immediate;alter system kill session '29,5497' immediate;

  • 相关阅读:
    如何:将控件锁定到 Windows 窗体
    Linux 设置字符集
    sql 批量处理
    解决表被锁了
    oracle 分页模板
    创建用户及表空间
    恢复数据库数据
    instr vs like 效率
    自定义参数转换器
    spring boot 整合MyBatis
  • 原文地址:https://www.cnblogs.com/Iyce/p/3753683.html
Copyright © 2020-2023  润新知