Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

中文版

small-o2o-compare: Oracle ↔ OceanBase Metadata Comparison Tool

Compare database objects between Oracle and OceanBase (OB-Oracle mode). Generate Excel diff reports and fix SQL scripts — built for "去O" (de-Oracle) migration.

Java CI Java Spring Boot License GitHub release GitHub Stars Blog


Background

During Oracle-to-OceanBase ("去O") migration, comparing database objects between source and target is essential. While it's possible with raw SQL + Excel, this tool provides horizontal alignment and automatic fix-SQL generation, making the process much more efficient.

Supported Comparisons

Category Supported Fix SQL Gen
OB-Oracle ↔ Oracle
Oracle ↔ Oracle
OB-Oracle ↔ OB-Oracle
OB-MySQL ↔ MySQL 🚧 Planned 🚧
MySQL ↔ MySQL 🚧 Planned 🚧

Database Objects

  • Tables & Partition Tables & Temp Tables
  • Columns (name, type, length, nullable, default value)
  • Indexes (unique, normal, function-based)
  • Primary Keys
  • Sequences
  • Views
  • Functions
  • Procedures
  • Packages & Package Bodies
  • Types
  • Synonyms (planned)

Quick Start

Prerequisites

  • Java 8+
  • Maven 3.6+
  • Oracle 11gR2+ / OceanBase (OB-Oracle mode) instance

Configuration

Edit src/main/resources/application-dev.yml:

spring:
  datasource:
    # Source database (e.g. Oracle)
    source:
      url: jdbc:oracle:thin:@host:1521:orcl
      username: your_user
      password: your_pass
    # Target database (e.g. OceanBase)
    target:
      url: jdbc:oceanbase://host:2883/oceanbase
      username: your_user
      password: your_pass

Build & Run

git clone https://github.com/sm-rose/small-o2o-compare.git
cd small-o2o-compare
mvn clean package -DskipTests
java -jar target/small-o2o-compare-0.0.1-SNAPSHOT.jar

API

Once started, access Swagger UI:

http://localhost:8080/swagger-ui.html
  • Compare metadata/compare/execute
  • Export Excel report/compare/export
  • Generate fix SQL/compare/repair

Build from Source

git clone https://github.com/sm-rose/small-o2o-compare.git
cd small-o2o-compare
mvn clean package -DskipTests

Output JAR: target/small-o2o-compare-0.0.1-SNAPSHOT.jar


SQL Reference

The SQL queries used for metadata comparison are documented in the original README (backup) and the docs/ directory.

Key helper functions:

  • LONG_TO_CHAR — Convert DATA_DEFAULT LONG column to readable string
  • INDEX_COLUMN_EXPRESSION — Extract function-based index expressions

Change Log

See change_log.md (if available) or GitHub Releases.


License

GNU General Public License v3.0

About

数据库对象比较工具

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages