Cross OS Platform Oracle DB Migration Using RMAN


Introduction:


Document highlights cross OS platform migration of Oracle 10g database from HP UX to Sun using RMAN convert method.  


Oracle Doc. For Reference:
Cross-Platform Migration on Destination Host Using RMAN Convert Database [ID 414878.1]

Activity Index:

On Source:

           1. Verify invalid objects on source, invalid indexes, db component status
           2. Re-open DB in read only mode
           3. Verify external references & transportable compatibility w.r.t target platform
           4. Generate transport & convert script, parameter file using RMAN
           5. Shut down database,copy datafiles & transport/convert script/pfile to Target

On Target:

 6. Prepare pfile & create controlfile 
 7. Perform RMAN convert on SYSTEM/UNDO datafiles using convert script generated on source
 8. Re-create Control file with converted datafiles
 9. Execute transport script for migration 
10. Rename datafiles,create spfile 
11. Verify invalid objects, invalid indexes, db component status

Activity Steps:


On Source:


1.Verify invalid objects on source, invalid indexes, db component status


Select count(1),object_type from dba_objects where status <> ‘VALID’ group by object_type;
Select distinct status from dba_indexes ;
select CNAME,version,status from registry$;

     2.Re-open DB in read only mode


Select distinct status from v$datafile;
Select distinct status from v$backup;
Shut immediate;
Startup mount
Alter database open read only;

      3.Verify external references & transportable compatibility w.r.t target platform


Below Pl/SQL block should not throw any error

set serveroutput on
 declare
 db_ready boolean;
 begin
 db_ready := dbms_tdb.check_db('Solaris[tm] OE (64-bit)');
 end;
 /

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

     4. Generate transport & convert script, parameter file using RMAN


CONVERT DATABASE ON TARGET PLATFORM
CONVERT SCRIPT '/intecv7/ICT/archive01/rman_convert/convertscript.rman'
TRANSPORT SCRIPT '/intecv7/ICT/archive01/rman_convert/transportscript.sql'
FORMAT '/intecv7/ICT/archive01/rman_convert/%U';
 

 

    Generates below three files.

I.   Parameter file
II. Transportscript containing create controlfile & other migration pl/sql’s  
III. Convert script contains rman convert datafile commands


 

     5. Shut down database, copy datafiles & transport/convert script/pfile to Target


Shut immediate;
 <Backup can be initiated followed by Restoration on Target node>
 Copy pfile/transportscript/convert to Target Node




On Target:
  

    6. Prepare pfile & create controlfile


Modify udump/bdump/cdump/adump locations as per Target
Modify controlfile locations as specified in transportscript.sql
Verify ORACLE_HOME/ORACLE_SID

SQL>Startup nomount pfile=’ init_00ml2urk_1_0.ora’;
SQL> CREATE CONTROLFILE REUSE SET DATABASE "<db_name>” RESETLOGS  NOARCHIVELOG

..

..
  




    7. Perform RMAN convert on SYSTEM/UNDO datafiles using convert script generated on source


Keep only system/undo datafiles convert commands in convertscript.sql with new datafile locations in format



    8. Re-create Control file with converted datafiles



SQL> Shut immediate



 Remove current controlfile

Modify transport script with create controlfile command showing  new converted system/undo datafiles locations



SQL> startup nomount pfile=’ init_00ml2urk_1_0.ora’;
 


 9. Execute transport script for migration


    10. Rename datafiles,create spfile

    SQL> create spfile from pfile;

    Rename converted system/undo datafiles to new name  


     11. Verify invalid objects, invalid indexes, db component status

Select count(1),object_type from dba_objects where status <> ‘VALID’ group by object_type;
Select distinct status from dba_indexes ;
select CNAME,version,status from registry$;




4 comments:

  1. Nice !!!!
    But needs attention towards Formatting :-)

    ReplyDelete
  2. Thanks ! Arvind , Will note this & Work on

    ReplyDelete
  3. Very useful and informative one.Great Post!
    OS Migration should be done very carefully.You have presented in a easily understandable way. :)

    ReplyDelete