Oracle Database Migration Windows to Linux - Oracle - DBA

Monday, 25 December 2017

Oracle Database Migration Windows to Linux

This Option is optional for only checking Migration is done or not.

 Sql > create table t (ddate date);
  Sql >  insert into t values(sysdate); 
 Sql >  commit; 
 Sql > shutdown immediate 
 Sql > startup mount 
 Sql > alter database open read only; 

 hosted with ❤ by GitHub

  Sql > set serveroutput on 
               declare v_return boolean; 
               begin v_return:=dbms_tdb.check_db('Linux IA (64-bit)'); 
               end; 
               / 
  Sql > declare v_return boolean;
                begin v_return:=dbms_tdb.check_external; 
                end; 
               / 
 hosted with ❤ by GitHub
  • Create Directory
  Sql > host mkdir c:\test
  Sql > exit
  c:\> rman target /
 hosted with ❤ by GitHub

  • Then Run this script to Rman prompt for converting database to new database and all convert all datafiles to new platform and transport script with new platform (ex: windows 7 64bit to Linux IA (64-bit)) We can doing some methods.


 Method - 1 
rman > convert database new database 'piyushdb'
       transport script 'c:\test\transport.sql' 
       db_file_name_convert 'c:\app\admin\oradata\orcl' 'c:\test' 
       to platform 'Linux IA (64-bit)';

Method - 2 
rman > convert database on target platform 
       convert script '/tmp/convertdb/convertscript-target.rman'
       transport script '/tmp/convertdb/transportscript-target.sql'
       new database 'piyushdb' 
       format '/tmp/convertdb/%U' ;

rman > Exit;
 hosted with ❤ by GitHub
  • Create Pfile.
  Sql > Create pfile='c:\test\initpiyushdb.ora' from spfile;
 hosted with ❤ by GitHub
These Setting Doing on Linux machine. 
  • First install Oracle Software for same version. (Ex: windows - 11.2.0.1 and Linux - 11.2.0.1 Both are 64 bit). 
  • Then Copy this test directory from windows to Linux. 
  • Pfile copy from test directory to Linux $ORACLE_HOME/dbs.
  • Copy all datafiles from test directory to $ORACLE_BASE/oradata/paragdb/
  • Modify pfile. 
  • Modify transport.sql file. 
  • $ export ORACLE_SID=paragdb 
  • . oraenv 
  • sqlplus / as sysdba 
  • sql > @transport.sql
  • select * from v$version;
  • select platform_id, platform_name from v$database;

No comments:

Post a Comment

Total Pageviews