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

Interactive Tutorials

V1.0.0

  • Get Started with OceanBase Cloud
  • Explore Compatibility with OceanBase Cloud
  • Explore Complex SQL Performance with OceanBase Cloud
  • Explore High Compression of OceanBase Cloud
  • Explore Multi-Tenancy of OceanBase Cloud

Download PDF

Get Started with OceanBase Cloud Explore Compatibility with OceanBase Cloud Explore Complex SQL Performance with OceanBase Cloud Explore High Compression of OceanBase Cloud Explore Multi-Tenancy of OceanBase Cloud
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. Interactive Tutorials
  3. V1.0.0
iconInteractive Tutorials
V 1.0.0

Explore Compatibility with OceanBase Cloud

Last Updated:2024-06-21 03:03:07  Updated
share
What is on this page
Limitations
Procedure
Overview of the Sample SQL File
Complete SQL Statements

folded

share

OceanBase supports both the open-source MySQL ecosystem and the commercial Oracle ecosystem. You can choose to create MySQL-compatible or Oracle-compatible tenants within a single instance. Compatibility covers SQL syntax, keywords, objects, and usage habits, supporting stored procedures, C language interfaces, precompilers, etc. Applications can be migrated to OceanBase with minimal or no changes, saving enterprises significant human and time costs. This tutorial uses a simple database example to demonstrate OceanBase Cloud’s compatibility with MySQL through the Compatibility Assessment feature provided by OceanBase Cloud.

Limitations

It is not supported for users with the Project Member role to create offline assessment tasks.

Procedure

  1. Download the sample SQL file.

  2. Click to enter the Compatibility Assessment page.

  3. Click Create to create a compatibility assessment.

  4. Click Offline Assessment.

  5. On the Create Offline Assessment page, fill in the following fields:

    Field Description
    Task Name The system automatically creates an assessment task name for you. You can customize the name according to your needs.
    Cloud Vendor Select AWS.
    Source Database Type Select Aurora MySQL.
    Region Select ap-southeast-1.
    Data Source Select SQL.
    Upload File Upload the sample SQL file you downloaded in Step 1 here.
  6. Click Start Assessment. You can find the assessment task you just created on the compatibility assessment list page.

  7. After the assessment task is completed, click View Report on the compatibility assessment list page to view the generated report.

    The compatibility assessment report displays all collected SQL statements and evaluates their compatibility. The report shows the compatibility of the uploaded file and lists all assessment objects. You can click on the assessment object type under Compatibility Details to view more details. For more detailed information about the report, refer to View and download a compatibility assessment report.

Overview of the Sample SQL File

The client-demo.sql file uses a course management system as an example, covering common database operations, including creating tables, indexes, views, data partitioning, etc.

Complete SQL Statements

  1. Create the Students table

    CREATE TABLE IF NOT EXISTS students (
        student_id INT AUTO_INCREMENT PRIMARY KEY,
        name VARCHAR(255) NOT NULL,
        registration_date DATE NOT NULL,
        INDEX idx_registration_date (registration_date)
    ) ENGINE=InnoDB
    $$
    
  2. Create the Courses table

    CREATE TABLE IF NOT EXISTS courses (
        course_id INT AUTO_INCREMENT PRIMARY KEY,
        title VARCHAR(255) NOT NULL,
        credits INT NOT NULL
    ) ENGINE=InnoDB
    $$
    
  3. Create the Teachers table

    CREATE TABLE IF NOT EXISTS teachers (
        teacher_id INT AUTO_INCREMENT PRIMARY KEY,
        name VARCHAR(255) NOT NULL
    ) ENGINE=InnoDB
    $$
    
  4. Create the Course Schedules table with partitioning

    CREATE TABLE IF NOT EXISTS course_schedules (
        schedule_id INT AUTO_INCREMENT PRIMARY KEY,
        course_id INT NOT NULL,
        teacher_id INT,
        schedule_time DATETIME NOT NULL,
        INDEX idx_schedule_time (schedule_time)
    ) ENGINE=InnoDB
    PARTITION BY RANGE(YEAR(schedule_time)) (
        PARTITION p2020 VALUES LESS THAN (2021),
        PARTITION p2021 VALUES LESS THAN (2022),
        PARTITION p2022 VALUES LESS THAN (2023),
        PARTITION p2023 VALUES LESS THAN (2024),
        PARTITION p_future VALUES LESS THAN MAXVALUE
    )
    $$
    
  5. Create the view: Course and Teacher

    CREATE VIEW `vw_course_teacher` AS
    SELECT 
        c.course_id,
        c.title AS course_title,
        c.credits,
        t.name AS teacher_name
    FROM courses AS c
    LEFT JOIN course_schedules AS cs ON c.course_id = cs.course_id
    LEFT JOIN teachers AS t ON cs.teacher_id = t.teacher_id;
    $$
    
  6. Create the view: Upcoming Courses

    CREATE VIEW `vw_upcoming_courses` AS
    SELECT 
        c.title AS course_title,
        t.name AS teacher_name,
        cs.schedule_time
    FROM course_schedules AS cs
    JOIN courses AS c ON cs.course_id = c.course_id
    JOIN teachers AS t ON cs.teacher_id = t.teacher_id
    WHERE cs.schedule_time BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 1 WEEK);
    $$
    
  7. Create the view: Student Registration

    CREATE VIEW `vw_student_registration` AS
    SELECT 
        student_id,
        name AS student_name,
        registration_date
    FROM students;
    $$
    

Previous topic

Get Started with OceanBase Cloud
Last

Next topic

Explore Complex SQL Performance with OceanBase Cloud
Next
What is on this page
Limitations
Procedure
Overview of the Sample SQL File
Complete SQL Statements