Monday 1 August 2011

Migrating database from 32 bit to 64 bit

In order to migrate oracle database from 32 bit to 64 bit, we used the following RMAN restore method.

1. Ensure the new 64 bit OS has the 64 bit Oracle binary installed and configured.

2. Create the pfile of the database on the 64 bit. This can simply be copied from 32 bit. Make sure it is updated with correct files locations if it is different on the new server.

3. Take the full backup of the database via RMAN on the 32 bit by running the following command:
RMAN> run 
{ 
allocate channel c1 type disk; 
allocate channel c2 type disk; 
backup database plus archivelog; 
backup current controlfile; 
} 

4. Copy backup files to the 64 bit server.

5. Start the database on 64 bit in nomount state:
SQL> startup nomount;

6. Connect to RMAN and set the dbid:
$ rman target /
RMAN> set dbid=<dbid from 32 server>; 

7. Restore the controlfile and database:
RMAN> restore controlfile from '<location of the backup>'; 
RMAN> alter database mount; 
RMAN> restore database; 

 
8. Recover database to the point you want. If all the backups are available, then recover the database to the latest archivelog:
RMAN> run 
{ 
set until sequence xxxx; 
recover database; 
} 

RMAN> exit 

9. Once the recovery is done, perform the following tasks in order to start the database on 64 bit platform:
SQL> recover database until cancel using backup controlfile; 
cancel 
SQL> alter database open resetlogs migrate; 
SQL> @ ?/rdbms/admin/utlirp.sql 
SQL> shutdown immediate;
SQL> startup;
SQL> @ ?/rdbms/admin/utlrp.sql

SQL> shutdown immediate;
SQL> startup

10. The database is now ready to be used.

NOTE: If the database that is migrated has a standby database as well, then the standby database should be recreated since the primary database was started in resetlogs mode.

No comments:

Post a Comment