High Availbility

OS & Virtualization

Friday, July 30, 2010

Restoring a 32Bit RMAN backup on 64Bit Operating System

Restoring a 32Bit RMAN backup on 64Bit Operating System

It is possible to restore RMAN backups taken on 32 bit operating system (with 32 bit oracle binaries) to a 64 bit operating system (with 64 bit oracle binaries). But it is preferable to keep the same bit version, but as long as the same operating system platform is maintained the common consensus is this will work.

If you will be running the 64-bit database against the 32-bit binary files or vice versa, after the recovery has ended the database bit version must be converted using utlirp.sql. The utlirp.sql script recompiles existing PL/SQL modules in the format required by the new database. If the version does not include a call to
utlrp, then you must manually run utlrp.sql to recompile invalid objects.

See this note for details on switching between bit sizes:

Note 62290.1 Changing between 32-bit and 64-bit Word Sizes

Example :
======

Things to do on 32 bit server :
+ Take a full backup of database including archivelogs on 32 bit server



 
RMAN> run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
backup database plus archivelog;
backup current controlfile;
}








Things to do on 64 bit server :

+ Make the backups available on 64 bit server
+ Create the pfile or copy the pfile from 32 bit server
+ Startup nomount the instance on the 64 bit server.

+ connect to rman and set the dbid



 
$ rman target / nocatalog
RMAN> set dbid=<dbid from 32 server>;

+ Restore the controlfile
RMAN> restore controlfile from '/disk1/backup/backup_piece_name';
RMAN> alter database mount;
RMAN> restore database;






+ Identify the archivelog till you want to do the recovery and check whether you have all the backups.



 
RMAN> run
{
set until sequence xxxx;
recover database;
}

RMAN> exit

+ Migrating to 64 bit
SQL> recover database until cancel using backup controlfile;
cancel
SQL> alter database open resetlogs migrate;
SQL> @ ?/rdbms/admin/utlirp.sql
Now you must restart the database and explicitly invoke utlrp.sql to recompile invalid objects.
SQL> shutdown immediate;
SQL> startup;
SQL> @ ?/rdbms/admin/utlrp.sql

SQL> shutdown immediate;
SQL> startup






The database is now opened to use.