In 12C, some parameters have been changed. The Move table supports Online, but no production attempts have been made.
Mysql > create move table and rebuild index statements By xander. Cui OWNER(SCHEMA NAME): MYUSER TABLE_NAME: MY_TABLE TABLESPACE: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Open after close parallel * / SELECT TC OWNER | | '. '| | TC TABLE_NAME | |' table contains the Long field, does not support a Move, the Move command do not perform. ' FROM DBA_TAB_COLUMNS TC WHERE TC.DATA_TYPE = 'LONG' AND TC.OWNER = UPPER('MYUSER') AND TC.TABLE_NAME IN CMD:' AS COMMEND FROM DUAL UNION ALL -- Move table SELECT 'ALTER -- $COMMEND -- $COMMEND -- $COMMEND -- $COMMEND -- $COMMEND TABLE ' || T.OWNER || '.' || T.TABLE_NAME || ' MOVE TABLESPACE '|| T.TABLESPACE_NAME ||' PARALLEL 4; ' ||CHR(10)||'ALTER TABLE ' || T.OWNER || '.' || T.TABLE_NAME || ' NOPARALLEL; ' FROM DBA_TABLES T WHERE T.OWNER = UPPER('MYUSER') AND T.TABLE_NAME IN UPPER('MY_TABLE') AND T.PARTITIONED = 'NO' UNION ALL - a Move the PARTITION TABLE for partitioning the SELECT "ALTER TABLE" | | TP. TABLE_OWNER | | '. '| | TP. TABLE_NAME | |' Move PARTITION '| | TP. PARTITION_NAME | |' TABLESPACE '||TP.TABLESPACE_NAME||' PARALLEL 4; ' ||CHR(10)||'ALTER TABLE '||TP.TABLE_OWNER||'.'||TP.TABLE_NAME||' NOPARALLEL; ' FROM DBA_TAB_PARTITIONS TP WHERE TP.TABLE_OWNER = UPPER('MYUSER') AND TP.TABLE_NAME IN UPPER('MY_TABLE') UNION ALL CMD:' FROM DUAL UNION ALL 'SELECT 'ALTER TABLE' FROM DUAL UNION ALL 'SELECT 'ALTER TABLE' FROM DUAL UNION ALL 'SELECT 'ALTER TABLE' FROM DUAL UNION ALL '||A.OWNER||'.'||A.TABLE_NAME||' MOVE LOB('||A.COLUMN_NAME||') STORE AS (TABLESPACE '||A.TABLESPACE_NAME||') PARALLEL 4; ' ||CHR(10)||'ALTER TABLE '||A.OWNER||'.'||A.TABLE_NAME||' NOPARALLEL; ' FROM DBA_LOBS A WHERE A.PARTITIONED = 'NO' AND A.OWNER IN ('MYUSER') AND A.TABLE_NAME IN UPPER('MY_TABLE') UNION ALL - Move the PARTITION TABLE Lob field SELECT "ALTER TABLE" | | TP. TABLE_OWNER | | '. '| | TP. TABLE_NAME | |' Move PARTITION '| | TP. PARTITION_NAME | |' LOB('||C.COLUMN_NAME||') STORE AS ('||'TABLESPACE '||TP.TABLESPACE_NAME||') PARALLEL 4; ' ||CHR(10)||'ALTER TABLE '||TP.TABLE_OWNER||'.'||TP.TABLE_NAME||' NOPARALLEL; ' FROM DBA_TAB_PARTITIONS TP LEFT JOIN DBA_TAB_COLUMNS C ON TP.TABLE_OWNER = C.OWNER AND TP.TABLE_NAME = C.TABLE_NAME WHERE C.DATA_TYPE LIKE '%LOB' AND C.OWNER = UPPER('MYUSER') AND TP.TABLE_NAME IN UPPER('MY_TABLE') UNION ALL SELECT '-- CMD:' FROM DUAL UNION ALL -- Rebuild non-partitioned INDEX SELECT 'ALTER INDEX '||I.OWNER||'.'||I.INDEX_NAME||' REBUILD ONLINE TABLESPACE '||I.TABLESPACE_NAME||' PARALLEL 4; ' ||CHR(10)|| 'ALTER INDEX ' || I.OWNER || '.' || I.INDEX_NAME ||' NOPARALLEL; ' FROM DBA_INDEXES I WHERE I.STATUS = 'VALID' AND I.OWNER = UPPER('MYUSER') AND I.TABLE_NAME IN UPPER('MY_TABLE') AND I.index_name NOT LIKE '%$$%' AND i.artilack = 'NO' UNION ALL -- Rebuild partition INDEX SELECT 'ALTER INDEX ' '||I.OWNER||'.'||I.INDEX_NAME||' REBUILD ONLINE TABLESPACE '||I.TABLESPACE_NAME||' PARALLEL 4; ' ||CHR(10)|| 'ALTER INDEX ' || I.OWNER || '.' || I.INDEX_NAME ||' NOPARALLEL; ' FROM DBA_INDEXES I LEFT JOIN DBA_IND_PARTITIONS IP ON I.OWNER = IP.INDEX_OWNER AND I.INDEX_NAME = IP.INDEX_NAME WHERE I.OWNER = UPPER('MYUSER') AND I.TABLE_NAME IN UPPER('MY_TABLE') AND I.INDEX_NAME NOT LIKE '%$$%' AND I.PARTITIONED = 'YES';
Write the SQL, record for use.