title: How to drop columns in a compressed table?
body: <p>After compressing a table, it's not possible to drop a column any more:</p>
  
  <pre><code>CREATE TABLE foo (p NUMBER, i NUMBER, j NUMBER) COMPRESS BASIC;
  
  ALTER TABLE foo DROP COLUMN j;
  ORA-39726: unsupported add/drop column operation on compressed tables
  </code></pre>
  
  <p>It is possible if advance compression is used:</p>
  
  <pre><code>CREATE TABLE foo (p NUMBER, i NUMBER, j NUMBER) COMPRESS FOR OLTP;
  
  ALTER TABLE foo DROP COLUMN j;
  Table FOO altered.
  </code></pre>
  
  <p>However, the column is not really dropped, just hidden:</p>
  
  <pre><code>SELECT column_name, data_type, hidden_column 
    FROM user_tab_cols WHERE table_name = 'FOO';
  
  COLUMN_NAME                 DATA_TYPE  HIDDEN_COLUMN
  P                           NUMBER     NO
  I                           NUMBER     NO
  SYS_C00002_18030204:09:26$  NUMBER     YES
  </code></pre>
  
  <p>This causes an error when partitions are exchanged:</p>
  
  <pre><code>CREATE TABLE par (p NUMBER, i NUMBER) 
   PARTITION BY LIST(p)(
   PARTITION p1 VALUES(1), 
   PARTITION p2 VALUES(2)
  );
  
  ALTER TABLE par EXCHANGE PARTITION p1 WITH TABLE foo;
  ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
  </code></pre>
  
  <p>How can the hidden column be removed? I tried </p>
  
  <pre><code>ALTER TABLE foo DROP UNUSED COLUMNS;
  </code></pre>
  
  <p>but it doesn't help:</p>
  
  <pre><code>SELECT column_name, data_type, hidden_column 
    FROM user_tab_cols WHERE table_name = 'BAR';
  
  COLUMN_NAME                 DATA_TYPE  HIDDEN_COLUMN
  P                           NUMBER     NO
  I                           NUMBER     NO
  SYS_C00002_18030204:09:26$  NUMBER     YES
  </code></pre>