title: resource busy while rebuilding an index
body: <p>There is a table <code>T</code> with column <code>a</code>:</p>
  
  <pre><code>CREATE TABLE T {
    id_t integer not null,
    text varchar2(100),
    a integer
  } 
  /
  
  ALTER TABLE T ADD CONSTRAINT PK_T PRIMARY KEY (ID_T)
  /
  </code></pre>
  
  <p>Index was created like this:</p>
  
  <pre><code>CREATE INDEX IDX_T$A ON T(a);
  </code></pre>
  
  <p>Also there's such a check constraint:</p>
  
  <pre><code>ALTER TABLE T ADD CONSTRAINT CHECK (a is null or a = 1);
  </code></pre>
  
  <p>Most of the records in <code>T</code> have null value of <code>a</code>, so the query using the index works really fast if the index is in consistent state and statistics for it is up to date.</p>
  
  <p>But the problem is that values of <code>a</code> of some rows change really frequently (some rows get null value, some get 1), and I need to rebuild the index let's say every hour.</p>
  
  <p>However, really often when the job doing this, trying to rebuild the index, it gets an exception:</p>
  
  <pre><code>ORA-00054: resource busy and acquire with NOWAIT specified
  </code></pre>
  
  <p>Can anybody help me with coping with this issue?</p>