Friday, February 6, 2015

Minimize database downtime when moving an Oracle DB to a new server

Minimize database downtime when moving an Oracle DB to a new server

My Oracle 10gR2 database is currently on a Windows 2003 32-bit server.  I am planning to migrate to Oracle10g R2 on another Windows 2008 64-bit server for better performance.   What is the best method to do so? My main concern is database downtime.  The total database size is around 200GB.

The first thing to do is to install Oracle 10gR2 64-bit on your new server. Then use the Database Configuration Assistant (DBCA) to precreate a new database on that server. If you want this to go the fastest way possible, use the same exact directory structure for your database files on your new Win 2008 server as you are using on your Win 2003 server. Also, make sure the new database name is the same name as the old database. To minimize downtime, the fastest way is to copy the database datafiles from the old server to the new server. You can use this method because your original platform is Windows and your new platform is Windows. Follow these steps after you have precreated the database on the new server.

1. SHUTDOWN IMMEDIATE the database on the Win 2003 server.
2. SHUTDOWN IMMEDIATE the database on the Win 2008 server.
3. On the Win 2008 server, delete the database datafiles, online redo log files, and the control files.
4. Map a drive from the Win 2008 server to the Win 2003 server.
5. Copy the datafiles, online redo logs, and control files from the Win 2003 server to the Win 2008 server, keeping the file directory placement the same.
6. STARTUP your database on the Win 2008 server.

The step that will take the longest is step 5. But doing a file copy is much faster than other methods.

This procedure works because you are not changing platforms. From Oracle's file's perspective, 32-bit Win 2003 is the same platform as 64-bit Win 2008. We first create a dummy db on the Win 2008 server to get the server set up and configured for the database. We then copy the files over to the new server and since the directory structure and database name are the same, it just starts right up!

No comments: