Tuesday, February 10, 2009

Database Migration From Windows to Linux Using RMAN

This task was on the "todo" pile for a awhile now and I had already tried it once. We have an old database on a Windows XP pretty close to kernel death and we wanted desperaly to deploy it on a Enterprise Linux without losing any data and if possible not have to create the schemas.
Due to time limits I had little success on the first attempt, although I now see that I was not that far off!

My second attempt was mainly trigged by a this post on Alejandro Vargas' Blog. His guide is based on the RMAN command CONVERT DATABASE .

It worked out great for my case, but you can find alternatives (Metalink ID: 733205.1):
  1. Export / Import to include the use of Datapump facilities. all versions support Export/Import but for Datapump 10.1.0.2 or higher is required
  2. Transportable Tablespaces 10G or Later
  3. RMAN Convert Database functions. 10G or Later
The third has the advantage of being multi-schema, that it is to say, that you don't need to create the users on the new database, which was a task requirement on my case.

Alejandro Vargas' post is pretty good and straigh forward. RMAN allows you to generated converted datafiles, along with a new control file and a transport script. These files can be then sent to the the new machine and with some editing on the script and control file, the new instance is created with the all the data from the previous one.

The most touble you may find is edting the transport script. In my case I couldn't understand why the script wouldn't upload the users datafile, along with the users. I later understood: Oracle was pretty much foling Oracle!!

Any way, Alejandro's receipe is a great help, and based on the Metalinks, it gave me the extra information I just need to complete this important task.

Any issue feel free to email me.