title: Migrating table with composite partition (Hash/Range) to different tablespace
body: <p>Trying to move table <strong>tab</strong> from tablespace <strong>oldTs</strong> to <strong>newTs</strong>. There is a composite partition (Range/Hash) on tab. Hence, a direct "Alter-Table-Move-Tablespace" query won't work, need to migrate partition by partition. Below is the SQL of tab:</p>
  
  <pre><code>CREATE TABLE tab
  (
      col_1 char(6),
      col_2 varchar2(4),
      col_3 varchar2(5)
  )
  TABLESPACE oldTs PARTITION BY RANGE
  (
      "col_1"
  )
  SUBPARTITION BY HASH
  (
      "col_2"
  )
  SUBPARTITIONS 1
  (
      PARTITION "P201102" VALUES LESS THAN ('201103') PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "oldTs" NOCOMPRESS NOLOGGING ( SUBPARTITION "SYS_SUBP5223" TABLESPACE "oldTs" NOCOMPRESS , SUBPARTITION "SYS_SUBP5224" TABLESPACE "oldTs" NOCOMPRESS ),
      PARTITION "P201103" VALUES LESS THAN ('201104') PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255 STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "oldTs" NOCOMPRESS NOLOGGING ( SUBPARTITION "SYS_SUBP5225" TABLESPACE "oldTs" NOCOMPRESS , SUBPARTITION "SYS_SUBP5226" TABLESPACE "oldTs" NOCOMPRESS )
  );
  </code></pre>
  
  <p>There are several such monthly partitions, created a procedure which acquires all the partition names (such as P201102, P2001103) and generates an alter query for moving partitions.
  For ex, </p>
  
  <pre><code>ALTER TABLE tab_name MOVE PARTITION P201102 TABLESPACE newTbs;
  </code></pre>
  
  <p>But, the query gives below error:</p>
  
  <blockquote>
    <p>SQL Error: ORA-14257: cannot move partition other than a Range, List,
    System, or Hash partition</p>
  </blockquote>
  
  <p>Also, if you notice in P201102/P201103, each has two sub-partitions (SYS_SUBP5225 &amp; SYS_SUBP5226 for P201103).</p>
  
  <p>Require the correct syntax of alter statement for migrating partitions for the above scenario.</p>