All Products
Search
Document Center

ApsaraDB for OceanBase:Supported DDL operations for synchronization

Last Updated:Jun 07, 2024

This topic describes the support of data migration or synchronization projects of different data source types for DDL statements related to tables and indexes.

Considerations

  • This topic does not cover all specific scenarios, such as all options of ALTER TABLE ADD COLUMN, due to the complexity of DDL statements. For any unsupported scenarios, take actions as prompted or contact OceanBase Technical Support.

  • The DDL statements listed in this topic are only for your reference. The actual syntax varies slightly based on the database. Therefore, you must determine the supported DDL statements for synchronization based on the statement syntax of your database.

  • The CREATE DDL statements listed in this topic will be synchronized to the destination only if objects are selected by using the Match Rules option and the names of tables created by using the CREATE statements match the migration object rules.

  • The RENAME DDL statements listed in this topic will be synchronized to the destination only if objects are selected by using the Match Rules option and the names of tables renamed by using the RENAME statement match the migration object rules.

  • The index-related DDL statements listed in this topic will be synchronized to the destination only if the names of tables where the indexes belong match the migration object rules.

  • For the support status of DDL statements in reverse incremental migration in a data migration project, see the corresponding section in this topic based on the data source types in the order of "destination->source". For example, for the support status DDL statements in reverse incremental migration in a data migration project whose source is a MySQL database and destination is a MySQL tenant of OceanBase database, see the OB_MySQL -> MySQL section of this topic.

MySQL -> OB_MySQL

The following table lists the supported DDL statements for synchronization when you migrate data from a MySQL database to a MySQL tenant of OceanBase Database. For more information, see Synchronize DDL operations from a MySQL database to a MySQL tenant of OceanBase Database.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

Supported

ALTER TABLE A DROP INDEX/KEY B

Supported

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

Not supported

ALTER TABLE A ADD UNIQUE INDEX/KEY B

Supported

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Not supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the destination is OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

Supported

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_MySQL-> MySQL

The following table lists the supported DDL statements for synchronization when you migrate data from a MySQL tenant of OceanBase Database to a MySQL database. For more information, see Synchronize DDL operations from a MySQL tenant of OceanBase Database to a MySQL database.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

Supported

ALTER TABLE A DROP INDEX/KEY B

Supported

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

Not supported

ALTER TABLE A ADD UNIQUE INDEX/KEY B

Supported

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Not supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source is OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

Supported

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_MySQL -> OB_MySQL

The following table lists the supported DDL statements for synchronization when you migrate data from one MySQL tenant to another in OceanBase Database. For more information, see DDL synchronization between MySQL tenants of OceanBase Database.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

Supported

ALTER TABLE A DROP INDEX/KEY B

Supported

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

Not supported

ALTER TABLE A ADD UNIQUE INDEX/KEY B

Supported

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Not supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source and destination are OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

Supported

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

Oracle -> OB_Oracle

The following table lists the supported DDL statements for synchronization when you migrate data from an Oracle database to an Oracle tenant of OceanBase Database. For more information, see Synchronize DDL operations from an Oracle database to an Oracle tenant of OceanBase Database.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

N/A

CREATE TABLE IF NOT EXISTS A

N/A

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

N/A

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

N/A

ALTER TABLE A DROP INDEX/KEY B

N/A

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

N/A

ALTER TABLE A ADD UNIQUE INDEX/KEY B

N/A

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the destination is OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

N/A

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_Oracle -> Oracle

The following table lists the supported DDL statements for synchronization when you migrate data from an Oracle tenant of OceanBase Database to an Oracle database. For more information, see Synchronize DDL operations from an Oracle tenant of OceanBase Database to an Oracle database.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

N/A

CREATE TABLE IF NOT EXISTS A

N/A

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

N/A

ALTER TABLE A DROP INDEX/KEY B

N/A

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

N/A

ALTER TABLE A ADD UNIQUE INDEX/KEY B

N/A

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source is OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

N/A

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_Oracle -> OB_Oracle

The following table lists the supported DDL statements for synchronization when you migrate data from one Oracle tenant to another in OceanBase Database. For more information, see DDL synchronization between Oracle tenants of OceanBase Database.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

N/A

