Migrate Data From MySQL to Oracle

How to migrate data from MySQL to Oracle using SQL Loader tool

For example suppose we have a table "Orders" in MySQL running in Windows with the following structure

MySQL Table structure

This table has some 1000 rows and  we need to load these rows into a table in Oracle running under Linux O/s.

Here are the specs of both PC's

Source

Database : MySQL
Table Name: Orders
O/s: Windows
IP Address:192.168.50.1 

Target

Database: Oracle
Table Name: Orders (Doesn't exist)
O/s : Linux
IP Address: 192.168.50.132

To migrate the MySQL table we need to do the following

Step 1

First Export the rows from MySQL table to a CSV or any delimited file. To export the rows we can use HeidiSQL or any other similar tool

To export the rows to a CSV file using HeidiSQL ,

Open HeidiSQL tool in Source PC

Login to MySQL server by typing your username and password

Select the MySQL Database in which "Orders" table is residing from from Left Panel

Expand the database node and select Orders table in the left panel

Then on the right panel, click the on the "Data" tab to view the data from "Orders" table as shown in the picture below

table data

Right Click on any column in the data grid and select "Export Grid Rows" option

export rows

You will see a Export Grid rows dialog window. In this window enter CSV file name as "test.csv" and select "Complete Rows" option and De-Select "Include Column Names" checkbox and click OK

export rows option 

next step

New: Modern Oracle

Concepts here also apply to Oracle 19c/21c/23ai unless a version note says otherwise. See the homepage for what's changed.