title: Materialized view "invalidates" when adding constraint
body: <p>I have a materialized view in an Oracle 10.2.0.50 database that looks like this:</p>
  
  <pre><code>CREATE MATERIALIZED VIEW mv_cis
     NOCACHE
     NOLOGGING
     NOCOMPRESS
     NOPARALLEL
     BUILD IMMEDIATE
     REFRESH FORCE
             ON DEMAND
             WITH PRIMARY KEY AS
     SELECT component_id, ctn, visible_tag, facility,
            SYSTEM, elev, parent, room_number,
            remarks, safety_class, seismic, quality_level
       FROM v_cis;
  </code></pre>
  
  <p>Pretty straight forward stuff. After creating this materialized view, it is valid and populated with the data I would expect. I then add a constraint to its table, like so:</p>
  
  <pre><code>ALTER TABLE mv_cis
     MODIFY ctn CONSTRAINT chk_cis_ctn_null NOT NULL ENABLE VALIDATE;
  </code></pre>
  
  <p>This works as expected, the table gets a new constraint, and all is good in the world.</p>
  
  <p>However, I then look back at the materialized view and (using Toad for Oracle 12) it shows invalid. Looking in the <code>user_mviews</code> table reveals that the <code>COMPILE_STATE</code> of it is <code>NEED_COMPILE</code> and <code>STALENESS</code> is <code>UNDEFINED</code>. So I run:</p>
  
  <pre><code>ALTER MATERIALIZED VIEW mv_cis COMPILE;
  </code></pre>
  
  <p>No change. Oddly, refreshing the view still works, but it drives me crazy that it shows invalid, and makes my test plan fail even though everything looks to be in order. So, what am I missing?</p>