Let’s have look on the steps used to solve the error Error(ORA-00031: session marked for the kill)
Let’s have look on the steps
Phase – 1
Find out thread id that needed to be killed from OS level
select vs.sid, vs.username, vs.osuser, vs.process fg_pid, vp.spid bg_pid from v$session vs, v$process vp where vs.paddr = vp.addr;
If you know the user detail you can filter the query.
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='SCOTT' and vs.osuser='SCOTT';
Output:
SID USERNAME OSUSER PROCESS SPID ---- --------------- ---------- --------- --------- 10 SCOTT SCOTT 1965:6969 5292
Phase-2
Kill the session from OS level
Unix: Run in UNIX as the oracle/root user kill –9 spid
Example from the above output:
kill -9 5292
Windows: orakill ORACLE_SID spid ORACLE_SID is the unique database name.
Example from the above output:
orakill cor 5292
Thought of the day!
There are no secrets to success. It is the result of preparation, hard work, and learning from failure. — By Colin Powell
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp