Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter system kill session and ORA-00031: session marked for kill | Tanel Poder Consulting #24

Open
utterances-bot opened this issue Oct 27, 2021 · 1 comment

Comments

@utterances-bot
Copy link

Alter system kill session and ORA-00031: session marked for kill | Tanel Poder Consulting

I’m sure you are all familiar with this situation:
SQL> alter system kill session '152,33';
alter system kill session '152,33'
*
ERROR at line 1:
ORA-00031: session marked for kill The session trying to issue the kill will hang for 60 seconds and then return this “session marked for kill” message. And the target session does not get killed at all.
So why is that?
The issue is in what this alter system kill command is doing. It’s not actually killing the target session (like kill -9 would do for OS processes). It just sets a bit in the target sessions state object, which marks that the target session should end. But its entirely up the target session to check this bit and act on it!
So,

https://tanelpoder.com/2009/08/13/alter-system-kill-session-and-ora-00031-session-marked-for-kill/

Copy link

YwE9x commented Oct 27, 2021

Thank you Tanel for that nice explanation.

One experience feedback about unkillable processes: in Linux, it happened to us that we could not "kill -KILL" or "kill -9" a session. It turned out that this was a bug in the Veritas kernel driver for the Veritas filesystem when we tried to allocate a disk segment > 4 TB. We could not even shutdown the OS, we had to power it off and reboot. As the problem was reproducible, Veritas provided a patch.

Summary: if a process is not killable on the OS level, it is very likely that it is a kernel process. Processes in user space can be killed by the OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants