OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Migration Service

V3.4.0Enterprise Edition

  • OMS Documentation
  • What's new
  • OMS Introduction
    • What is OMS?
    • Terms
    • Architecture
      • Overview
      • Hierarchical functional system
      • Basic components
    • Limits
  • Quick Start
    • Data migration process
    • Data synchronization process
  • Deployment Guide
    • Deployment type
    • System and network requirements
    • Memory and disk requirements
    • Prepare the environment
    • Deploy OMS on a single node
    • Deploy OMS on multiple nodes in a single region
    • Deploy OMS on multiple nodes in multiple regions
    • Scale-out and deployment
    • Check the deployment
    • Deploy a time-series database (Optional)
  • OMS console
    • Log on to the OMS console
    • Overview
    • User center
      • Configure user information
      • Change your logon password
      • Log off
  • Data migration
    • Data migration overview
    • Create a project to migrate data from a MySQL database to a MySQL tenant of OceanBase Database
    • Create a project to migrate data from a MySQL tenant of OceanBase Database to a MySQL database
    • Create a project to migrate data from an Oracle database to a MySQL tenant of OceanBase Database
    • Create a project to migrate data from an Oracle tenant of OceanBase Database to an Oracle database
    • Create a project to migrate data from an Oracle database to an Oracle tenant of OceanBase Database
    • Create a project to migrate data from a DB2 LUW database to an Oracle tenant of OceanBase Database
    • Create a project to migrate data from an Oracle tenant of OceanBase Database to a DB2 LUW database
    • Create a project to migrate data from a DB2 LUW database to an OceanBase database in MySQL tenant mode
    • Create a project to migrate data from a MySQL tenant of OceanBase Database to a DB2 LUW database
    • Migrate data within OceanBase Database
    • Create an active-active disaster recovery project in OceanBase Database
    • Create a project to migrate data from a TiDB database to an OceanBase database in MySQL tenant mode
    • Create a project to migrate data from a PostgreSQL database to a MySQL tenant of OceanBase Database
    • Manage data migration projects
      • View details of a data migration project
      • View and modify migration objects
      • Use tags to manage data migration projects
      • Download and import the settings of migration objects
      • Start, pause, and resume a data migration project
      • Release and delete a data migration project
    • Features
      • DML filtering
      • Synchronize DDL operations
      • Configure matching rules for migration objects
      • Wildcard rules
      • Rename a database table
      • Use SQL conditions to filter data
      • Create and update a heartbeat table
      • Schema migration mechanisms
      • Schema migration operations
    • Supported DDL operations in incremental migration and limits
      • Supported DDL operations in incremental migration from a MySQL database to a MySQL tenant of OceanBase Database and limits
      • Supported DDL operations in incremental migration from a MySQL tenant of OceanBase Database to a MySQL database and limits
      • Supported DDL operations in incremental migration from an Oracle database to an Oracle tenant of OceanBase Database
      • Supported DDL operations in incremental migration from an Oracle tenant of OceanBase Database to an Oracle database
      • Dynamic DDL operations during data migration between an Oracle tenant of OceanBase Database and a DB2 LUW database
      • Supported DDL operations in incremental migration from a DB2 LUW database to a MySQL tenant of OceanBase Database and limits
      • Supported DDL operations in incremental migration from a MySQL tenant of OceanBase Database to a DB2 LUW database and limits
      • Supported DDL operations in incremental migration between MySQL tenants of OceanBase Database
      • Supported DDL operations in incremental migration between Oracle tenants of OceanBase Database
  • Data synchronization
    • Data synchronization overview
    • Create a project to synchronize data from an OceanBase database to a Kafka instance
    • Create a project to synchronize data from an OceanBase database to a RocketMQ instance
    • Create a project to synchronize data from an OceanBase database to a DataHub instance
    • Create a project to synchronize data from a DBP logical table to a physical table in the MySQL tenant of OceanBase Database
    • Create a project to synchronize data from a DBP logical table to a DataHub instance
    • Create a project to synchronize data from an IDB logical table to the MySQL tenant of OceanBase Database
    • Create a project to synchronize data from an IDB logical table to a DataHub instance
    • Create a project to synchronize data from a MySQL database to a DataHub instance
    • Create a project to synchronize data from an Oracle database to a DataHub instance
    • Manage data synchronization projects
      • View details of a data synchronization project
      • View and modify synchronization objects
      • Use tags to manage data synchronization projects
      • Download and import the settings of synchronization objects
      • Start, pause, and resume a data synchronization project
      • Release and delete a data synchronization project
    • Features
      • DML filtering
      • Synchronize DDL operations
      • Rename databases and tables
      • Rename a topic
      • Use SQL conditions to filter data
      • Column filtering
      • Data formats
  • Create and manage data sources
    • Create data sources
      • Create an OceanBase data source
        • Create a physical OceanBase data source
        • Create a DBP data source
        • Create an IDB data source
      • Create a MySQL data source
      • Create an Oracle data source
      • Create a TiDB data source
      • Create a Kafka data source
      • Create a RocketMQ data source
      • Create a DataHub data source
      • Create a DB2 LUW data source
      • Create a PostgreSQL data source
    • Manage data sources
      • View data source information
      • Copy a data source
      • Edit a data source
      • Delete a data source
    • Create a database user
    • User privileges
    • Enable binlogs for the MySQL database
    • Minimum privileges required when an Oracle database serves as the source
  • OPS & Monitoring
    • O&M overview
    • Go to the overview page
    • Server
      • View server information
      • Update quotas
      • View server logs
    • Components
      • Store
        • Create a store
        • View details of a store
        • Update the configurations of a store
        • Start and pause a store
        • Destroy a store
      • Connector
        • View details of a connector
        • Start and pause a connector
        • Migrate a connector
        • Update the configurations of a connector
        • Batch O\&M
        • Delete a connector
      • JDBCWriter
        • View details of a JDBCWriter
        • Start and pause a JDBCWriter
        • Migrate a JDBCWriter
        • Update the configurations of a JDBCWriter
        • Batch O\&M
        • Delete a JDBCWriter
      • Checker
        • View the information about a checker
        • Start and pause a checker
        • Rerun and reverify a checker
        • Update the configurations of a checker
        • Delete a checker
    • O&M tickets
      • View details of an O\&M ticket
      • Skip a ticket or sub-ticket
      • Retry a ticket or sub-ticket
  • System management
    • User management
    • Alert center
      • View project alerts
      • View system alerts
      • Manage alert settings
    • Associate with OCP
    • System parameters
      • Modify system parameters
      • Modify HA configurations
    • Operation audit
  • O&M Guide
    • Manage OMS services
    • OMS logs
    • O&M operations for the Store component
    • Store parameters
      • Parameters of an Oracle store
      • Parameters of a DB2 store
      • Parameters of a MySQL store
      • Parameters of an OceanBase store
    • O&M operations for the Supervisor component
    • Parameters of the Supervisor component
    • O&M operations for the Connector component
    • Connector parameters
      • Parameters of a destination RocketMQ instance
      • Parameters of a DataflowSink instance
      • Parameters in the destination Kafka instance
      • Parameters of the source database in full migration
      • Parameters of the source database in incremental data synchronization
      • Parameters of a destination DataHub instance
      • Parameters of the source Sybase database
      • Parameters for intermediate-layer synchronization
    • Checker parameters
    • JDBCWriter parameters
    • Parameters of the CM component
  • Reference Guide
    • API Reference
      • Obtain the status of a migration project
      • Obtain the status of a synchronization project
    • OMS error codes
    • Alert Reference
      • oms_host_down
      • oms_host_down_migrate_resource
      • oms_host_threshold
      • oms_migration_failed
      • oms_migration_delay
      • oms_sync_failed
      • oms_sync_status_inconsistent
      • oms_sync_delay
  • Upgrade Guide
    • Overview
    • Upgrade OMS in single-node deployment mode
    • Upgrade OMS in multi-node deployment mode
    • FAQ
  • FAQ
    • General O&M
      • How do I modify the resource quotas of an OMS container?
      • How do I troubleshoot the OMS server down issue?
    • Project diagnostics
      • How do I troubleshoot common problems with Oracle Store?
      • How do I perform performance tuning for Oracle Store?
      • What do I do when Oracle Store reports an error at the isUpdatePK stack?
      • What do I do when a store does not have data of the timestamp requested by the downstream?
      • What do I do when OceanBase Store failed to access an OceanBase cluster through RPC?
      • How do I use LogMiner to pull data from an Oracle database?
    • OPS & monitoring
      • What are the alert rules?
    • Data synchronization
      • FAQ about synchronization to a message queue
        • What are the strategies for ensuring the message order in incremental data synchronization to Kafka
    • Data migration
      • User privileges
        • What privileges do I need to grant to a user during data migration to or from an Oracle database?
      • Full migration
        • FAQ about full migration
          • How do I query the ID of a checker?
          • How do I query log files of the Checker component of OMS?
          • How do I query the verification result files of the Checker component of OMS?
          • What do I do if the destination table does not exist?
      • Incremental synchronization
        • How do I skip DDL statements?
        • How do I update the configurations of a JDBCWriter?
        • How do I start or stop a JDBCWriter?
        • How do I update whitelists and blacklists?
        • What are the application scope and limits of ETL?
    • Installation and deployment
      • How do I upgrade Store?
  • Release Note
    • V3.4
      • OMS V3.4.0
    • V3.3
      • OMS V3.3.1
      • OMS V3.3.0
    • V3.2
      • OMS V3.2.2
      • OMS V3.2.1
    • V3.1
      • OMS V3.1.0
    • V2.1
      • OMS V2.1.2
      • OMS V2.1.0

