title: Unkillable Oracle session waiting on "SQL*Net message from client" event
body: <p>On Oracle 11gR2, I've recently encountered a very interesting situation involving a blocked (but idle!) <code>MERGE</code> statement that hangs on a <em>"SQL*Net message from client"</em> event, causing subsequent, concurrently executed <code>MERGE</code> statements to block on the first statement via <em>"cursor: pin S wait on X"</em> events. In Oracle Enterprise Manager, the following can be observed:</p>
  
  <p><a href="https://i.stack.imgur.com/Zk8Jl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zk8Jl.png" alt="enter image description here"></a></p>
  
  <p>This situation turns even more severe, as the above Session-ID 1204 cannot be killed with either:</p>
  
  <pre><code>alter system kill session 'sid,serial#';
  alter system kill session 'sid,serial#' immediate;
  </code></pre>
  
  <p>Our DBA is sometimes able to kill the operating system process, but often, the whole database needs to be restarted. Luckily, thus far, only on a test system, never in production.</p>
  
  <h3>Note:</h3>
  
  <p>I'm aware this is probably a similar issue as reported in this rather vague question: <a href="https://stackoverflow.com/q/14043668/521799">Oracle updates/inserts stuck, DB CPU at 100%, concurrency high, SQL*Net wait message from client</a>. I'll still report it again, as I have a clear reproduction path, which I'll report as an answer.</p>