Cross-Platform Migration using Rman Convert Database

The proposed methodology is not a SAP supported migration methodology. Following a successful migration and a GoLive OS Migration Check Analysis, SAP will resume support of the migrated system given the GoLive check is successful.

The procedure below describes the process between AIX and HP-UX.

 

 

On source system

  • Check that source and destination database have equal / greater than 10.2.0 version

SQL> select version from v$instance;

VERSION

-----------------

10.2.0.2.0

  • Check that the source and destination platform belong to same ENDIAN format

SQL> set linesize 200

SQL> set pages 999

SQL> select PLATFORM_NAME, ENDIAN_FORMAT from V$TRANSPORTABLE_PLATFORM;

PLATFORM_NAME ENDIAN_FORMAT

----------------------------------------------------------------------------------------------------- --------------

Solaris[tm] OE (32-bit) Big

Solaris[tm] OE (64-bit) Big

Microsoft Windows IA (32-bit) Little

Linux IA (32-bit) Little

AIX-Based Systems (64-bit) Big

HP-UX (64-bit) Big

HP Tru64 UNIX Little

HP-UX IA (64-bit) Big

Linux IA (64-bit) Little

HP Open VMS Little

...

19 rows selected.

  • Identify datafiles that contain undo segments (only those will be converted)

SQL>select distinct(file_name) from dba_data_files a, dba_rollback_segs b where a.tablespace_name=b.tablespace_name;

FILE_NAME

--------------------------------------------------------------------------------

/oracle/SID/sapdata1/undo_1/undo.data1

/oracle/SID/sapdata1/system_1/system.data1

  • Open database in read only mode

SQL> shutdown immediate;

SQL> startup mount;

SQL> alter database open read only;

  • Check whether the database can be transported to the HP-UX IA platform

SQL> set serveroutput on

