• 【转】ora-00031:session marked for kill(标记要终止的会话)解决方法


      今天碰到一个问题,有一张表不能操作,很可能是被锁了,首先想到的是kill session,于是执行了下列的脚本找到是哪个session有问题:

    select object_name, machine, s.sid,s.serial#

     from v$locked_object l, dba_objects o, v$session s

     where l.object_id = o.object_id

       and l.session_id =s.sid;

          发现有一个会话有锁sid 197,serial# 17,于是执行alter system kill session ‘197,17’;大概等了30s中,pl/sql developer报出一个错误:ora-00031:标记要终止的会话。

    解决方法:查出session的spid

    select spid, osuser, s.program

     from v$session s, v$process p

     where s.paddr = p.addr

       and s.sid =197;

    1. 在linux上,  kill -9 12345

    2. 在windows上,C:Documents and Settingsgg>orakill orcl 12345

    orcl:表示要杀死的进程属于的实例名

    12345:是要杀掉的线程号

    ORA-00031: session marked for kill

    Cause: The session specified in an ALTER SYSTEM KILL SESSION command cannot bekilled immediately (because it is rolling back or blocked on a networkoperation), but it has been marked for kill. This means it will be killed as soonas possible after its current uninterruptible operation is done.

    Action: No action is required for the session to be killed, but further executionsof the ALTER SYSTEM KILL SESSION command on this session may cause the sessionto be killed sooner.

  • 相关阅读:
    372. Super Pow
    224. Basic Calculator + 227. Basic Calculator II
    263. Ugly Number + 264. Ugly Number II + 313. Super Ugly Number
    169. Majority Element
    225. Implement Stack using Queues + 232. Implement Queue using Stacks
    551. Student Attendance Record I + Student Attendance Record II
    765. Couples Holding Hands
    547. Friend Circles
    535. Encode and Decode TinyURL
    87. Scramble String
  • 原文地址:https://www.cnblogs.com/fashflying/p/6263981.html
Copyright © 2020-2023  润新知