title: Low Impact End-to-End Database Connection & Query Test
body: <p>The database is Oracle. The goal is to perform a <strong>status check</strong> in code that is:</p>
  
  <ul>
  <li>Robust</li>
  <li>End-to-end (healthy connection does NOT mean healthy objects, i.e. views with offline tables)</li>
  <li>Creates minimal overhead for calling application</li>
  </ul>
  
  <p>To suffice these various requirements, I've come up with the following query:</p>
  
  <pre><code>SELECT NULL FROM VIEW_NAME WHERE NULL IS NOT NULL
  </code></pre>
  
  <p>So let's break it down:</p>
  
  <ul>
  <li><code>SELECT NULL</code> is an attempt to "leverage" <a href="http://www.oracle.com/technetwork/articles/sql/11g-caching-pooling-088320.html" rel="nofollow">SQL result caching</a> by explicitly specifying the value.</li>
  <li><code>FROM VIEW_NAME</code> will fail if <em>VIEW_NAME</em> is not present in the database (i.e. end-to-end).</li>
  <li><code>WHERE NULL IS NOT NULL</code> is an attempt to avert table scans, return 0 records, etc.</li>
  </ul>
  
  <p>Any thoughts, improvements, suggestions, etc. would be appreciated. I would especially like to know if there are any conceivable issues with this query or approach.</p>