You can synchronize DDL operations when you migrate or synchronize data between MySQL tenants of OceanBase Database.
If you have created an index in the source tenant, it also exists in the destination tenant. Data transmission automatically ignores the index without interrupting the migration process.
Supported DDL operations for synchronization
ALTER TABLE ADD COLUMN
ALTER TABLE MODIFY COLUMN
ImportantYou can increase the column length but you cannot modify the column type.
ALTER TABLE ALTER COLUMN SET DEFAULT
andALTER TABLE ALTER COLUMN DROP DEFAULT
ALTER TABLE DROP COLUMN
CREATE TABLE
DROP TABLE
TRUNCATE TABLE
CREATE INDEX
andALTER TABLE ADD INDEX
DROP INDEX
andALTER TABLE DROP INDEX
RENAME TABLE
andALTER TABLE RENAME
Limits of DDL statements
If a table to be synchronized involves DDL operations that are not supported, the data migration or synchronization project may be interrupted and unrecoverable data exceptions may occur.
Frequent DDL operations on a table are not supported. After the store finishes a DDL operation, which can be determined based on the timestamp, it proceeds to the next DDL operation. Otherwise, the store may unexpectedly exit and unrecoverable data exceptions may occur.
Make sure that no DDL operations are performed before you create a store and when a store is being started. If log pulling is involved, make sure that no DDL operations are performed during the period from the start time when logs are pulled to the current time. Otherwise, the store may unexpectedly exit and unrecoverable data exceptions may occur.
The table names before and after the
RENAME TABLE
clause must be both included or both excluded in the list of tables to be synchronized.If you enable DDL synchronization, the index dropped in the source database by executing the
DROP INDEX
statement is also dropped in the destination database. This may cause index loss in the destination database.