session marked for kill处理oracle中杀不掉的锁


session marked for kill处理Oracle中杀不掉的锁ora-00031:session marked for kill处理oracle中杀不掉的锁



select object_name,machine,s.sid,s.serial# from v$locked_object l,dba_objects o ,v$session swhere l.object_id = o.object_id and l.session_id=s.sid;

2.下面的语句用来杀死一个进程:alter system kill session '24,111'; (其中24,111分别是上面查询出的sid,serial#)


3.如果利用上面的命令杀死一个进程后,进程状态被置为"killed",但是锁定的资源很长时间没有被释放,那么可以在os一级再杀死相应的进程(线程),首先执行下面的语句获得进程(线程)号:select spid, osuser, s.PRogram from v$session s,v$process pwhere s.paddr=p.addr and s.sid=24 (24是上面的sid)

4.在OS上杀死这个进程(线程):1)在unix上,用root身份执行命令: #kill -9 12345(即第3步查询出的spid)2)在windows(unix也适用)用orakill杀死线程,orakill是oracle提供的一个可执行命令,语法为:orakill sid thread其中:sid:表示要杀死的进程属于的实例名thread:是要杀掉的线程号,即第3步查询出的spid。例:c:>orakill orcl 12345

ORA-00031: session marked for kill

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

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

kill -9 12345