Download PDF

OMS Documentation What's new What is OMS? Terms Overview Hierarchical functional system Basic components Limits Data migration process Data synchronization process Deployment type System and network requirements Memory and disk requirements Prepare the environment Deploy OMS on a single node Deploy OMS on multiple nodes in a single region Deploy OMS on multiple nodes in multiple regions Scale-out and deployment Check the deployment Deploy a time-series database (Optional) Log on to the OMS console Overview Configure user information Change your logon password Log off Data migration overview Create a project to migrate data from a MySQL database to a MySQL tenant of OceanBase Database Create a project to migrate data from a MySQL tenant of OceanBase Database to a MySQL database Create a project to migrate data from an Oracle database to a MySQL tenant of OceanBase Database Create a project to migrate data from an Oracle tenant of OceanBase Database to an Oracle database Create a project to migrate data from an Oracle database to an Oracle tenant of OceanBase Database Create a project to migrate data from a DB2 LUW database to an Oracle tenant of OceanBase Database Create a project to migrate data from an Oracle tenant of OceanBase Database to a DB2 LUW database Create a project to migrate data from a DB2 LUW database to an OceanBase database in MySQL tenant mode Create a project to migrate data from a MySQL tenant of OceanBase Database to a DB2 LUW database Migrate data within OceanBase Database Create an active-active disaster recovery project in OceanBase Database Create a project to migrate data from a TiDB database to an OceanBase database in MySQL tenant mode Create a project to migrate data from a PostgreSQL database to a MySQL tenant of OceanBase Database View details of a data migration project View and modify migration objects Use tags to manage data migration projects Download and import the settings of migration objects Start, pause, and resume a data migration project Release and delete a data migration project DML filtering Synchronize DDL operations Configure matching rules for migration objects Wildcard rules Rename a database table Use SQL conditions to filter data Create and update a heartbeat table Schema migration mechanisms Schema migration operations Supported DDL operations in incremental migration from a MySQL database to a MySQL tenant of OceanBase Database and limits Supported DDL operations in incremental migration from a MySQL tenant of OceanBase Database to a MySQL database and limits Supported DDL operations in incremental migration from an Oracle database to an Oracle tenant of OceanBase Database Supported DDL operations in incremental migration from an Oracle tenant of OceanBase Database to an Oracle database Dynamic DDL operations during data migration between an Oracle tenant of OceanBase Database and a DB2 LUW database Supported DDL operations in incremental migration from a DB2 LUW database to a MySQL tenant of OceanBase Database and limits Supported DDL operations in incremental migration from a MySQL tenant of OceanBase Database to a DB2 LUW database and limits Supported DDL operations in incremental migration between MySQL tenants of OceanBase Database Supported DDL operations in incremental migration between Oracle tenants of OceanBase Database Data synchronization overview Create a project to synchronize data from an OceanBase database to a Kafka instance Create a project to synchronize data from an OceanBase database to a RocketMQ instance Create a project to synchronize data from an OceanBase database to a DataHub instance Create a project to synchronize data from a DBP logical table to a physical table in the MySQL tenant of OceanBase Database Create a project to synchronize data from a DBP logical table to a DataHub instance Create a project to synchronize data from an IDB logical table to the MySQL tenant of OceanBase Database Create a project to synchronize data from an IDB logical table to a DataHub instance Create a project to synchronize data from a MySQL database to a DataHub instance Create a project to synchronize data from an Oracle database to a DataHub instance View details of a data synchronization project View and modify synchronization objects Use tags to manage data synchronization projects Download and import the settings of synchronization objects Start, pause, and resume a data synchronization project Release and delete a data synchronization project DML filtering Synchronize DDL operations Rename databases and tables Rename a topic Use SQL conditions to filter data Column filtering Data formats Create a MySQL data source Create an Oracle data source Create a TiDB data source Create a Kafka data source Create a RocketMQ data source Create a DataHub data source Create a DB2 LUW data source Create a PostgreSQL data source View data source informationCopy a data source Edit a data source Delete a data source Create a database user User privileges
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Migration Service
  3. V3.4.0
