cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Best approach and tools for migrating from Oracle to Databricks?

Office_Solution
New Contributor III

Hey everyone,

We're planning to migrate our data warehouse from Oracle to Databricks. We have a mix of standard tables and a good amount of legacy PL/SQL code to deal with.

What is the best way to approach this migration? specifically:

1) How do you usually handle converting PL/SQL script over to PySpark or Databricks SQL ?

2) Are there any recommended migration migration tools or accelerators that actually work well ?

3) What's the cleanest way to handle ongoing data sync / CDC from Oracle ?

Would appreciate any advice or tool recommendations. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Abhishek20
New Contributor II

Migrating an Oracle data Warehouse with heavy PL/SQL logic to Databricks is tough. Here is a practical, direct way to approach it:

1) Converting PL/SQL: Standard SQL queries migrate easily to Databricks SQL, but procedural code doesn't translate natively. Refactor procedural logic into set based Databricks SQL where possible, or move complex loops into PySpark notebooks.

2) Migration Tools: Manually auditing PL/SQL is brutal. Teams usually rely on custom Python scripts to scan Oracle system catalogs for dependencies, combined with code conversion tools or accelerators like pulse convert to speed up symtax translation.

3) Ongoing CDC: Use Delta livr tables with auto loader for incremental ingestion or pair Databrickd with dedicated CDC tools for live Oracle replication

View solution in original post

3 REPLIES 3

Valeria_Koz_DBX
Databricks Employee
Databricks Employee

Hi @Office_Solution, good question.

Here's how I'd approach it, taking your three questions in turn.

  1. Converting PL/SQL
  • First, a lot of PL/SQL doesn't need to become PySpark. Databricks SQL now has SQL scripting and stored procedures (BEGINโ€ฆEND, variables, cursors, error handlers), so many procedures can stay in SQL. There are two conversion tools:
    • Genie Migrate is built into the workspace and supports Oracle. It converts your .sql files to Databricks SQL or notebooks and checks both syntax and business logic. It runs on Genie Code, so usage beyond the free monthly allowance is billed.
    • Lakebridge is a free Databricks Labs project. Its BladeBridge converter handles Oracle with repeatable rules, and Switch (experimental, LLM-based) is meant for complex procedures.
  • Whichever tool you use, rewrite row-by-row cursor loops as set-based MERGE statements rather than translating them line by line. That's where most of the performance gain comes from.

  1. Tools that actually help
  • Beyond conversion, Lakebridge has two steps people often skip:
    • Analyzer scores how hard each script will be to convert, so you can plan the work.
    • Reconcile compares Oracle and Databricks data at schema, row and column level, so you can prove the numbers match before cutover.
  1. CDC from Oracle
    • There's a native Lakeflow Connect Oracle connector (Beta). It reads changes through LogMiner, and your DBA needs to turn on archive log mode and supplemental logging. Check the limitations first: Oracle RAC (including Exadata in a RAC setup) isn't supported, and some data types (XMLTYPE, JSON, spatial) aren't either. If you're on RAC, a partner CDC tool is the safer route for now.
  • One trap to watch: Oracle treats an empty string as NULL, and Databricks doesn't. Oracle DATE columns also include a time. Both give you numbers that are slightly wrong without any error, which is another reason to run Reconcile.

Do you know roughly how many PL/SQL procedures you have, and whether your Oracle runs on RAC? That would decide which route makes sense.

In general, I will approach your request as a phased plan 

  1. Assess. Run Lakebridge (free, Databricks Labs). Its Profiler sizes your Oracle database, and its Analyzer scores how hard each PL/SQL script will be to convert. That tells you where the effort is before you commit to a plan.
  2. Land the data. Do an initial load, then keep it in sync with the Lakeflow Connect Oracle connector (Beta, LogMiner-based, supports SCD type 2). Check the limitations before you choose it: Oracle RAC isn't supported, including Exadata in a RAC setup. If that's you, use a partner CDC tool instead. While you migrate, Lakehouse Federation lets you query Oracle in place for comparisons.
  3. Convert the code. Use Genie Migrate in the workspace or Lakebridge's converters (BladeBridge for repeatable rule-based output, Switch for complex procedures). Many procedures can land as Databricks SQL stored procedures, not PySpark. Rewrite row-by-row cursor loops as set-based MERGE, and move trigger logic into the pipeline.
  4. Prove the numbers. Run Lakebridge Reconcile to compare Oracle and Databricks at schema, row and column level. Watch the quiet differences: an empty string is NULL in Oracle but not in Databricks, Oracle DATE includes a time, and NUMBER columns without a precision need a deliberate DECIMAL mapping.
  5. Run both, then cut over. Keep both systems running in parallel for a reporting cycle or two, then switch reports over and turn off CDC.

Hope this helps

 

balajij8
Esteemed Contributor III

For converting legacy PL/SQL, begin with Genie Migrate (agentic SQL converter). It supports the Oracle dialect and outputs either Databricks SQL or notebooks using the DataFrame API, while iteratively validating and fixing the converted code before writing it out. The approach here is to batch convert in small groups - start by testing 2 files first and verifying semantic equivalence against the actual data. Rather than keeping stored procedures and packages as monolithic scripts, you can restructure them into Lakeflow Jobs. It allows the job orchestration to replace legacy PL/SQL control flow like cursors, loops and exception blocks, while heavy procedural logic lands inside individual notebook tasks.

On the migration side, you can check - Genie Migrate for the code conversion, Lakehouse Federation (read only foreign catalog to query Oracle in place, ideal for validating parity between old and new logic before cut over) and managed CDC connector in Lakeflow Connect for data movement. Set up federation first for parity checking, establish CDC sync, cut over the converted code and then decommission the Oracle tables in waves.

For ongoing data sync and CDC, you can use Oracle integrated CDC connector in Lakeflow Connect. It runs as a managed pipeline (captures an initial snapshot and then stream inserts, updates, and deletes directly into Delta streaming tables). Keep in mind that the connector is in Beta and carries limitations. You can also use Qlik Replicate or AWS DMS to land changes into cloud storage and use Auto Loader pick it up from there.

Abhishek20
New Contributor II

Migrating an Oracle data Warehouse with heavy PL/SQL logic to Databricks is tough. Here is a practical, direct way to approach it:

1) Converting PL/SQL: Standard SQL queries migrate easily to Databricks SQL, but procedural code doesn't translate natively. Refactor procedural logic into set based Databricks SQL where possible, or move complex loops into PySpark notebooks.

2) Migration Tools: Manually auditing PL/SQL is brutal. Teams usually rely on custom Python scripts to scan Oracle system catalogs for dependencies, combined with code conversion tools or accelerators like pulse convert to speed up symtax translation.

3) Ongoing CDC: Use Delta livr tables with auto loader for incremental ingestion or pair Databrickd with dedicated CDC tools for live Oracle replication