Steps of migration From Windows to Linux Using RMAN Transportable Database

Move an Oracle database from Windows to Linux using the RMAN Transportable Database method.

Move the Oracle Database from Windows Platform to Linux Platform using RMAN Transportable method with following steps:

Step 1: Check the list of supported database with Operating system version from the following view:

    col platform_name for a35
    set pagesize 1000
    select * from v$transportable_platform ORDER BY 2;

    Step 2: Check the database compatibility

    -- Open the Source database in Readonly mode
    shutdown immediate;
    startup mount;
    alter database open read only;
    
    --- run the following PL/SQL Block to check compatibility
    SET SERVEROUTPUT ON
    DECLARE
      v_return BOOLEAN;
    BEGIN
      v_return := DBMS_TDB.CHECK_DB('Linux x86 64-bit');
    END;
    /

    Step 3: Check the external object name like directory name present in source database

    DECLARE
      v_return BOOLEAN;
    BEGIN
      v_return := DBMS_TDB.CHECK_EXTERNAL;
    END;
    /
    
    --- Take backup of external directories
    select directory_path||q'(/)'||location External_file_path from dba_directories a, dba_external_locations b where a.directory_name=b.directory_name;
    
    select directory_path from dba_directories;

    Step 4: Check the invalid objects and try to validate them before migrate

    SELECT COUNT(*) FROM dba_objects WHERE status='INVALID';
    
    -- Validate them
    @?\rdbms\admin\utlrp.sql

    Step 5: Create pfile from spfile

    create pfile='C:\initorcl.ora' from spfile;

    Step 6: Check the path of datafiles and tempfiles

    SELECT file_name, tablespace_name  FROM dba_data_files;
    
    SELECT file_name, tablespace_name  FROM dba_temp_files;
    

    Step 7: Rman to convert the database:

    rman target sys/your_password
    
    RMAN> 
    convert database new database 'test' transport script 'F:\rman\transport.sql'
    db_file_name_convert 'E:\ORADB\ORCL', 'F:\ORADB\test'
    to platform 'Linux x86 64-bit';

    Step 8: Install and prepare the destination server of Linux:

    Note: Oracle binaries need to install before performing the following steps.

    1. Copy the datafiles and transport.sql from Windows
    2. Copy the PFILE and Edit.
    3. Create the needed directories

    Edit the pfile according to your need, example change the path of parameters point to control files etc

    *.control_files='/u02/oradata/test/control01.ctl','/u02/oradata/test/control02.ctl'
    *.db_block_size=8192
    *.db_create_file_dest='/u02/oradata/test'
    *.db_name='test'

    Step 9: After making changes in Pfile, start the database in nomount state.

    startup nomount pfile='/u01/pfile/inittest.ora'

    Step 10: Place all the datafiles in oradata directory before creating the /u01/oradata/test folder.

    Step 11: Create the control file of the database after edit the path of your choose of datafile by executing tranport.sql

    tranport.sql
    
    Example:
    CREATE CONTROLFILE REUSE SET DATABASE "TEST" RESETLOGS NOARCHIVELOG
        MAXLOGFILES 16
        MAXLOGMEMBERS 3
        MAXDATAFILES 100
        MAXINSTANCES 8
        MAXLOGHISTORY 9344
    LOGFILE
      GROUP 1 '/u02/oradata/TEST/redo01.log' SIZE 250M BLOCKSIZE 512,
      ...
    DATAFILE
      '/u02/oradata/TEST/SYSTEM01.DBF',
      '/u02/oradata/TEST/SYSAUX01.DBF',
      '/u02/oradata/TEST/USERS01.DBF',
      ...
    CHARACTER SET AL32UTF8;

    Step 12. Execute the transport.sql

    SQL> @tranport.sql

    Step 13: Open the database in reset log

    alter database open resetlogs;

    Step 14: Create the temp tablepsace

    CREATE TEMPORARY TABLESPACE TEMP
      TEMPFILE '/u02/oradata/TEST/temp01.dbf'
      SIZE 500M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;

    Leave a Reply