iconOceanBase Migration Service
V 3.4.0Enterprise Edition
Enterprise Edition
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.5
  • V 4.2.4
  • V 4.2.3
  • V 4.0.2
  • V 3.4.0
Community Edition
  • V 4.2.13
  • V 4.2.12
  • V 4.2.11
  • V 4.2.10
  • V 4.2.9
  • V 4.2.8
  • V 4.2.7
  • V 4.2.6
  • V 4.2.5
  • V 4.2.4
  • V 4.2.3
  • V 4.2.1
  • V 4.2.0
  • V 4.0.0
  • V 3.3.1

Supported DDL operations in incremental migration from a MySQL database to a MySQL tenant of OceanBase Database and limits

Last Updated:2026-04-14 07:36:28  Updated
share
What is on this page
Overview
CREATE TABLE
ALTER TABLE
TRUNCATE TABLE
RENAME TABLE
DROP TABLE
CREATE INDEX
DROP INDEX
Limits of DDL operations in incremental migration

folded

share

Overview

  • Supported DDL operations

    • CREATE TABLE

    • ALTER TABLE

    • TRUNCATE TABLE

    • RENAME TABLE

    • DROP TABLE

    • CREATE INDEX

    • DROP INDEX

  • Unsupported DDL operations

    • CREATE/DROP/ALTER DATABASE

    • CREATE/DROP/ALTER FUNCTION

    • CREATE/DROP/ALTER PROCEDURE

    • CREATE/DROP/ALTER EVENT

    • CREATE/DROP/ALTER VIEW

    • CREATE/DROP/ALTER ROLE

    • CREATE/DROP/ALTER TRIGGER

    • CREATE/DROP/ALTER USER

    • CREATE/DROP/ALTER SERVER

    • CREATE/DROP/ALTER TABLESPACE

