Cross-Platform Database Migration

      1 Comment on Cross-Platform Database Migration

Cross Platform Database Migration Window’s To Linux:
1-To convert the database from one platform to another, the endian format of both databases should be the same.  So as a first step, check the v$transportable_platform view for both platforms.

select name,platform_id,platform_name from v$database;


——— ———–    ———————————-

india           12         Microsoft Windows x86 64-bit

SQL> column platform_name format a35
SQL> set pagesize 1000

SQL> select * from v$transportable_platform order by 2;


———– ———————————– ————–

6 AIX-Based Systems (64-bit)           Big
16 Apple Mac OS                        Big
21 Apple Mac OS (x86-64)               Little
19 HP IA Open VMS                      Little
15 HP Open VMS                         Little
5 HP Tru64 UNIX                        Little
3 HP-UX (64-bit)                       Big
4 HP-UX IA (64-bit)                    Big
18 IBM Power Based Linux               Big
9 IBM zSeries Based Linux              Big
10 Linux IA (32-bit)                   Little
11 Linux IA (64-bit)                   Little
13 Linux x86 64-bit                    Little
7 Microsoft Windows IA (32-bit)        Little
8 Microsoft Windows IA (64-bit)        Little
12 Microsoft Windows x86 64-bit        Little
17 Solaris Operating System (x86)      Little
20 Solaris Operating System (x86-64)   Little
1 Solaris[tm] OE (32-bit)              Big
2 Solaris[tm] OE (64-bit)              Big

20 rows selected.

It is seen from the output that both the Windows and Linux operating systems are in the little endian format.  So in this case, RMANcan be easily used to convert the whole database.

2-Bring database to the mount mode and open it with the read only option.

SQL>shutdown immediate SQL>startup mount SQL>alter database open read only; Database altered.

3-Use dbms_tdb.check_db function to check whether the database can be transported to a target platform and the dbms_tdb.check_external function to check for existence of external objects, directories and BFILEs.  Pass the name of the destination platform as a parameter to the first function.  The return type of the function is boolean, so declare a variable with boolean type and call the function as follows:

SQL>set serveroutput on

SQL>declare v_return boolean;

begin v_return:=dbms_tdb.check_db(‘Linux x86 64-bit’); end;


PL/SQL procedure successfully completed.

If nothing was returned, then it means that the database is ready to be transported to the destination platform.

Now call the second function dbms_tdb.check_external

SQL>declare v_return boolean;

begin v_return:=dbms_tdb.check_external;

end; /

The following directories exist in the database: SYS.ORACLECLRDIR, SYS.XMLDIR, SYS.DATA_PUMP_DIR, SYS.ORACLE_OCM_CONFIG_DIR PL/SQL procedure successfully completed. These objects will not be created on the transported database. ——————————————————————————————————————–

create pfile=’C:\TEST\pfile.ora’ from pfile;

4- Run the convert database command to convert the whole database to the Linux platform.


RMAN>convert database new database ‘linuxdb’ transport script ‘c:\test\transport.sql’ db_file_name_convert ‘C:\ORACLEXE\APP\ORACLE\ORADATA\XE\’ ‘c:\test\’ to platform ‘Linux x86 64-bit’;

RMAN> convert database new database ‘linuxdb’ 2> transport script ‘c:\test\transport.sql’ 3> db_file_name_convert ‘C:\ORACLEXE\APP\ORACLE\ORADATA\XE\’ 4> ‘c:\test\’ to platform ‘Linux x86 64-bit’;

Starting conversion at source at 17-JUN-15 using channel ORA_DISK_1

Directory SYS.ORACLECLRDIR found in the database Directory SYS.XMLDIR found in the database Directory SYS.DATA_PUMP_DIR found in the database Directory SYS.ORACLE_OCM_CONFIG_DIR found in the database.User SYS with SYSDBA and SYSOPER privilege found in password file channel ORA_DISK_1: starting datafile conversion input datafile file number=00002


converted datafile=C:\TEST\SYSAUX.DBF channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:25 channel ORA_DISK_1: starting datafile conversion input datafile file number=00001 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\SYSTEM.DBF converted datafile=C:\TEST\SYSTEM.DBF channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile conversion input datafile file number=00003 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\UNDOTBS1.DBF converted datafile=C:\TEST\UNDOTBS1.DBF channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile conversion input datafile file number=00004 name=C:\ORACLEXE\APP\ORACLE\ORADATA\XE\USERS.DBF converted datafile=C:\TEST\USERS.DBF channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:03

Edit init.ora file C:\ORACLEXE\APP\ORACLE\PRODUCT\11.2.0SERVER\DATABASE\INIT_00Q9OIS5_1_0.ORA.  This PFILE will be used to createthe database on the target platform.

Run SQL script C:\TEST\TRANSPORT.SQL on the target platform to create database To recompile all PL/SQL modules,  run utlirp.sql and utlrp.sql on the target platform To change the internal database identifier, use DBNEWID Utility Finished conversion at source at 17-JUN-15.

Open the read only tablespace in read write mode. and crosscheck the database and version.



1 thought on “Cross-Platform Database Migration

Leave a Reply

Your email address will not be published. Required fields are marked *