SQL>declare db_ready boolean;
begin db_ready := dbms_tdb.check_db('
HP-UX IA (64-bit)');
end;

/

PL/SQL procedure successfully completed.

  • Check whether external tables, directories or BFILEs exist. RMAN are unable to transport such files

SQL> set serveroutput on

SQL>declare external boolean;
begin external := dbms_tdb.check_external;
end;
/

The following directories exist in the database:

SYS.DATA_PUMP_DIR

PL/SQL procedure successfully completed.

  • Run RMAN CONVERT DATABASE command on the source platform with ON TARGET PLATFORM argument

RMAN> connect target /

RMAN> convert database on target platform

convert script '/convertdb/convert.rman'

transport script '/convertdb/transport.sql'

new database ''

format '/convertdb/%U';

This command produces 3 files in /convertdb (or any other staging area): a transport script to create a new database, a convert script containing RMAN CONVERT DATAFILE command for each of the datafiles and a PFILE for the new database containing the same settings as the source database

  • Copy the following files to the destination host:

1. transport.sql

2. convert.rman

3. Pfile generated by the convert database command.

4. Copy system  and undo datafiles to stage area

5. Copy rest of datafiles to final location on destination server

 

On target system

  • Edit the init.ora and change the environment specific parameters
  • Create a dummy Controlfile  in order  to convert

SQL>startup nomount;

SQL> CREATE CONTROLFILE REUSE DATABASE "" RESETLOGS NOARCHIVELOG

MAXLOGFILES 255

MAXLOGMEMBERS 3

MAXDATAFILES 254

MAXINSTANCES 50

MAXLOGHISTORY 1168

LOGFILE

GROUP 1 (

'/oracle/SID/origlogA/log_g11m1.dbf',

'/oracle/SID/mirrlogA/log_g11m2.dbf'

) SIZE 50M,

GROUP 2 (

'/oracle/SID/origlogB/log_g12m1.dbf',

'/oracle/SID/mirrlogB/log_g12m2.dbf'

) SIZE 50M,

GROUP 3 (

'/oracle/SID/origlogA/log_g13m1.dbf',

'/oracle/SID/mirrlogA/log_g13m2.dbf'

) SIZE 50M,

GROUP 4 (

'/oracle/SID/origlogB/log_g14m1.dbf',

'/oracle/SID/mirrlogB/log_g14m2.dbf'

) SIZE 50M

-- STANDBY LOGFILE

DATAFILE

'/oracle/stage/system.data1',

'/oracle/stage/undo.data1',

'/oracle/SID/sapdata1/sysaux_1/sysaux.data1',

'/oracle/SID/sapdata2/sr3_1/sr3.data1',

'/oracle/SID/sapdata2/sr3_2/sr3.data2',

'/oracle/SID/sapdata2/sr3_3/sr3.data3',

'/oracle/SID/sapdata2/sr3_4/sr3.data4',

'/oracle/SID/sapdata3/sr3700_1/sr3700.data1',

'/oracle/SID/sapdata3/sr3700_2/sr3700.data2',

'/oracle/SID/sapdata3/sr3700_3/sr3700.data3',

'/oracle/SID/sapdata3/sr3700_4/sr3700.data4',

'/oracle/SID/sapdata4/sr3usr_1/sr3usr.data1'

CHARACTER SET UTF8;

  • Edit the file convert.rman only for system and undo tablespaces. Once the changes are done run the script from rman prompt

RUN {

CONVERT DATAFILE '/oracle/stage/undo.data1'

FROM PLATFORM ' AIX-Based Systems (64-bit)'

FORMAT ' /oracle/SID/sapdata1/undo_1/undo.data1';

CONVERT DATAFILE '/oracle/stage/system.data1'

FROM PLATFORM ' AIX-Based Systems (64-bit)'

FORMAT '/oracle/SID/sapdata1/system_1/system.data1';

}

RMAN> connect target / nocatalog @convert.rman

  • Shutdown the database and delete the dummy controlfile

  • Edit the transport.sql script to reflect the new path for datafiles and redolog files in the CREATE CONTROLFILE section of the script. Also change all references to the init.ora in the script to the new path name of the init.ora

STARTUP NOMOUNT

CREATE CONTROLFILE REUSE DATABASE "" RESETLOGS NOARCHIVELOG

MAXLOGFILES 255

MAXLOGMEMBERS 3

MAXDATAFILES 254

MAXINSTANCES 50

MAXLOGHISTORY 1168

LOGFILE

GROUP 1 (

'/oracle/SID/origlogA/log_g11m1.dbf',

'/oracle/SID/mirrlogA/log_g11m2.dbf'

) SIZE 50M,

GROUP 2 (

'/oracle/SID/origlogB/log_g12m1.dbf',

'/oracle/SID/mirrlogB/log_g12m2.dbf'

) SIZE 50M,

GROUP 3 (

'/oracle/SID/origlogA/log_g13m1.dbf',

'/oracle/SID/mirrlogA/log_g13m2.dbf'

) SIZE 50M,

GROUP 4 (

'/oracle/SID/origlogB/log_g14m1.dbf',

'/oracle/SID/mirrlogB/log_g14m2.dbf'

) SIZE 50M

-- STANDBY LOGFILE

DATAFILE

'/oracle/SID/sapdata1/system_1/system.data1',

'/oracle/SID/sapdata1/undo_1/undo.data1',

'/oracle/SID/sapdata1/sysaux_1/sysaux.data1',

'/oracle/SID/sapdata2/sr3_1/sr3.data1',

'/oracle/SID/sapdata2/sr3_2/sr3.data2',

'/oracle/SID/sapdata2/sr3_3/sr3.data3',

'/oracle/SID/sapdata2/sr3_4/sr3.data4',

'/oracle/SID/sapdata3/sr3700_1/sr3700.data1',

'/oracle/SID/sapdata3/sr3700_2/sr3700.data2',

'/oracle/SID/sapdata3/sr3700_3/sr3700.data3',

'/oracle/SID/sapdata3/sr3700_4/sr3700.data4',

'/oracle/SID/sapdata4/sr3usr_1/sr3usr.data1'

CHARACTER SET UTF8

;

ALTER DATABASE OPEN RESETLOGS;

ALTER TABLESPACE PSAPTEMP ADD TEMPFILE '/oracle/SID/sapdata1/temp_1/temp.data1'

SIZE 314572800 AUTOEXTEND OFF;

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='/oracle//102_64/dbs/init.ora'

@@ ?/rdbms/admin/utlirp.sql

SHUTDOWN IMMEDIATE

STARTUP PFILE='/oracle/SID/102_64/dbs/init.ora'

@@ ?/rdbms/admin/utlrp.sql

set feedback 6;

  • Once the pfile and transport.sql are correctly modified invoke sqlplus and run the transport.sql script