CREATE TABLE

  • When you use the CREATE TABLE statement to create a table, you can specify the IF NOT EXISTS keyword and the LIKE option. Example:

    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
    { LIKE old_tbl_name | (LIKE old_tbl_name) }
    
  • You cannot use this statement to create a temporary table. The TEMPORARY keyword will be ignored.

    Note

    You can create temporary tables in MySQL tenants of OceanBase Database V3.2.3.

  • You cannot use the CREATE TABLE AS SELECT statement to create a table based on the output of a SELECT statement. This is because an empty string will be output in this scenario.

Syntax:

CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
    (create_definition,...)   
    [table_options]
    [partition_options]
Category Description
create_definition create_definition allows you to create columns, indexes, or constraints. For more information, see Create columns and Create indexes or constraints following this table.
table_options
  • You can use this clause to specify COMMENT at the table level.
  • You can use this clause to specify CHARACTER SET.
  • Other table options cannot be parsed and will be ignored.
partition_options
  • You can use this clause to specify LIST, RANGE, HASH, and KEY partitions to be created.
    For a LIST partition, you can specify a function partitioning key or column partitioning key.
    For a RANGE partition, you can specify a function partitioning key or column partitioning key.
    For a HASH partition, you can specify a function partitioning key or column partitioning key, and define LINEAR HASH.
    For a KEY partition, you can specify a column partitioning key and define LINEAR KEY.
  • You can use this clause to specify HASH and KEY subpartitions to be created.
  • You can specify PARTITIONS number and SUBPARTITIONS number.

Notice

MySQL tenants of OceanBase Database support only certain character sets.

