Professional Documents
Culture Documents
Online Move Table O12c
Online Move Table O12c
com/articles/12c/online-move-table-12cr2
Setup
MOVE (offline)
MOVE ONLINE
Restrictions
Related articles.
Setup
We create and populate a test table with a primary key and secondary index. This will be used
for the example move operations.
-- Create table.
CREATE TABLE t1 AS
SYSDATE AS created_date
FROM dual
COMMIT;
MOVE (offline)
In previous releases moving a table was an offline operation, and by default would a mark
indexes as unusuable.
-- Check indexes.
INDEX_NAME STATUS
------------------------------ --------
T1_CREATED_DATE_IDX UNUSABLE
T1_PK UNUSABLE
2 rows selected.
SQL>
-- Check indexes.
------------------------------ --------
T1_CREATED_DATE_IDX VALID
T1_PK VALID
2 rows selected.
SQL>
Alternatively we could include the UPDATE INDEXES clause to manage the indexes for us.
-- Check indexes.
INDEX_NAME STATUS
------------------------------ --------
T1_CREATED_DATE_IDX VALID
T1_PK VALID
2 rows selected.
SQL>
MOVE ONLINE
From Oracle 12.2 onward we can move the table as an online operation using the ONLINE
keyword. In addition to moving the table, the online move automatically maintains the indexes.
-- Check indexes.
INDEX_NAME STATUS
------------------------------ --------
T1_CREATED_DATE_IDX VALID
T1_PK VALID
2 rows selected.
SQL>
We can also use this feature to change table compression and storage parameters in an online
operation.
Restrictions
There are some restrictions associated with online moves of tables described here.
It can't be combined with any other clause.
It can't be used on a partitioned index-organized table or index-organized tables that have
a column defined as a LOB, VARRAY, Oracle-supplied type, or user-defined object
type.
It can't be used if there is a domain index on the table.
Parallel DML and direct path inserts are not supported against an object with an ongoing
online move.