OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase AI DatabaseOceanBase Cloud OceanSeekOceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog ServiceOceanBase DataPilotOceanBase OAgent
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Migration Assessment

V5.0.0Enterprise Edition
  • What's New
  • Product Introduction
    • Overview
    • Application scenarios
  • Install OMA
  • Compatibility assessment
    • Overview
    • System architecture
    • Product form
    • Object and Metadata Assessment
    • Assess SQL statement compatibility
    • Sybase ASE assessment
    • Custom rules
    • Database assessment
      • Overview of Database Assessment
      • Assess an Oracle database
      • Assess a MySQL database
      • Assess a TiDB database
      • Assess a PostgreSQL database
    • SQL execution verification
    • Mapper Scan Audit
    • Special Identification and Declaration Association
  • Performance assessment
    • Standalone edition
      • Overview
      • System architecture
      • Product form
      • Assess the performance difference between an Oracle database and an OceanBase database
      • Assess the performance differences between a MySQL database and an OceanBase database
      • Assess the performance differences between different versions of OceanBase Database
      • Log parsing
      • Replay execution
      • Performance statistics and reports
  • Release Notes
    • OMA V5.0.0

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Migration Assessment
  3. V5.0.0

Assess SQL statement compatibility

Last Updated:2026-11-19 09:12:21

Background information
Assess SQL statement compatibility via TEXT files
Assess Oracle-compatible mode
Assess MySQL-compatible mode
Assess SQL statement compatibility via MyBatis files
Source path configuration
Dynamic SQL and fragments
Assess SQL statement compatibility via iBATIS files
View the assessment report

Background information

OMA can assess statements in SQL text, MyBatis, and iBATIS files. You should select the source dialect and a valid target mode based on the actual statements. Common file formats supported are .sql, .ddl, and .txt. You can input a single file or recursively scan a directory. The --source-format option supports the following inputs:

--source-format
Description
sql SQL/DDL text, accepts.sql、.ddl、.txt, single file or recursive directory
mybatis MyBatis Mapper XML
ibatis iBATIS Mapper XML (Unified to Mapper assessment link)

SQL text scanning processes terminators and dialect bodies line by line. The batch separator for SQL Server supports independent GO lines, while the process body for Oracle supports independent / lines.

Assess SQL statement compatibility via TEXT files

Assess Oracle-compatible mode

java -jar oceanbase-compat-engine.jar compat \
  --mode full --task-name oracle_sql \
  --type file --source-type oracle --source-format sql \
  --source /data/oma/input.sql \
  --target oceanbase-oracle --target-ob-version 4.4.2 \
  --report-lang zh --output /data/oma/reports/oracle-sql.html

Assess MySQL-compatible mode

java -jar oceanbase-compat-engine.jar compat \
  --mode full --task-name mysql_sql \
  --type file --source-type mysql --source-format sql \
  --source /data/oma/mysql-sql \
  --target oceanbase-mysql --target-ob-version 4.4.2 \
  --report-lang zh --output /data/oma/reports/mysql-sql.html

Files in the example directory will be scanned recursively. Regular files retain their source path relative to the root scan directory, and identified CREATE objects have their object type and name recorded.

The assessment commands for other dialects (mariadb, postgresql, sqlserver, tidb) follow the same format as above. Replace --source-type and select the target mode as described in Overview of compatibility assessment, for example:

java -jar oceanbase-compat-engine.jar compat \
  --mode full --task-name pg_sql \
  --type file --source-type postgresql --source-format sql \
  --source /data/oma/pg-sql \
  --target oceanbase-mysql --target-ob-version 4.4.2 \
  --report-lang zh --output /data/oma/reports/pg-sql.html

Assess SQL statement compatibility via MyBatis files

Source path configuration

Use --source-format mybatis. You can specify a single Mapper file or the root directory with --source. If cross-file includes exist, the related files should be included in the same scan scope.

java -jar oceanbase-compat-engine.jar compat \
  --mode full --task-name mybatis_sql \
  --type file --source-type mysql --source-format mybatis \
  --source /data/oma/mappers \
  --target oceanbase-mysql --target-ob-version 4.4.2 \
  --report-lang zh --output /data/oma/reports/mybatis-sql.html

Dynamic SQL and fragments

The system parses Mapper namespaces, SQL statements, and referenced fragments, expanding dynamic tags such as include, if, choose, where, set, trim, and foreach. selectKey is collected independently, identified with the parent statement ID plus !selectKey.

The maximum expansion depth for dynamic paths is 256. When exceeded, only the limited path is retained, along with the override pattern and diagnostics recorded; not executing the complete Java/OGNL business runtime does not mean all actual parameter combinations have been exhausted.

Assess SQL statement compatibility via iBATIS files

Use --source-format ibatis, and fill in the remaining parameters according to the source dialect and target mode:

java -jar oceanbase-compat-engine.jar compat \
  --mode full --task-name ibatis_sql \
  --type file --source-type oracle --source-format ibatis \
  --source /data/oma/ibatis \
  --target oceanbase-oracle --target-ob-version 4.4.2 \
  --report-lang zh --output /data/oma/reports/ibatis-sql.html

The iBATIS format is processed via the Mapper assessment pipeline, supporting iBATIS condition tags, dynamic, and iterate structures. For Mapper XML, you must select mybatis or ibatis.

View the assessment report

Open the specified HTML report to view issues and sources. Mapper tasks also output scan audits. When fragments are missing, partially expanded, or parsing is incomplete, you should check the coverage against the audit ledger. For the ledger file list and statistical criteria, see Mapper scan audit.

Previous topic

Object and Metadata Assessment
Last

Next topic

Sybase ASE assessment
Next
on this page
Background information
Assess SQL statement compatibility via TEXT files
Assess Oracle-compatible mode
Assess MySQL-compatible mode
Assess SQL statement compatibility via MyBatis files
Source path configuration
Dynamic SQL and fragments
Assess SQL statement compatibility via iBATIS files
View the assessment report