title: How to kill own Oracle SQL sessions without DBA privileges?
body: <p>Is there a way for a user to terminate one's own session/connections, given an Oracle SID, without DBA rights?</p>
  <p>Specifically, I can run this in my DB without admin rights:</p>
  <pre><code>SELECT SID, &quot;SERIAL#&quot;, STATUS, USERNAME
   FROM V$SESSION
   WHERE 
   (USERNAME = 'LastF') 
   AND
   (STATUS = 'INACTIVE');
  </code></pre>
  <p>But when I go to kill my orphaned session (from another session to which I still have access),</p>
  <pre><code>ALTER SYSTEM KILL SESSION &quot;12, 123&quot;
  </code></pre>
  <p>I get the following:</p>
  <pre><code>JDBC ERROR: ORA-01031: insufficient privileges
  </code></pre>
  <p>Note: I am connecting with JDBC through R/Rstudio using the RJDBC package.</p>
  <h3>Motivation:</h3>
  <p>It doesn't appear too difficult to kill sessions in Oracle SQL:
  <a href="https://docs.oracle.com/cd/B28359_01/server.111/b28310/manproc008.htm#ADMIN11192" rel="nofollow noreferrer">https://docs.oracle.com/cd/B28359_01/server.111/b28310/manproc008.htm#ADMIN11192</a><br />
  <a href="https://stackoverflow.com/questions/55342/how-can-i-kill-all-sessions-connecting-to-my-oracle-database">How can I kill all sessions connecting to my oracle database?</a></p>
  <p>However, for non-DBA users who have orphaned connections (i.e. internet outage, 3rd party client that manages connections errors out, etc), it can be really frustrating to get:</p>
  <pre><code>ORA-02391 exceeded simultaneous SESSIONS_PER_USER limit
  </code></pre>
  <p>and have to wait for timeout.</p>