title: How to set session variable skip_unusable_indexes to true in a PL/SQL package to speed up a table delete/insert?
body: <p>I'm trying to speed up a data load which is controlled via a PL/SQL stored procedure.  I've programmatically altered the indexes for the table I want to refresh to be unusable. I want Oracle to ignore these unusable indexes.  I can issue the statement:</p>
  
  <pre><code>ALTER SESSION SET skip_unusable_indexes = TRUE
  </code></pre>
  
  <p>but I subsequently get the error:</p>
  
  <blockquote>
    <p>ORA-01502: index 'MY_INDEX_NAME' or partition of such index is in
    unusable state</p>
  </blockquote>
  
  <p>so is it seems to have ignored my alter session.</p>
  
  <p>Can I alter my session inside a PL/SQL package?  If not, what is my alternative?
  How else might I disable (set unusable) the indexes to speed up the load?</p>
  
  <p>A somewhat related question <a href="https://stackoverflow.com/questions/129046/disable-and-later-enable-all-table-indexes-in-oracle">here</a>.</p>