title: Cannot drop disconnected oracle user
body: <p>I am trying to drop a user from an Oracle DB (version 12c), but can not get it to work. The error I am getting is: </p>
  
  <pre><code>ORA-01940: cannot drop a user that is currently connected
  </code></pre>
  
  <p>Naturally I looked around, and found out how to forcibly disconnect and kill a session. So I used the query: </p>
  
  <pre><code>select s.sid, s.serial#, status, s.username 
  from v$session s 
  where username = 'user_i_want_to_drop';
  </code></pre>
  
  <p>and then killed the only active session by using</p>
  
  <pre><code>alter system kill session '&lt;sid&gt;,&lt;serial#&gt;' IMMEDIATE;
  </code></pre>
  
  <p>naturally using the values from the query.</p>
  
  <p>When I run the query again, it comes up empty, as expected. However, I still cannot drop the user and get the same error message. </p>
  
  <p>I have noticed that when I query on <code>gv$session</code>, two sessions for that user show up. However, I cannot kill those using the <code>alter system kill session</code> statement I used above. </p>
  
  <p>What am I missing here?</p>