Compare database objects between Oracle and OceanBase (OB-Oracle mode). Generate Excel diff reports and fix SQL scripts — built for "去O" (de-Oracle) migration.
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.
| Category | Supported | Fix SQL Gen |
|---|---|---|
| OB-Oracle ↔ Oracle | ✅ | ✅ |
| Oracle ↔ Oracle | ✅ | ✅ |
| OB-Oracle ↔ OB-Oracle | ✅ | ✅ |
| OB-MySQL ↔ MySQL | 🚧 Planned | 🚧 |
| MySQL ↔ MySQL | 🚧 Planned | 🚧 |
- 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)
- Java 8+
- Maven 3.6+
- Oracle 11gR2+ / OceanBase (OB-Oracle mode) instance
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_passgit 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.jarOnce started, access Swagger UI:
http://localhost:8080/swagger-ui.html
- Compare metadata →
/compare/execute - Export Excel report →
/compare/export - Generate fix SQL →
/compare/repair
git clone https://github.com/sm-rose/small-o2o-compare.git
cd small-o2o-compare
mvn clean package -DskipTestsOutput JAR: target/small-o2o-compare-0.0.1-SNAPSHOT.jar
The SQL queries used for metadata comparison are documented in the original README (backup) and the docs/ directory.
Key helper functions:
LONG_TO_CHAR— ConvertDATA_DEFAULTLONG column to readable stringINDEX_COLUMN_EXPRESSION— Extract function-based index expressions
See change_log.md (if available) or GitHub Releases.
