oracle
mongodb

Migrate Oracle to MongoDB

Beta — live-tested path

MongoDB has no fixed schema, so there is no column-type table for this direction: each Oracle row becomes one document, and the section below shows how each kind of value lands. DBShifts copies the rows in parallel batches and checks the result with row counts.

Start Oracle → MongoDB Migration

Free tier · no credit card

Oracle vs MongoDB

oracle

Oracle

Oracle Database, the long-standing enterprise standard.

mongodb

MongoDB

the leading document database.

How values land in MongoDB

MongoDB has no fixed schema, so there's no column-type table to show — this is what actually happens to each value on the way in.

  • NUMBER / DECIMAL values are stored as exact Decimal128, never a lossy float — well beyond a 64-bit integer, up to Decimal128's 34 significant digits. An Oracle NUMBER can carry 38, and the extra digits have no exact BSON form.
  • DATE columns with no time component land as a BSON date at midnight UTC — BSON has no date-only type.
  • Oracle has no native TIME type (already stored as text on the Oracle side), so time-only values stay as an ISO-8601 string in MongoDB too.
  • TIMESTAMP columns become native BSON dates.
  • Each row becomes one document — there's no fixed collection schema to map into, so this is about value fidelity, not a type-mapping table.

Example: Oracle to MongoDB conversion

Oracle

CREATE TABLE users (
  id NUMBER GENERATED BY DEFAULT AS IDENTITY NOT NULL,
  name VARCHAR2(255) NOT NULL,
  is_active NUMBER(1) DEFAULT 1,
  created_at TIMESTAMP DEFAULT SYSTIMESTAMP
);

MongoDB

{
  id: 1,
  name: "Ada Lovelace",
  is_active: true,
  created_at: ISODate("2026-01-15T10:30:00Z")
}

A document cannot exceed 16 MB

Each Oracle row becomes one document, and a BSON document has a hard 16 MB limit. Oracle CLOB and BLOB columns can hold gigabytes, so a row carrying a large file or a long text body cannot be written as one document at all.

Find those rows first: SELECT max(DBMS_LOB.GETLENGTH(col)) FROM t on each LOB column. Large binaries usually belong in GridFS or object storage with a reference in the document, and moving them there is a design decision best made before the migration.

Constraints stay behind in Oracle

Oracle enforced foreign keys, CHECK constraints and NOT NULL on every write. MongoDB enforces none of them. Relationships arrive as ids in fields, a query that joined two tables now needs $lookup or a document that embeds the related data, and ON DELETE CASCADE becomes code the application runs.

The old primary key arrives as an ordinary field next to MongoDB's own _id. If the application looks rows up by it, make sure a unique index exists on that field before the first new write, or nothing stops two documents claiming the same id.

Oracle → MongoDB conversion notes

Engine-specific rules baked into the conversion and transfer pipeline — verified by live certification of this exact pair.

  • NUMBER columns are fetched as exact decimals (38 digits), not lossy floats.
  • Identifier case differences (Oracle uppercases unquoted names) are reconciled automatically during transfer.
  • Empty string = NULL semantics are accounted for in validation so comparisons stay honest.
  • Rows become flat documents; write errors surface loudly instead of being swallowed by duplicate-tolerance settings.
  • Integers beyond BSON's 8-byte range (e.g. Oracle NUMBER) become Decimal128, exact up to its 34 significant digits.
  • Dates are stored as native BSON dates (UTC instants).

Frequently asked questions

Is Oracle to MongoDB migration production-ready in DBShifts?

Oracle to MongoDB is in beta. It runs on real servers in the certification suite, which checks it by row counts; the content checks that certify the SQL pairs do not yet compare documents with rows. Every migration still ends with a fidelity report to audit before cutover.

Can I keep Oracle and MongoDB in sync after the initial migration?

Yes, until you cut over. DBShifts reads Flashback Version Query between SCNs, from an SCN captured before the first row is copied. A change has to still be in undo when it is read, so undo retention sets how long the stream can pause.

Go deeper

Ready to move Oracle to MongoDB?

Set up in under two minutes. Validation and rollback included.

Start Free Migration