©2015 -
Oracle Cross Platform Database Migration
The hardware platform influences the endianness of an Operating System. Majority of the Intel processors are of "Little Endian" while a RISC processor proprietary for UNIX Operating Systems are "Big Endian".
Without going much of technical details of the definition of an Endian, it is just a difference of the methods on how a "Data Word" which comprises of stored bytes are organized and interpreted.
When doing cross-
You cannot directly convert a file from Little Endian To Big Endian or vice versa. If in case there is such a need, the options you have are few and cumbersome which as of this writing, the following are the only options you can go for:
1. Full Data Pump export (if downtime permits, requires source to be Read-
2. Partial Data Pump export (upto an SCN) and configure Golden Gate replication or Dell Shareplex for logical synching of data.
3. Transportable tablespace (needs downtime for read only).
The Oracle Database has a built-
You can run a SQL query as demonstrated below for the listing,
column platform_name format a35;
set linesize 120;
select platform_id, platform_name, endian_format
from v$transportable_platform
order by endian_format;
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
-
3 HP-
6 AIX-
18 IBM Power Based Linux Big
2 Solaris[tm] OE (64-
4 HP-
16 Apple Mac OS Big
1 Solaris[tm] OE (32-
9 IBM zSeries Based Linux Big
17 Solaris Operating System (x86) Little
19 HP IA Open VMS Little
20 Solaris Operating System (x86-
PLATFORM_ID PLATFORM_NAME ENDIAN_FORMAT
-
12 Microsoft Windows x86 64-
13 Linux x86 64-
8 Microsoft Windows IA (64-
21 Apple Mac OS (x86-
11 Linux IA (64-
5 HP Tru64 UNIX Little
10 Linux IA (32-
7 Microsoft Windows IA (32-
15 HP Open VMS Little
20 rows selected.
In this excercise, we'll examine what it takes to convert the database files Little Endian To Little Endian (Solaris 10 x86-
RMAN, which is the backup tool for Oracle databases, provides two types of command to convert a database:
1) Convert Database... To Platform
RMan will convert the database files at the source platform onto a given directory path to store the converted files.
The target directory for the convert can be in a form of NFS mount as served by your intended platform. This is just an option to avoid the process of copying the converted files onto the target platform.
The source database has to be in read only state when running the conversion.
2) Convert Database... On Target
Rman will create a conversion script at the source platform which you will copy onto your target platform along with the source database files and run the conversion at the target.
The source database has to be at least in read only state when copying the files.
Among the two conversion methods, I prefer the Convert Database...To Platform command since it is a lot more concise in terms of implementation especially when used in combination of NFS or other similar file sharing technology to house the converted data files. With a shared file system, it eliminates the need to copy the converted files over to your target platform host.
Again, as I try to explain before, the RMAN Convert Database solution is for migrating the Oracle database across platforms having the same endian format.
So without further ado, here are some of my notes.
RMAN CONVERT DATABASE TO PLATFORM
1. Start the database in READ ONLY
pacific:oradb> sqlplus /nolog
SQL*Plus: Release 10.2.0.5.0 -
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> connect sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup mount pfile=/dsk0/orabin/10gR2/product/10.2.0/db/dbs/initORA10DB1_noDG.ora
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 2101736 bytes
Variable Size 264244760 bytes
Database Buffers 801112064 bytes
Redo Buffers 6283264 bytes
Database mounted.
SQL> alter database open read only;
Database altered.
2. Verify that a conversion is possible.
When running the following procedure, you should only get a single message "PL/SQL procedure successfully completed." to indicate that a conversion has no compatibility issues. Any other message you get would indicate a problem.
Sample output of a compatible endian platform:
At the source db (Solaris 10 x86-
SQL> set serveroutput on;
SQL> declare
2 db_ready boolean;
3 begin
4 db_ready := sys.dbms_tdb.check_db('Linux x86 64-
5 end;
6 /
PL/SQL procedure successfully completed.
SQL>
Sample output, this one failed, cannot convert Linux to Solaris Sparc (little endian to big endian).
SQL>l
1 declare
2 db_ready boolean;
3 begin
4 db_ready := sys.dbms_tdb.check_db('Solaris[tm] OE (64-
5* end;
SQL>/
The specified target platform name 'Solaris[tm] OE (64-
PL/SQL procedure successfully completed.
3. Run the RMAN Convert Database To Platform command.
My target directory to place the converted database files is -
Just keep in mind that if you have subdirectories in your source directory (in my case /dsk0/oradb/ORA10DG1 has dbf,redo,undo and ctl directories) you should create all of them also in your target directory.
pacific:oradb> rman
Recovery Manager: Release 10.2.0.5.0 -
Copyright (c) 1982, 2007, Oracle. All rights reserved.
RMAN> connect target sys
target database Password:
connected to target database: ORA10DG1 (DBID=2552731710)
RMAN> convert database
2> new database 'newdb10'
3> transport script '/dsk0/oradb/convertdb/transportscript.sql'
4> to platform 'Linux x86 64-
5> DB_FILE_NAME_CONVERT '/dsk0/oradb/ORA10DG1','/dsk0/oradb/convertdb';
Starting convert at 23-
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=208 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=207 devtype=DISK
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_2: starting datafile conversion
input datafile fno=00001 name=/dsk0/oradb/ORA10DG1/oradata/dbf/system_1_ORA10DG1.dbf
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00002 name=/dsk0/oradb/ORA10DG1/oradata/undo/undo1_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/undo/undo1_1_ORA10DG1.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:36
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00003 name=/dsk0/oradb/ORA10DG1/oradata/dbf/sysaux_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/sysaux_1_ORA10DG1.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00006 name=/dsk0/oradb/ORA10DG1/oradata/dbf/qtdata_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/system_1_ORA10DG1.dbf
channel ORA_DISK_2: datafile conversion complete, elapsed time: 00:00:44
channel ORA_DISK_2: starting datafile conversion
input datafile fno=00007 name=/dsk0/oradb/ORA10DG1/oradata/dbf/qtindex_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/qtdata_1_ORA10DG1.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00004 name=/dsk0/oradb/ORA10DG1/oradata/dbf/defaultdata_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/qtindex_1_ORA10DG1.dbf
channel ORA_DISK_2: datafile conversion complete, elapsed time: 00:00:03
channel ORA_DISK_2: starting datafile conversion
input datafile fno=00008 name=/dsk0/oradb/ORA10DG1/oradata/dbf/replcdemodat_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/defaultdata_1_ORA10DG1.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00009 name=/dsk0/oradb/ORA10DG1/oradata/dbf/replcdemodat_2_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/replcdemodat_1_ORA10DG1.dbf
channel ORA_DISK_2: datafile conversion complete, elapsed time: 00:00:01
channel ORA_DISK_2: starting datafile conversion
input datafile fno=00010 name=/dsk0/oradb/ORA10DG1/oradata/dbf/replcdemoidx_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/replcdemodat_2_ORA10DG1.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile conversion
input datafile fno=00005 name=/dsk0/oradb/ORA10DG1/oradata/dbf/explainplan_1_ORA10DG1.dbf
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/replcdemoidx_1_ORA10DG1.dbf
channel ORA_DISK_2: datafile conversion complete, elapsed time: 00:00:00
converted datafile=/dsk0/oradb/convertdb/oradata/dbf/explainplan_1_ORA10DG1.dbf
channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:00:01
Run SQL script /dsk0/oradb/convertdb/transportscript.sql on the target platform to create database
Edit init.ora file /dsk0/orabin/10gR2/product/10.2.0/db/dbs/init_00q00e1b_1_0.ora. This PFILE will be used to create the database on the target platform
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 backup at 23-
RMAN>
4. Modify the transport script and copy converted files onto target then run the transport script.
The RMAN Convert Database To Platform command shows that it converted only the database files and undo.
The redo and control files will be created using the transportscript.sql.
If you examine the script, the new init.ora was created at the local ORACLE_HOME/dbs and was referenced by the script.
Copy this init.ora onto the */covertdb/ directory if you are planning to transport the disk containing the converted data onto another server.
Edit the script to provide the correct paths and filename for your control and redo files and the pfile.
If the */convertdb/ path is not the intended path for your database files, you may proceed to create the correct path and copy
the files over and then modify the script to reflect the correct database file path.
Here's a sample content of a transport script:
pacific:oradb> cat transportscript.sql
-
-
-
-
-
-
-
-
-
STARTUP NOMOUNT PFILE='/dsk0/orabin/10gR2/product/10.2.0/db/dbs/init_00q00e1b_1_0.ora'
CREATE CONTROLFILE REUSE SET DATABASE "NEWDB10" RESETLOGS ARCHIVELOG
MAXLOGFILES 36
MAXLOGMEMBERS 3
MAXDATAFILES 1500
MAXINSTANCES 8
MAXLOGHISTORY 1168
LOGFILE
GROUP 1 (
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
) SIZE 10M,
GROUP 2 (
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
) SIZE 10M,
GROUP 3 (
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
) SIZE 10M,
GROUP 4 (
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
'/dsk0/orabin/10gR2/product/10.2.0/db/dbs/arch_D-
) SIZE 10M
DATAFILE
'/dsk0/oradb/convertdb/oradata/dbf/system_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/undo/undo1_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/sysaux_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/defaultdata_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/explainplan_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/qtdata_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/qtindex_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/replcdemodat_1_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/replcdemodat_2_ORA10DG1.dbf',
'/dsk0/oradb/convertdb/oradata/dbf/replcdemoidx_1_ORA10DG1.dbf'
CHARACTER SET AL32UTF8
;
-
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
-
ALTER DATABASE OPEN RESETLOGS;
-
-
-
ALTER TABLESPACE TEMP1G1 ADD TEMPFILE '/dsk0/orabin/10gR2/product/10.2.0/db/dbs/data_D-
SIZE 8388608 AUTOEXTEND ON NEXT 8388608 MAXSIZE 4096M;
ALTER TABLESPACE TEMP2G1 ADD TEMPFILE '/dsk0/orabin/10gR2/product/10.2.0/db/dbs/data_D-
SIZE 8388608 AUTOEXTEND ON NEXT 8388608 MAXSIZE 4096M;
ALTER TABLESPACE TEMP1G2 ADD TEMPFILE '/dsk0/orabin/10gR2/product/10.2.0/db/dbs/data_D-
SIZE 8388608 AUTOEXTEND ON NEXT 8388608 MAXSIZE 4096M;
ALTER TABLESPACE TEMP2G2 ADD TEMPFILE '/dsk0/orabin/10gR2/product/10.2.0/db/dbs/data_D-
SIZE 8388608 AUTOEXTEND ON NEXT 8388608 MAXSIZE 4096M;
-
-
set echo off
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prompt * Your database has been created successfully!
prompt * There are many things to think about for the new database. Here
prompt * is a checklist to help you stay on track:
prompt * 1. You may want to redefine the location of the directory objects.
prompt * 2. You may want to change the internal database identifier (DBID)
prompt * or the global database name for this database. Use the
prompt * NEWDBID Utility (nid).
prompt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SHUTDOWN IMMEDIATE
STARTUP UPGRADE PFILE='/dsk0/orabin/10gR2/product/10.2.0/db/dbs/init_00q00e1b_1_0.ora'
@@ ?/rdbms/admin/utlirp.sql
SHUTDOWN IMMEDIATE
STARTUP PFILE='/dsk0/orabin/10gR2/product/10.2.0/db/dbs/init_00q00e1b_1_0.ora'
-
-
@@ ?/rdbms/admin/utlrp.sql
set feedback 6;
pacific:oradb>