Migrating a Microsoft Access Database to Oracle

This tutorial describes how to migrate a Microsoft Access Database to Oracle.

Approximately 30 minutes

This tutorial covers the following topics:

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.

Using Oracle SQL Developer Migration Workbench, you can quickly migrate your Microsoft Access database to Oracle. There are four main steps in the database migration process:

Capture the Source Database
Convert the Captured Database Oracle SQL Developer Migration Workbench uses the Captured Model to convert the captured 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 Database Oracle SQL Developer Migration Workbench generates DDL statements to create the new 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. You can create a connection from within Oracle SQL Developer to your Microsoft Access source database and migrate the data, or you can export the data from Microsoft Access. Microsoft Access will create a series of sqlldr files that you can run from a batch file. The second method is what you will perform in this tutorial.

Before you perform this tutorial, you should:

1.

Install Oracle Database 9.2.0.1 or above.

2.

Install Oracle SQL Developer 1.2.1.

3. Download and unzip the msamigrate.zip file into your working directory. The files in this zip file will be used throughout the tutorial.

Back to Topic List

The first step to managing database objects using Oracle SQL Developer is to create a database connection. Perform the following steps:

1.

From the directory where you installed Oracle SQL Developer, double-click on sqldeveloper.exe.

 

2.

In the Connections tab, right-click Connections and select New Connection.

 

3.

Enter system_orcl for the Connection Name (or any other name that identifies your connection), system for the Username and <your_password> for the Password, specify your <hostname> for the Hostname and enter orcl for the SID. Then click Test.

 

4.

The status of the connection was tested successfully. The connection was not saved however. To save the connection, click Connect.

 

5.

The connection was saved and you see the database in the list. Expand system_orcl.

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.

 

6.

Right click on Other Users and select Create User.

 

7.

Enter OMWBREP for the User Name, omwbrep for the Password and Confirm Password, USERS for the Default Tablespace and TEMP for the Temporary Tablespace. Then click the Roles tab.

 

8.

Select the Granted checkbox for the CONNECT role and scroll down in the list.

 

9.

Select the Granted checkbox for the RESOURCE role and click the System Privileges tab.

 

10.

Select the Granted checkbox for the CREATE SESSION and CREATE VIEW privileges and click Apply.

 

11.

The OMWBREP user was created successfully.

 

In order for the Microsoft Access XML to be converted to Oracle, you need to create a repository to store the required repository tables and PL/SQL packages. Perform the following steps:

1.

Before you create the repository, you need to create a connection to the OMWBREP user. Right click Connection and select New Connection.

 

2.

Enter omwbrep_orcl for the Connection Name (or any other name that identifies your connection), omwbrep for the Username and omwbrep for the Password and enter orcl for the SID. Then click Connect.

 

3.

Now you can create the repository in this users connection. Right click on the omwbrep_orcl connection and select Associate Migration Repository.

 

4.

The progress window appears.

 

5.

Once the repository is built successfully, click Close.

 

6.

Click OK.

 

Back to Topic List

At this point, you can capture the Microsoft Access Exported XML into Oracle SQL Developer. Perform the following steps:

1.

Select Migration > Capture Microsoft Access Exported XML.

 

2.

Click Browse... to find the XML file. The files are in the \SQLDev_HOS\Migration\files directory.

 

3.

Select Northwind.xml from the list and click Open.

 

4.

Click OK.

 

5.

The objects are being captured. When done, click Close.

 

6.

Under Captured Models, expand Northwind (Access).

 

7.

Expand Northwind to see the list of objects that were captured.

 

Back to Topic List

The next step is to convert the captured model to an Oracle model. Perform the following steps:

1.

Right-click the captured model Northwind (Access) 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.

 

3.

The conversion is performed. When done, click Close.

 

4.

Expand Converted Model (Northwind).

 

5.

Expand Northwind.

 

Back to Topic List

You can now generate the SQL script with DDL statements that can be run to create the objects in an Oracle Database. Perform the following steps:

1.

Under Converted Objects, right click Converted Northwind (Access) and select Generate.

 

2.

The Oracle SQL is being generated. When done, click Close.

 

3.

The SQL from the script is shown. Click the Run Script icon.

 

4.

Select the system_orcl connection and click OK.

 

5.

The results are display from the script execution.

 

6.

Now that your scripts have run successfully, you can create a connection for the Northwind user. Right click Connection then select New Connection.

 

7.

Enter northwind-migrated_orcl for the Connection Name (or any other name that identifies your connection), Northwind for the Username and northwind for the Password and enter orcl for the SID. Then click Connect.

 

8.

Expand northwind-migrated_orcl.

 

9.

Expand Tables.

 

10.

Notice that the database tables that were converted to Oracle are listed. Select the EMPLOYEES table.

 

11.

Select the Data tab.

 

12.

Notice that there currently is no data in the table. You will migrate the data in the next topic of this tutorial.

 

Back to Topic List

The data has already been exported into scripts from Microsoft Access. You will import the data using the scripts provided. Perform the following steps:

1.

Open a DOS command prompt and execute the following commands:

cd <location where files are>
oracle_ctl

The location of the files is \SQLDev_HOS\Migration\files\data

oracle_ctl is a bat file that contains statements to load the data. It uses sqlldr to load the data.

 

2.

Switch to Oracle SQL Developer and click Refresh to see that the data has been loaded for the CUSTOMERS table.

 

3.

The data for the table has been loaded successfully.

 

Back to Topic List

In this tutorial, you learned how to:

Create the OMWBREP User
Create the Migration Repository
Capture the Microsoft Access Exported XML
Convert to the Oracle Model
Generate and Execute the Script to Create the Oracle Database Objects
Migrate the Data

Back to Topic List

Move your mouse over this icon to hide all screenshots.