In this tutorial, we will learn how to solve the ORA-00031 session marked for kill error. "How do I fix the ORA 00031 error?" | "ora-00031 session marked for kill"
How do you resolve ORA 00031?
Step 1. Login in Database with administrator (sys) user and find spid to kill at os level.
SQL> select s.sid, s.username, s.osuser, s.process fg_pid, p.spid bg_pid
from v$session s, v$process p where s.paddr = p.addr;
If you have the user details which find the details as per the user name using the below query.
SQL> select vs.sid,vs.username,vs.osuser, vs.process,vp.spid from v$session vs, v$process vp
where vs.paddr = vp.addr and vs.username='SHRIPAL' and vs.osuser='SHRIPAL';
In my case the output from the above query.
SID USERNAME OSUSER PROCESS SPID
---- ---------- -------- --------- ---------
14 SHRIPAL SHRIPAL 1835:5660 3154
ORA-12560 TNS protocol adapter error
How do you kill a session marked for kill?
Step 2. Now kill user session at OS level using kill -9 command, you can fire the kill command from ORACLE user or ROOT user.
EX:- kill -9 spid
$kill -9 3154
Kill process at Windows level using orakill command.
EX:- orakill ORACLE_SID spid
If you don't know the ORACLE_SID, you can find it using:
>echo %ORACLE_SID%
DIGITAL <<--- oracle_sid in my case
How do I force kill a session?
Fire the below query to kill session at os level.
>orakill DIGITAL 3154
So, this is the solution to the ORA-00031 error. If you found this article useful please write in the comment box or DM on Instagram.
Chant with me on:
- ORA-16019: Cannot Use Db_recovery_file_dest With LOG_ARCHIVE_DEST Or LOG_ARCHIVE_DUPLEX_DEST
- ORA-02019: connection description for remote database not found
- ORA-12954: The request exceeds the maximum allowed database size of 12 GB
- ORA-19913 unable to decrypt backup
- ORA-00054 resource busy and acquire with nowait
- ORA-19502 Solutions
- TNS-00583: Valid Node Checking: Unable To Parse Configuration
- ORA-00031: session marked for kill Solution
- ORA-01244: unnamed datafile(s) added to control file by media recovery
4 thoughts on “ORA-00031: session marked for kill Solution”