Migrating MSSQL To Oracle Sqldev
Migrating MSSQL To Oracle Sqldev
This tutorial shows you how to migrate a Microsoft SQL Server database to Oracle Database 11g using Oracle SQL Developer.
Time to Complete
Approximately 30 minutes
Topics
Overview
Prerequisites
Creating the mwrep User
Creating the Migration Repository
Capturing the Microsoft SQL Server Exported Files
Checking Conversion Preferences
Converting to the Oracle Model
Generating and Executing the Script to Create the Oracle Database Objects
Checking Offline Data Move Preferences
Analysis and Estimation
Migrating the Data
Testing and Deployment
Summary
Viewing Screenshots
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all
screenshots simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot
associated with that step. You can hide an individual screenshot by clicking it.
Overview
Oracle SQL Developer is a free graphical tool that enhances productivity and simplifies database development tasks. Using Oracle
SQL Developer, you can browse database objects, run SQL statements, edit and debug PL/SQL statements and run reports, whether
provided or created.
Using Oracle SQL Developer Migration Workbench, you can quickly migrate your third-party database to Oracle.
Capture the Source The first step is to capture a "snapshot" of the Microsoft SQL Server database. This can be done
Database in two ways.
1. Online Capture: This requires creating a connection in SQL Developer to a live Microsoft
SQL Server database. Using JDBC, the Microsoft SQL Server database metadata can
be accessed and the Capture Model created.
2. Offline Capture: This involves BCP scripts generated by SQL Developer to extract the
Microsoft SQL Server database metadata to files. These files can then be "captured" by
SQL Developer to create the Captured Model.
1 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
Using SQL Developers Offline Capture feature, the Microsoft SQL Server Northwind sample
database has been extracted into offline data files. The SQLServer2005.ocp file generated by
the Capture tool contains the database schema information for the Microsoft SQL Server
Northwind Traders database. Oracle SQL Developer Migration Workbench uses this file as the
basis for building a representation of the structure of the source Microsoft SQL Server database.
This structure is called the Captured Model.
Convert the Oracle SQL Developer Migration Workbench uses the Captured Model to convert the captured
Captured Database objects to Oracle-format objects, building up a representation of the structure of the destination
database. This structure is called the Converted Model.
Generate the Oracle Oracle SQL Developer Migration Workbench generates DDL statements to create the new
Database Oracle database, based upon the Converted Model objects. Running the DDL statements will
result in the creation of the objects in the Oracle database.
Migrate the Data The last step in the process is to migrate the data. You can do this in one of two ways.
1. Online Data Move: You can create a connection from within Oracle SQL Developer to
your Microsoft SQL Server source database and migrate the data.
2. Offline Data Move: You can export the data from Microsoft SQL Server. SQL
Developer</font> will create a series of BCP and sqlldr files that you can run from a
batch file.
In this tutorial, the required scripts for the offline migration have already been generated and modified. If you do not have time to
perform this tutorial, you can also view the offline method, click here.
Prerequisites
Note: If you already have a system_orcl connection and a mwrep user, you can skip these steps.
2 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
3. In the Connections tab, right-click Connections and select New Connection. A New / Select Database
Connection window will appear.
4. Enter system_orcl in the Connection Name field (or any other name that identifies your connection), system for the
Username field, and <your password> for the Password field. Select the Save Password check box. Enter
<hostname> in the Hostname field and orcl in the SID field. Click Test.
3 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
5. Check for the status of the connection on the left-bottom side (above the Help button). It should read Success. To
save the connection, click Connect. Close the window.
4 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
6. The connection is saved and you can see it listed under Connections in the Connections tab.
Note: When a connection is opened, a SQL Worksheet is opened automatically. The SQL Worksheet allows you to
execute SQL against the connection you just created.
5 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
8. Enter the following code in the SQL Worksheet to create a user for the migration repository
6 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
To convert the Microsoft SQL Server database to Oracle, you need to create a repository to store the required repository tables and
PL/SQL packages. To do this, perform the following steps:
Note: If you already have a mwrep_orcl connection and a migration repository for it, you can skip these steps.
1. Before you create the repository, you need to create a connection to the mwrep user. In the Connections tab, right-
click Connections and select New Connection. A New / Select Database Connection window will appear.
7 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
2. Enter mwrep_orcl in the Connection Name field (or any other name that identifies your connection), mwrep for the
Username and Password fields. Select the Save Password check box. Enter <hostname> in the Hostname field
and orcl in the SID field. Click Test.
3. Check for the status of the connection on the left-bottom side (above the Help button). It should read Success. To
save the connection, click Connect. Close the window.
8 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
4. The connection is saved and you can see it listed under Connections in the Connections tab.
5. Right-click the mwrep_orcl connection and select Migration Repository > Associate Migration Repository.
9 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
8. Click OK.
10 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
The procedure for creating the Microsoft SQL Server database scripts has been completed for you and the files are available in the
zip file provided in the prerequisites. To view this procedure, click here.
To load the captured Microsoft SQL Server database scripts into Oracle SQL Developer, perform the following steps:
1. Select Migration > Third Party Database Offline Capture > Load Database Capture Script Output.
11 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
12 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
It is important to review the conversion preferences at this point. To do so, perform the following steps:
13 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
To convert the captured model to the Oracle model, perform the following steps:
1. Right-click the captured model SQLServer2005 and select Convert to Oracle Model.
2. The Set Data Map window appears, which shows you the Source Data Type and what it will be converted to in the
Oracle Model. Click Apply.
14 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
15 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
Generating and Executing the Script to Create the Oracle Database Objects
To generate the SQL script with DDL statements that will be executed to create the objects in an Oracle Database, perform the
following steps:
16 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
3. The SQL from the script is shown. Select system_orcl from the drop-down on the right. icon.
17 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
6. Now that your scripts have run successfully, you can create a connection for the dbo_Northwind user. Right-click
Connection and select New Connection.
18 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
7. Enter dbo_northwind-migrated_orcl in the Connection Name field (or any other name that identifies your
connection), dbo_Northwind for the Username and Password fields. Select the Save Password check box. Enter
<hostname> in the Hostname field and orcl in the SID field. Click Test.
8. Check for the status of the connection on the left-bottom side (above the Help button). It should read Success. To
save the connection, click Connect. Close the window.
19 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
20 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
21 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
11. The database tables that were converted to Oracle are listed. Select the EMPLOYEES table.
12. Select the Data tab. Notice that currently there is no data in the table. You will migrate the data later in this tutorial.
A date format masks can be specified in the preferences so that the Offline Data Move scripts and in particular the Oracle
SQL*Loader control files can reference the correct format. To do so, perform the following steps:
22 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
23 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
Click OK.
24 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
The migration from Microsoft SQL Server to an Oracle database can be straightforward. But it is worth noting that some objects and
syntax are not automatically migrated. Therefore manual intervention is required.
Analyzing the Capture Model, identifying the number, type and complexity of objects , can help calculate the estimated time required
for manual tasks.
The following Reports can be used with your own task and project estimation.
The data has already been generated from Microsoft SQL Server. To view the steps, click here.
To import the data using the scripts provided, perform the following steps:
25 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
<prompt> oracle_ctl
The files are located in the Data directory where you unzipped the files provided in the prerequisites section.
oracle_ctl is a bat file that contains statements to load the data. It uses sqlldr to load the data.
26 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
6. Double-click the first cell under the PICTURE column and click ....
27 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
Depending on the complexity of the database being migrated, a large part of the migration project could be testing.
28 of 29 4/8/2019, 12:25 PM
Migrating a Microsoft SQL Server Database to Oracle Database 11g https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/hol08/sq...
Currently Oracle does not provide any tools that can automatically validate a migrated database for you. This phase of the migration
should be planned and taken into account before the migration begins.
Summary
29 of 29 4/8/2019, 12:25 PM