OceanBase logo

OceanBase

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

Product Overview
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

OceanBase

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

Product Overview
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

V4.3.1Enterprise Edition

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    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. V4.3.1
    iconOceanBase Migration Service
    V 4.3.1Enterprise 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

    Change the type of a constrained column

    Last Updated:2026-04-14 07:36:29  Updated
    Share
    What is on this page
    Change the type of a PRIMARY KEY column
    Change the type of a UNIQUE KEY column
    Change the type of a column with a CHECK constraint
    Change the type of a FOREIGN KEY column

    folded

    Share

    This topic describes the incompatibilities between an Oracle database and an Oracle-compatible tenant of OceanBase Database in changing the data types of columns that have different constraints.

    Note

    • In the following tables, the supported target types of columns in Oracle-compatible tenants of OceanBase Database are results of type mapping.
    • In the following tables, a hyphen (-) indicates none and 'All' indicates all types.

    Change the type of a PRIMARY KEY column

    The following table describes the incompatibilities between an Oracle database and an Oracle-compatible tenant of OceanBase Database in changing the type of a PRIMARY KEY column by using the ALTER TABLE table_name MODIFY DDL statement.

    Column type in Oracle database
    Supported target type
    Column type in Oracle-compatible tenant of OceanBase Database
    Supported target type
    INTEGER All NUMBER(38,0) -
    INT All NUMBER(38,0) -
    SMALLINT All NUMBER(38,0) -
    BINARY_FLOAT All BINARY_FLOAT -
    BINARY_DOUBLE All BINARY_DOUBLE -
    DECIMAL All NUMBER -
    DEC All NUMBER -
    NUMERIC All NUMBER -
    REAL All NUMBER -
    FLOAT All FLOAT -
    NUMBER All NUMBER -
    NCHAR All NCHAR -
    CHAR All CHAR -
    CHARACTER All CHAR(n) -
    NVARCHAR2 All NVARCHAR2(size) -
    VARCHAR2 All VARCHAR2 -
    VARCHAR All VARCHAR2 -
    RAW All RAW -
    ROWID All ROWID UROWID
    UROWID All UROWID ROWID
    TIMESTAMP All TIMESTAMP -
    DATE All DATE -
    INTERVAL YEAR TO MONTH All INTERVAL YEAR TO MONTH -
    INTERVAL DAY TO SECOND All INTERVAL DAY TO SECOND -

    Change the type of a UNIQUE KEY column

    The incompatibilities between an Oracle database and an Oracle-compatible tenant of OceanBase Database in changing the type of a UNIQUE KEY column by using the ALTER TABLE table_name MODIFY DDL statement are the same as that in changing the type of a PRIMARY KEY column.

    Change the type of a column with a CHECK constraint

    The following table describes the incompatibilities between an Oracle database and an Oracle-compatible tenant of OceanBase Database in changing the type of a column that has a CHECK constraint by using the ALTER TABLE table_name MODIFY DDL statement.

    Column type in Oracle database
    Supported target type
    Column type in Oracle-compatible tenant of OceanBase Database
    Supported target type
    INTEGER NUMERIC\NUMBER\DECIMAL\DEC\FLOAT\REAL\INT\SMALLINT NUMBER(38,0) -
    INT NUMERIC\NUMBER\DECIMAL\DEC\FLOAT\REAL\INTEGER\SMALLINT NUMBER(38,0) -
    SMALLINT NUMERIC\NUMBER\DECIMAL\DEC\FLOAT\REAL\INTEGER\INT NUMBER(38,0) -
    BINARY_FLOAT - BINARY_FLOAT -
    BINARY_DOUBLE - BINARY_DOUBLE -
    DECIMAL NUMERIC\NUMBER\DEC\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    DEC NUMERIC\NUMBER\DECIMAL\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    NUMERIC NUMBER\DEC\DECIMAL\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    REAL NUMBER\DEC\DECIMAL\FLOAT\INT\SMALLINT\INTEGER NUMBER -
    FLOAT NUMERIC\NUMBER\DEC\DECIMAL\REAL\INT\SMALLINT\INTEGER FLOAT -
    NUMBER NUMERIC\DEC\DECIMAL\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    NCHAR CHAR\CHARACTER\NVARCHAR2\VARCHAR2\VARCHAR NCHAR -
    CHAR NCHAR\CHARACTER\NVARCHAR2\VARCHAR2\VARCHAR CHAR -
    CHARACTER NCHAR\CHAR\NVARCHAR2\VARCHAR2\VARCHAR CHAR -
    NVARCHAR2 NCHAR\CHAR\CHARACTER\VARCHAR2\VARCHAR NVARCHAR2 -
    VARCHAR2 NCHAR\CHAR\CHARACTER\NVARCHAR2\VARCHAR VARCHAR2 -
    VARCHAR NCHAR\CHAR\CHARACTER\NVARCHAR2\VARCHAR2 VARCHAR2 -
    RAW - RAW -
    ROWID - ROWID UROWID
    UROWID - UROWID ROWID
    TIMESTAMP DATE TIMESTAMP -
    TIMESTAMP WITH LOCAL TIME ZONE - TIMESTAMP WITH LOCAL TIME ZONE -
    DATE TIMESTAMP DATE -
    INTERVAL YEAR TO MONTH - INTERVAL YEAR TO MONTH -
    INTERVAL DAY TO SECOND - INTERVAL DAY TO SECOND -

    Change the type of a FOREIGN KEY column

    The following table describes the incompatibilities between an Oracle database and an Oracle-compatible tenant of OceanBase Database in changing the type of a FOREIGN KEY column by using the ALTER TABLE table_name MODIFY DDL statement.

    Column type in Oracle database
    Supported target type
    Column type in Oracle-compatible tenant of OceanBase Database
    Supported target type
    INTEGER NUMERIC\NUMBER\DECIMAL\DEC\FLOAT\REAL\INT\SMALLINT NUMBER(38,0) -
    INT NUMERIC\NUMBER\DECIMAL\DEC\FLOAT\REAL\INTEGER\SMALLINT NUMBER(38,0) -
    SMALLINT NUMERIC\NUMBER\DECIMAL\DEC\FLOAT\REAL\INTEGER\INT NUMBER(38,0) -
    BINARY_FLOAT - BINARY_FLOAT -
    BINARY_DOUBLE - BINARY_DOUBLE -
    DECIMAL NUMERIC\NUMBER\DEC\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    DEC NUMERIC\NUMBER\DECIMAL\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    NUMERIC NUMBER\DEC\DECIMAL\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    REAL NUMBER\DEC\DECIMAL\FLOAT\INT\SMALLINT\INTEGER NUMBER -
    FLOAT NUMERIC\NUMBER\DEC\DECIMAL\REAL\INT\SMALLINT\INTEGER FLOAT -
    NUMBER NUMERIC\DEC\DECIMAL\FLOAT\REAL\INT\SMALLINT\INTEGER NUMBER -
    NCHAR CHAR\CHARACTER NCHAR -
    CHAR NCHAR\CHARACTER CHAR -
    CHARACTER NCHAR\CHAR CHAR -
    NVARCHAR2 VARCHAR2\VARCHAR NVARCHAR2 -
    VARCHAR2 NVARCHAR2\VARCHAR VARCHAR2 -
    VARCHAR VARCHAR2 , NVARCHAR2 VARCHAR2 -
    RAW - RAW -
    ROWID - ROWID UROWID
    UROWID - UROWID ROWID
    TIMESTAMP - TIMESTAMP -
    TIMESTAMP WITH LOCAL TIME ZONE - TIMESTAMP WITH LOCAL TIME ZONE -
    DATE - DATE -
    INTERVAL YEAR TO MONTH - INTERVAL YEAR TO MONTH -
    INTERVAL DAY TO SECOND - INTERVAL DAY TO SECOND -

    Previous topic

    Incompatibilities of ALTER TABLE
    Last

    Next topic

    Change the type of an unconstrained column
    Next
    What is on this page
    Change the type of a PRIMARY KEY column
    Change the type of a UNIQUE KEY column
    Change the type of a column with a CHECK constraint
    Change the type of a FOREIGN KEY column