Do not use unsupported character sets, such as Latin-1. If you forcibly specify an unsupported character set for a MySQL tenant of OceanBase Database, this character set will not be converted during DDL synchronization to the destination database and an error will be returned.

create_definition allows you to create columns, indexes, or constraints.

  • Create columns

    When you create columns, you can:

    • Specify the NULL or NOT NULL attribute.

    • Specify the DEFAULT attribute, which can be a constant or a function.

    • Specify the VISIBLE or INVISIBLE attribute.

    • Specify AUTO_INCREMENT.

    • Specify COMMENT.

    • Specify COLLATE.

    • Specify the VIRTUAL | STORED attribute.

    • Specify the UNIQUE KEY, PRIMARY KEY, or KEY attribute. For more information, see Create indexes or constraints following this section.

    • Specify CHECK constraints (supported only in MySQL tenants of OceanBase Database V3.2.3). For more information, see Create indexes or constraints following this section.

    • Specify foreign keys. For more information, see Create indexes or constraints following this section.

    • The following table lists the supported data types.

      Classification MySQL database MySQL tenant of OceanBase Database
      Data types Integer data types INT INT
      TINYINT TINYINT
      SMALLINT SMALLINT
      MEDIUMINT MEDIUMINT
      BIGINT BIGINT
      BOOL/BOOLEAN BOOLEAN
      Fixed-point data types DECIMAL DECIMAL
      NUMERIC NUMERIC
      Floating-point data types REAL FLOAT
      DOUBLE DOUBLE
      FLOAT FLOAT
      BIT data type BIT BIT
      Character data types CHAR CHAR
      NCHAR CHAR
      VARCHAR VARCHAR
      BINARY BINARY
      VARBINARY VARBINARY
      LONG VARBINARY BLOB
      Date and time data types YEAR YEAR
      DATE DATE
      TIME TIME
      TIMESTAMP TIMESTAMP
      DATETIME DATETIME
      BLOB and TEXT data types TINYBLOB TINYBLOB
      MEDIUMBLOB MEDIUMBLOB
      BLOB BLOB
      LONGBLOB LONGBLOB
      TINYTEXT TINYTEXT
      MEDIUMTEXT MEDIUMTEXT
      TEXT TEXT
      LONGTEXT LONGTEXT
      Enumeration and set data types ENUM ENUM
      SET SET
      JSON data type JSON TEXT (for MySQL tenants of OceanBase Database of a version earlier than V3.2.3) or JSON (for MySQL tenants of OceanBase Database V3.2.3 and later)

      SERIAL and GEOMETRY data types cannot be converted, such as GEOMETRY, GEOMETRYCOLLECTION, POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, and MULTIPOLYGON.

      Notice:

      If an unsupported data type is used, empty DDL statements will be output.

    The following attributes will not be parsed or converted but only ignored when they are specified in incremental DDL statements:

    • COLUMN_FORMAT

    • ENGINE_ATTRIBUTE

    • SECONDARY_ENGINE_ATTRIBUTE

    • STORAGE

      Due to the limits of MySQL tenants of OceanBase Database, an error may be returned when the converted incremental DDL statements are synchronized to a MySQL tenant of OceanBase Database in the following scenarios:

    • The MySQL tenant of OceanBase Database does not support specifying certain functions or expressions in the DEFAULT attribute.

    • The MySQL tenant of OceanBase Database does not support specifying certain functions or expressions in generated columns.

    • The MySQL tenant of OceanBase Database does not support specifying the UNIQUE KEY, PRIMARY KEY, or KEY attribute for certain field types.

    • The MySQL tenant of OceanBase Database does not support certain collations.

  • Create indexes or constraints

    When you create indexes or constraints, you can:

    • Create primary keys.

    • Create unique keys.

    • Create indexes or keys.

    • Create foreign keys on fields, functions, or expressions.

      Specify the ON [DELETE, UPDATE] | RESTRICT | CASCADE | NO ACTION | SET | DEFAULT attribute.

    • Create full-text indexes.

    • Create CHECK constraints in MySQL tenants of OceanBase Database V3.2.3 and later.

    • Create prefix indexes.

    • Specify the ASC or DESC attribute.

      When you create indexes or constraints, you cannot:

    • Create primary keys, unique keys, indexes, keys, or full-text indexes on functions. You can create indexes only on fields.

      Notice

      If incremental DDL statements contain the following unsupported definitions, the whole table creation statement will fail and an empty string will be output.

      Primary key, unique key, index, key, or full-text index definitions that contain functions or expressions. Examples:

        CREATE TABLE functional_index_t1 (col1 INT, PRIMARY KEY (col1, (ABS(col1))));
        CREATE TABLE functional_index_t1(x VARCHAR(30), INDEX idx ((CAST(x->>'$.name' AS CHAR(30)))));
      
    • Create spatial indexes.

    • Specify the ON [DELETE | UPDATE] SET NULL option for foreign keys.

      The following attributes will not be parsed or converted but only ignored when they are specified in incremental DDL statements:

    • USING BTREE or USING HASH

    • KEY_BLOCK_SIZE, index_type, WITH PARSER, COMMENT, VISIBLE | INVISIBLE, ENGINE_ATTRIBUTE, or SECONDARY_ENGINE_ATTRIBUTE in index_option

    • [NOT] ENFORCED for CHECK constraints

    • MATCH FULL | MATCH PARTIAL | MATCH SIMPLE option for foreign keys

      Due to the limits of MySQL tenants of OceanBase Database, an error may be returned when the converted incremental DDL statements are synchronized to a MySQL tenant of OceanBase Database in the following scenarios:

    • The MySQL tenant of OceanBase Database does not support creating primary keys, unique keys, indexes, keys, full-text indexes, or foreign keys on specific types of fields.

    • The MySQL tenant of OceanBase Database does not support specifying certain functions or expressions in CHECK constraints.

    • The MySQL tenant of OceanBase Database does not support specifying certain functions or expressions in FOREIGN KEY constraints.

    • The MySQL tenant of OceanBase Database does not support certain collations.

  • Create partitions

    When you create partitions, you can:

    • Create RANGE, LIST, HASH, or KEY partitions.

    • Create HASH or KEY subpartitions.

    • For RANGE, LIST, and HASH partitions, you can specify a function partitioning key (an expression or a function) or column partitioning key (a field). For KEY partitions, you can specify only a column partitioning key.

    • Specify PARTITIONS number and SUBPARTITIONS number.

      You cannot create LINEAR HASH or LINEAR KEY partitions.

      Notice

      If the DDL statement for creating a partition contains unsupported definitions, the output partition definition is empty, but the schemas are retained (with the partition definition discarded).

    The following attributes will not be parsed or converted but only ignored when they are specified in incremental DDL statements:

    • ENGINE

    • COMMENT

    • DATA DIRECTORY

    • INDEX DIRECTORY

    • MAX_ROWS

    • MIN_ROWS

    • TABLESPACE

    • ALGORITHM (for KEY partitions)

      PARTITION BY KEY ALGORITHM={1 | 2} (column_list) -> PARTITION BY KEY (column_list)

    Due to the limits of MySQL tenants of OceanBase Database, an error may be returned when the converted incremental DDL statements are synchronized to a MySQL tenant of OceanBase Database in the following scenarios:

    • The MySQL tenant of OceanBase Database does not support using fields of certain types as the partitioning key.

    • The MySQL tenant of OceanBase Database does not support using certain functions or expressions as the partitioning key.

