|
|
|
BROWSE
All Titles WordPress Web Services SOA BPEL Web Graphics & Video Web Development RAW Portugues, Espanol, Italiano, French PHP/MySQL Oracle Open Source Networking & Telephony Moodle Microsoft & .NET Linux Servers jQuery Joomla! JBoss Java e-Learning e-Commerce Dynamics Drupal CRM Cookbook Content Management Beginner Guides Architecture and Analysis AJAX Future Titles Recently Published Titles See More |
Migrating MS Access 2003 Data using the Oracle SQL Developer 1.2
In this article, Jayaram Krishnaswamy shows how to migrate an MS Access database to an Oracle 10G XE Server, describing all the steps involved in the migration process. IntroductionBusiness needs often necessitate data migration from a smaller, less secure database to a higher end, faster database server with a more reliable availability. A typical scenario is the migration of data from a desktop sized database such as MS Access or Fox Pro to any other higher end database servers such as MS SQL Server, Oracle, DB2 or SQL Anywhere Server. Most of the database vendors provide tools to migrate from third party to their own database servers. In his three previous articles, the author has described the built-in tools to migrate from MS Access to SQL 2000 Server, SQL Anywhere Server, and from Oracle 10G XE to SQL Anywhere server. In an earlier article on this site, the author showed how you may connect to an MS Access 2003 database and execute SQL statements using the Oracle SQL Developer 1.2 tool. In this tutorial the author shows you how to migrate an MS Access database to an Oracle 10G XE Server delineating all the steps involved in the migration process. Oracle SQL Developer 1.2 with this latest version is sometimes called the Migration version as it supports migrating data from three vendors (MySQL, SQL Server and MS Access) to an Oracle database. In fact, it has been designed to migrate from more than one version of MS Access. This feature was not available in the version 1.1 of this tool. Overview of this TutorialLike in the earlier article, a simple MS Access 2003 database file will be created with just one table, a query and a linked table. This database file, about 292 KB, will be migrated to Oracle 10G XE database. Oracle 10G XE, by design, can have just one database on a computer. However, you can have separate applications by having different user schemas. Oracle 10G XE comes bundled with a sample database schema and data which can be accessed by using the credentials, username hr with a password hr. For the purposes of this example a new user will be created and his authentication will be used for creating necessary migration related schemas to be stored in a repository. This will become clear as you follow the various details and the steps. Once the ‘Repository’ is created then you can begin by capturing the metadata of the source followed by converting the captured source information into Oracle specific model where a mapping between the source data and the Oracle will be accomplished. After this process, you generate the data definition language script which will create the Oracle objects such as tables, views, etc. In the final step these tables will be populated by transferring the data from the source to Oracle 10G XE. MS Access 2003 SourceAn empty MS Access database file TestMigration.mdb is created in the default directory, My Documents. An Employees table will be imported, an Orders table will be linked and a TestQuery based on selecting a few columns of Employees table will be created. The Employees table and the Orders table may be found in the Northwind Database that ships with most of the MS Access versions. ![]() Creating a New User in Oracle 10G XEAs described in the overview, the MS Access Database will be migrated to a User schema in Oracle 10G XE, but this requires reating this schema. Only a user with DBA privileges can create a new user. Open the Homepage of the Oracle 10G XE Server. Login with the credentials you supplied while installing the software where the user is system and the password is what you chose at that time, as shown in the next figure. ![]() ![]() Create a new user MigrateAccess with some password that you choose and confirm. Keep the account status unlocked. This uses the default tablespace called USERS. The default user privilege does not include the DBA role but for this example, the DBA is also included by placing a check mark in this selection. Also several other system wide privileges are also granted. Please follow steps described in the earlier article for the details. The next figure shows all the details filled in. ![]() After this when you click the Create button you will have created the user, MigrateAccess. When you click the button Create, you will notice that the ‘bread crumb’ will change to Manage Database Users. You will notice that the new user MigrateAccess has been added to the list of users, as shown in the next figure. As no expiry was set for this user in the previous screen, you can notice that there is no expiry shown in the following screen. ![]() Now if you logout (remember you logged in as SYSTEM) and login with the new credentials, MigrateAccess/[chosen password] you can access all the tools on the database. Of course, all the objects (tables, views, etc) will be empty. Creating the Repository to Store SchemasMigration using this tool requires an Oracle database schema to store the Meta data it collects about the source. You will create a connection from the Oracle SQL Developer to the Oracle 10 XE, in which, you just finished creating a new user schema. This user’s schema is where the repository contents will be stored.Making a connection to the OracleRight click on the Connections node, and from the drop-down menu select New Connection. This brings up the New / Select Database Connection (this has been described in the earlier referenced article) window. It comes up with the default connection to an Oracle database. It even recognizes the local Oracle 10G XE, capturing all its details as shown. You need to provide a Connection Name, a Username and a Password. The connection name is your choice (herein called conMigrate) and the user name and password is the same that was used while creating the new user MigrateAccess. When you click on the button ‘Test’, a (success) status message will be posted to this form above the Help button, as shown in the next figure after a little while, preceded by a little progress window.![]() Now click on the OK button on the New / Select Database Connection window. This adds the conMigrate connection to the list of Connections as shown in the next figure. Notice that objects are all empty as we discussed earlier. ![]() Create RepositoryClick on the main menu item Migrate. From the drop-down, click on Repository Management –> Create Repository as shown in the next figure.![]() This brings up the Create Repository window showing the connection conMigrate as shown in the next figure. You may connect or disconnect this from the tool as long as the authentication information is available. ![]() Now click on the Create button. This brings up the Installing Repository window which reports the various objects installed and finally shows a message “Repository Built Successfully” as shown in the next figure. ![]() Click on the Close button on this window. Now login to the Oracle 10G XE with the credentials for the user MigrateAccess, and click on the object browser. Now you see all the Tables, Views, etc in the repository as shown. ![]() You will notice that either two more windows, named captured and converted models appear below the Connections node in Oracle SQL Developer, or if they are not found in the Connections node, you may find in the submenu of the main menu, View. The next figure shows the submenus of the View menu. ![]() Connect to the Source DatabaseRight click on the connection node and establish a new connection so that you can connect to the source database, conTestMigration as shown in the next figure. When you click the Test button you will see a message that gets posted to the screen indicating the connection was a success. Click on the Connect button. This adds the conTestMigrate connection to the list of Connections in the navigator window.![]() Books from Packt
Capturing Source Meta DataRight click on the conTestMigrate connection and from the drop-down menu click on Capture Microsoft Access submenu as shown in the next figure.![]() This opens up the Capturing Database window/progress bar which also brings up the MS Access database. After a while the message Capture Done is posted as shown in the Capturing Database window. ![]() The captured objects are available in the captured objects window which can be accessed from the View menu as shown. Although the connection used was conTestMigration (to connect to the TestMigration database) it is not very clear, why yet another database (Charts, Charts.mdb does exist in My Documents) has also appeared. You can expand the nodes and look at all the tables (Their contents as well), views etc. Additionally by right clicking each of the objects you can rename, or update the data type. Here, no alterations were made. ![]() Converting Captured Model to Oracle ModelNow right click on the TestMigration node in the Captured Models window in the navigator and from the drop-down click on Convert to Oracle Model. This opens up a Set Data Map window showing source data types together with the Oracle data types [22 data types]. By placing a check mark you may view only those data types that are relevant to the source data as shown in the next figure.![]() Clicking on the Add New Rule button you may be able to edit the data type to a different acceptable one, as shown in the next figure. Here, the defaults are used. ![]() Now click on the Apply button. This brings up the Converting Database window which doubles as a progress bar as well. When the process is complete, you get a message Convert Done posted to the page as shown. ![]() Click on the Close button. Now you can see the converted objects by accessing this window in the View menu as before. The expanded view of the table in the converted scheme is shown in the next figure (see Figure 16 for the source). ![]() Generating the Data Definition Language for New Objects in OracleIn the converted model you can right click on an object, or a group of objects (such as a table), or the whole model and from the drop-down menu. Click on Generate as shown in the next figure. In the figure shown, the DDL will be generated for all the objects in the TestMigration converted objects.![]() Clicking on Generate submenu item brings up the Generating Oracle SQL window which also shows the progress in the SQL generation as shown in the next figure. When the generation of SQL is complete a Generation Done message will be posted to this window as shown. ![]() Click on the Close button on this window. The script generated by the above now shows up in the Enter SQL Statement window in the SQL Worksheet as shown. ![]() The full text of this script is shown in the next paragraph. Listing 1 SET SCAN OFF; Essentially a new schema TestMigrate, will be created in Oracle 10G XE when this script is run whose authentication is (Username/Password) TestMigrate/TestMigrate. The script when executed will create all the objects. Creating New User and Schema ObjectsNow when you run this script, you will have created all the objects. You can click on the Run Script (F5), as shown, to run the generate script.![]() This brings up the Select Connection window as shown where you need to specify a connection. The oracle connection conMigrate is chosen as shown. ![]() When you choose the conMigrate, some of the information gets displayed in the Select Connection window as shown. ![]() Now click on the OK button. After the script is successfully run, the Script Output window shows the result of running the script as shown. ![]() Reviewing Meta Data in Oracle 10G XENow you can login to Oracle 10G XE with the credentials [username/password] TestMigration/TestMigration and browse the objects clicking on the Object browser. You will be seeing all the objects created. The meta data is there but the objects are empty of data.![]() Copying the DataIn the previous step you have all the meta data, but the data in the source needs to be transferred to those objects. Click on the Main menu Migrate and from the drop-down choose Migrate Data as shown in the next figure.![]() This brings up the Data Move Details window. Click on the drop-down handles appropriately and choose the source and target connections as shown. You may have to choose the Converted Model as well although there is just one in this example. ![]() Click on the OK button on the Data Move Details window after making all the selections. This brings up the Moving Data to Oracle window which also displays progress. The final display when the tables are completed, is as shown in the figure. ![]() Close this window by clicking the Close button. Reviewing Migrated DataNow login to the Oracle 10G XE once again, to the user schema TestMigration with username/password pair to match TestMigration/TestMigration, and click on the object browser as before. Now you see the data in the Employee table as shown. Data movement during movement of data to Oracle was sluggish and the button has to be clicked a couple of times before the Completed Tables showed up.![]() Similarly the view TESTQUERY is created from the MS Access query, TestQuery in the source as shown. ![]() Similarly, you can view indexes, triggers etc. The linked table, of course, does not migrate. ConclusionOracle SQL Developer 1.2 is an excellent tool for migrating MS Access 2003 database to Oracle 10G XE. The steps are clear and well laid out. The data mapping between the source and the target is very clear and can be modified. Also as described, the capturing process showed objects other objects in addition to the intended ones (see Figure 15). Not sure if this is a bug. Copying the data step had to be clicked multiple times before the Completed Tables showed up.Dr. Jay Krishnaswamy a graduate of the Indian Institute of Science, Bangalore writes on database and web development related topics to several computer programming related web sites. He is an active participant in several forums and discussion groups. Before working in the IT industry as a Microsoft Certified Trainer and a Siebel Certified consultant he taught at several institutes of technology and universities in India, Australia, Brazil and the USA. Links to his articles may be found at his web site or the blog. He lives in Plainsboro, NJ, USA and may be reached at jkrishnaswamy@comcast.net
Books from Packt
Friday, July 20, 2007 | Microsoft & .NET
This article by Jayaram Krishnaswamy shows how you can develop a VB.NET 2.0 application using the integration features provided by the SQL Anywhere database. The SQL Anywhere tools are directly accessible without going out of the Visual Studio 2.O IDE. The article describes a window application with two examples developed with this easy to use integration interface. SQL Anywhere also provides a DataWindow specifically for .NET but this is not included in this article. See More |
BOOK ![]() ODP.NET Developer’s Guide: Oracle Database 10g Development with Visual Studio 2005 and the Oracle Data Provider for .NET See More BOOK ![]() PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax See More BOOK ![]() Creating your MySQL Database: Practical Design Tips and Techniques See More See More | ||||||||||||||||||||||
| ||||||||