ALTER TABLE A DROP INDEX/KEY B

N/A

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

N/A

ALTER TABLE A ADD UNIQUE INDEX/KEY B

N/A

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source and destination are OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

N/A

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_MySQL -> AnalyticDB for MySQL

The following table lists the supported DDL statements for synchronization when you migrate data from a MySQL tenant of OceanBase Database to AnalyticDB for MySQL.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

Supported

ALTER TABLE A DROP INDEX/KEY B

Not supported

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

Not supported

ALTER TABLE A ADD UNIQUE INDEX/KEY B

Not supported

ALTER TABLE A ADD CONSTRAINT B

Not supported

ALTER TABLE A DROP CONSTRAINT B

Not supported

ALTER TABLE A DROP PRIMARY KEY

Not supported

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

Supported

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Not supported

CREATE UNIQUE INDEX A ON B(C)

Not supported

DROP

DROP INDEX A ON B

Not supported

OB_MySQL -> DataHub (BLOB)

The following table lists the supported DDL statements for synchronization when you migrate data from a MySQL tenant of OceanBase Database to a DataHub instance (of the BLOB type).

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

Supported

ALTER TABLE A DROP INDEX/KEY B

Supported

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

Not supported

ALTER TABLE A ADD UNIQUE INDEX/KEY B

Supported

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Not supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source and destination are OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

Supported

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_Oracle -> DataHub (BLOB)

The following table lists the supported DDL statements for synchronization when you migrate data from an Oracle tenant of OceanBase Database to a DataHub instance (of the BLOB type).

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

N/A

ALTER TABLE A DROP INDEX/KEY B

N/A

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

N/A

ALTER TABLE A ADD UNIQUE INDEX/KEY B

N/A

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source and destination are OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

N/A

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_MySQL -> Kafka

The following table lists the supported DDL statements for synchronization when you migrate data from a MySQL tenant of OceanBase Database to a Kafka instance.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

Supported

ALTER TABLE A DROP INDEX/KEY B

Supported

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

Not supported

ALTER TABLE A ADD UNIQUE INDEX/KEY B

Supported

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Not supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source and destination are OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

Supported

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported

OB_Oracle -> Kafka

The following table lists the supported DDL statements for synchronization when you migrate data from an Oracle tenant of OceanBase Database to a Kafka instance.

Object type

DDL type

DDL statement

Supported or not

Tables

CREATE

CREATE TABLE A

Supported

CREATE TABLE A LIKE B

Supported

CREATE TABLE IF NOT EXISTS A

Supported

CREATE TABLE AS SELECT

Not supported

ALTER

ALTER TABLE A RENAME B

Supported

ALTER TABLE A ADD COLUMN B

Supported

ALTER TABLE A DROP COLUMN B

Supported

ALTER TABLE A ALTER COLUMN SET DEFAULT

Supported

ALTER TABLE A ALTER COLUMN DROP DEFAULT

Supported

ALTER TABLE A CHANGE COLUMN

Supported

ALTER TABLE A MODIFY COLUMN

Supported

ALTER TABLE A ADD INDEX/KEY B

N/A

ALTER TABLE A DROP INDEX/KEY B

N/A

ALTER TABLE A ADD FULLTEXT INDEX/KEY B

N/A

ALTER TABLE A ADD UNIQUE INDEX/KEY B

N/A

ALTER TABLE A ADD CONSTRAINT B

Supported

ALTER TABLE A DROP CONSTRAINT B

Supported

ALTER TABLE A DROP PRIMARY KEY

Supported

Note

This statement is supported only when the source and destination are OceanBase Database V4.0.0 or later

ALTER TABLE A ADD PARTITION B

Supported

ALTER TABLE A DROP PARTITION B

Supported

ALTER TABLE A TRUNCATE PARTITION B

Supported

ALTER TABLE A PARTITION BY...

N/A

DROP

DROP TABLE A

Supported

RENAME

RENAME TABLE A TO B

Supported

TRUNCATE

TRUNCATE TABLE A

Supported

Indexes

CREATE

CREATE INDEX A ON B(C)

Supported

CREATE UNIQUE INDEX A ON B(C)

Supported

DROP

DROP INDEX A ON B

Supported