ALTER TABLE

When you modify a table, you can operate its columns, constraints, indexes, and partitions, as well as modify its attributes.

  • Operate columns

    When you operate columns, you can add, drop, and modify columns. To be specific, you can:

    • Use ADD COLUMN to add one or more columns, with the FIRST | AFTER keyword being specified.

    • Use ALTER COLUMN SET DEFAULT to modify the default value of a column.

    • Use ALTER COLUMN DROP DEFAULT to drop the default value of a column.

    • Use CHANGE COLUMN or MODIFY COLUMN to change or modify a column.

    • Use DROP COLUMN to drop a column.

    If incremental DDL statements contain the following unsupported definitions, the whole table creation statement will fail and an empty string will be output.

    • ALTER COLUMN SET VISIBLE | INVISIBLE

    • ORDER BY col_name

    • RENAME COLUMN

      ALTER TABLE t RENAME COLUMN d TO g;
      

    If incremental DDL statements contain the MODIFY COLUMN or CHANGE COLUMN clause, the FIRST | AFTER keyword will be ignored.

    Due to the limits of MySQL tenants of OceanBase Database, an error may be returned when the converted incremental DDL statements are synchronized to a MySQL tenant of OceanBase Database in the following scenarios:

    • Using the MODIFY COLUMN or CHANGE COLUMN clause to modify the field type may fail. This is because certain field types are not supported in MySQL tenants of OceanBase Database.

    • Using the MODIFY COLUMN or CHANGE COLUMN statement to modify the field length may fail.

    • Using the ALTER COLUMN SET DEFAULT statement to set a default value may fail. This is because certain functions or expressions are not supported in MySQL tenants of OceanBase Database.

    • You cannot drop columns that are used as primary keys, unique keys, or normal indexes, or columns with FOREIGN KEY constraints.

  • Operate constraints and indexes

    When you operate constraints or indexes, you can add and drop constraints or indexes. To be specific, you can:

    • Use ADD INDEX | KEY to create a normal index.

    • Use DROP INDEX to drop an index.

    • Use ADD FULLTEXT INDEX | KEY to create a full-text index.

    • Use ADD UNIQUE INDEX | KEY to create a unique index.

    • Use ADD FOREIGN KEY to create a foreign key.

      When you operate constraints or indexes, you cannot:

      Notice

      If incremental DDL statements contain the following unsupported definitions, the whole table creation statement will fail and an empty string will be output.

    • Create unique keys, indexes, keys, and full-text indexes on functions. You can create indexes only on fields.

    • Use ADD SPATIAL INDEX.

    • Use ADD PRIMARY KEY.

    • Use DROP PRIMARY KEY.

    • Use ALTER TABLE DISABLE | ENABLE KEYS.

    • Specify the ON [DELETE | UPDATE] SET NULL attribute for foreign keys.

    • In MySQL tenants of OceanBase Database of a version earlier than V3.2.3, you cannot:

      • Use ADD CHECK.

      • Use DROP CHECK.

      • Use ALTER CHECK [NOT] ENFORCED.

      • Use ALTER INDEX VISIBLE | INVISIBLE.

      • Use RENAME INDEX | KEY.

        alter table t rename key k to kk;
        ALTER TABLE T RENAME INDEX b TO w;
        
    • Use ALTER TABLE DISABLE | ENABLE KEYS.

    • Specify the ON [DELETE | UPDATE] SET NULL attribute for foreign keys.

      The following attributes will not be parsed or converted but only ignored when they are specified in incremental DDL statements:

    • USING BTREE or USING HASH

    • KEY_BLOCK_SIZE, index_type, WITH PARSER, COMMENT, VISIBLE | INVISIBLE, ENGINE_ATTRIBUTE, or SECONDARY_ENGINE_ATTRIBUTE in index_option

    • [NOT] ENFORCED for CHECK constraints

    • MATCH FULL | MATCH PARTIAL | MATCH SIMPLE for foreign keys`

      Due to the limits of MySQL tenants of OceanBase Database, an error may be returned when the converted incremental DDL statements are synchronized to a MySQL tenant of OceanBase Database in the following scenarios:

    • The MySQL tenant of OceanBase Database does not support creating primary keys, unique keys, indexes, keys, full-text indexes, or foreign keys on specific types of fields.

    • The MySQL tenant of OceanBase Database does not support specifying certain functions or expressions in CHECK constraints.

    • The MySQL tenant of OceanBase Database does not support specifying certain functions or expressions in FOREIGN KEY constraints.

  • Operate partitions

    When you operate partitions, you can:

    • Use ADD PARTITION to add a RANGE partition.

    • Use ADD PARTITION to add a LIST partition.

    • Use DROP PARTITION to drop a partition.

      When you operate partitions, you cannot:

      Notice

      If incremental DDL statements contain the following unsupported definitions, the whole table creation statement will fail and an empty string will be output.

    • Use ADD PARTITION to add a HASH partition.

    • Use TRUNCATE PARTITION.

    • Use DISCARD PARTITION.

    • Use IMPORT PARTITION.

    • Use COALESCE PARTITION.

    • Use REORGANIZE PARTITION.

    • Use EXCHANGE PARTITION.

    • Use ANALYZE PARTITION.

    • Use CHECK PARTITION.

    • Use OPTIMIZE PARTITION.

    • Use REBUILD PARTITION.

    • Use REPAIR PARTITION.

    • Use REMOVE PARTITIONING.

  • Modify table attributes

    When you modify table attributes, you can:

    • Rename tables.

      alter table tablename rename to new_tablename
      
    • Modify table comments.

      ALTER TABLE t comment = 'table comment'
      

    When you modify table attributes, you cannot:

    • Modify the ALGORITHM attribute.

      ALTER TABLE t ALGORITHM = COPY
      
    • Convert to a specified character set.

      ALTER TABLE t CONVERT TO CHARACTER SET utf16;
      
    • Modify the character set or collation.

      ALTER TABLE T DEFAULT CHARACTER SET utf8
      
    • Specify the DISCARD | IMPORT TABLESPACE attribute.

    • Use ALTER TABLE FORCE.

    • Modify the LOCK attribute: LOCK = DEFAULT | NONE | SHARED | EXCLUSIVE

    • Use ALTER TABLE WITHOUT | WITH VALIDATION.

    • Modify attributes except COMMENT in table_option.

TRUNCATE TABLE

  TRUNCATE [TABLE] tbl_name

RENAME TABLE

When you migrate data from a MySQL database to a MySQL tenant of OceanBase Database, you can execute the RENAME TABLE statement to rename one or more tables.

DROP TABLE

When you migrate data from a MySQL database to a MySQL tenant of OceanBase Database, you can execute the DROP TABLE statement to drop one or more tables.

The following attributes will not be parsed or converted but only ignored when they are specified in incremental DDL statements:

  • TEMPORARY in MySQL tenants of OceanBase Database of a version earlier than V3.2.3

  • IF EXISTS

  • RESTRICT | CASCADE

CREATE INDEX

When you create indexes, you can:

  • Create normal indexes.

  • Create unique indexes.

  • Create prefix indexes.

    create index i on t(c1(2))
    
  • Specify only COMMENT in index_option.

When you create indexes, you cannot:

Notice

If incremental DDL statements contain the following unsupported definitions, the whole table creation statement will fail and an empty string will be output.

  • Create spatial indexes.

  • Create function indexes.

The following attributes will not be parsed or converted but only ignored when they are specified in incremental DDL statements:

  • ASC | DESC

  • KEY_BLOCK_SIZE

  • WITH PARSER

  • VISIBLE | INVISIBLE

  • ENGINE_ATTRIBUTE

  • SECONDARY_ENGINE_ATTRIBUTE

  • ALGORITHM = DEFAULT | INPLACE | COPY

  • LOCK = DEFAULT | NONE | SHARED | EXCLUSIVE

Due to the limits of MySQL tenants of OceanBase Database, you cannot create indexes on specific types of fields. Otherwise, an error may be returned when the converted incremental DDL statements are synchronized to a MySQL tenant of OceanBase Database.

DROP INDEX

When you migrate data from a MySQL database to a MySQL tenant of OceanBase Database, you can drop indexes.

The following attributes will not be parsed or converted but only ignored when they are specified in incremental DDL statements:

  • ALGORITHM = DEFAULT | INPLACE | COPY

  • LOCK = DEFAULT | NONE | SHARED | EXCLUSIVE

Limits of DDL operations in incremental migration

  • If a table to be synchronized involves DDL operations that are not supported, the migration project may fail and unrecoverable data exceptions may be caused.

  • 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 exit unexpectedly or cause unrecoverable data exceptions.

  • 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 exit unexpectedly or cause unrecoverable data exceptions.

  • The table names before and after the RENAME TABLE statement must be both included or both not included in the list of tables to be synchronized.

  • If you enable DDL operations in incremental migration, the DROP INDEX statement is executed on all indexes, which may cause index loss in the destination database.

  • In a DDL operation for incremental migration, if the primary key of a table is data of the FLOAT or DOUBLE type, data inconsistency may occur.

  • If you use gh-ost to synchronize DDL operations in incremental migration from a MySQL database to a MySQL tenant of OceanBase Database:

    • When you select the Specify Objects mode, do not select the table named *_ghc.

    • When you select the Match Rules mode, set Object Exclusion Rules to {database_name}.*_ghc.

Previous topic

Schema migration operations
Last

Next topic

Supported DDL operations in incremental migration from a MySQL tenant of OceanBase Database to a MySQL database and limits
Next
What is on this page
Overview
CREATE TABLE
ALTER TABLE
TRUNCATE TABLE
RENAME TABLE
DROP TABLE
CREATE INDEX
DROP INDEX
Limits of DDL operations in incremental migration