views:

167

answers:

2

Hi community,

After having used an application for over 10 years, and been constantly limited by its lack of extensibility, we have decided to rewrite it fully from scratch. Because the new architecture differs from the old application, the database is also different. Here comes the problem: Is there any industrial process for migrating the data from the previous database to the new one? Some tables are alike, others are not. Overall, we need a process that will help us make sure that no data or logical constraints is lost during the migration.

Thanks

PS: The old and new database are both Oracle databases.

+2  A: 

I've heard of several different ways to attack problems such as this. The most simple solution I've seen is to use a Microsoft Access database and use ODBC connection to connect to both the new and old Oracle databases. You can then use Access to migrate and transform the data as you need.

The more elegant solution involes installing Microsoft SQL Server Development tools. You can use Business Intelligence Development Studio to create a SSIS package with two Oracle endpoints. SSIS can handle the heavy lifting of transforming the data between the databases and you can run the package locally so you don't have to have an instance of SQL Server running anywhere.

There's a tutorial series for SSIS at:

http://www.developerdotstar.com/community/node/364

You might also want to check out Oracle Warehouse Builder (OWB). The name is a little confusing, but it's Oracle's ETL (Extract, Transform, and Load) package. I've never used it personally, but it might do what you're looking to do as well.

Justin Niessner
do you have any good articles or tutorials about how to go about using the Development Studio?
m_oLogin
I'm not sure why you want to use MS Access to transform Oracle data to Oracle data. Whatever you want to do is perfectly possible using SQL and PLSQL within the Oracle database.
Rene
Access is just the simple solution that people typically have on their machines already. It's obviously not the best or suggested solution...but I've definitely heard of it being done. Personally...wouldn't do it myself.
Justin Niessner
@Justin: I'd be careful - mentioning Access in a non-condescending way tends to garner automatic scornful downvotes. To be fair, though, Access is an effective tool for its intended purposes, but migrating Oracle databases is definitely not one of these.
MusiGenesis
@MusiGenesis: I definitely was hoping to avoid the backlash by suggesting the better suggestion. Live and learn I guess.
Justin Niessner
+5  A: 

Although you don't specify this in your question, I assume that you're going to develop the new version of your application/database, and then at some switchover point you need to migrate all of the live data from your old database into your new database.

If this is the case, then you're really asking about two distinct processes: the migration (with some modifications) of the database structure, followed later by the migration of the data itself.

For the first process, the best tool is you, the developer (I don't mean you're a "tool" - you know what I mean). You could bring over the structure of the old database and then change it as necessary for the new version; however, this approach in general tends to leave too much of the old structure behind. I think it's better to take advantage of the situation and rebuild the database from the ground up, using the original database just as a general reference.

For the second process, I would treat the data migration as a separate task requiring a separately-written and -tested application. This application could be a set of scripts or a compiled application or whatever is most convenient for you. Because your old and new databases will not have the same structure (and may in fact be very different), there are no commercial tools out there that will handle this task for you automagically. By treating this as a distinct application that you write yourself, you can test the data conversion process many times before your "go live" date.

MusiGenesis
+1 great answer! thanks a lot, very clear. do you know of places where I could find best practices/tutorials/articles for performing that second process?
m_oLogin
@m_oLogin: there are so many different ways of doing this that it's hard to point you in one direction. I'm sure Oracle itself has tools for copying data from table to table when the table definitions don't match exactly, and the SSIS tool in SQL Server Management Studio that Justin mentions does this (although it seems vaguely wrong to use it for a purely Oracle-to-Oracle job). You could also write an ADO.Net app in C# that used data readers and data writers to copy from table to table.
MusiGenesis
Since it's a relational database, the order in which you copy the tables is obviously important, since foreign key values have to be in place before you can write the foreign keys in the dependent tables. One way around this is to turn off all the key constraints, copy all the tables in any old order, and then turn all the contraints back on.
MusiGenesis
I'll mark this as the correct answer since it pointed me towards the best direction.
m_oLogin