DATABASE MIGRATION FROM WINDOW SERVER TO LINUX SERVER IN ORACLE

September 4, 2020
()

DATABASE MIGRATION FROM WINDOW SERVER TO LINUX SERVER IN ORACLE

In this article, we are going to demonstrate DATABASE MIGRATION FROM WINDOW SERVER TO LINUX SERVER. This is required as part of migration on request of the client to route application on new configuration (Weblogic).


DATABASE DETAIL :

Source:

WINDOWS SERVER VERSIONWindows Server 2012 R2 Standard
DATABASE VERSION12c Enterprise Edition Release  12.1.0.2.0 – 64bit
DATABASE NAMEDBSGURU


Target:

LINUX SERVER VERSIONLinux x86_64
DATABASE VERSION12c Enterprise Edition Release  12.1.0.2.0 – 64bit
DATABASE NAMEDBSGURU


SUMMARY:

  1. Checked hardware, operating system, version and storage of both source & target servers.
  2. Verified the database edition and version.
  3. Kernel Parameters were set on the database to new Linux server.
  4. Directories were created on the server regarding ORACLE HOME and ORACLE BASE and other logs directory.
  5. Network connectivity between the application(s) and target database was installed through Network Protocols in the new environment so that user can connect to the existing details from front end that will automatically connect to new servers.
  6. Data protection and security implicated related to re-hosting the data.
  7. Database was clean shutdown to start the migration process to maintain the consistency of the data.
  8. Backup was taken of the database and transferred to the new server on the appropriate directory.
  9. Installation of the Oracle software on the server.        
  10. Backup was restored to the new servers with archive mode.
  11. Database was up and running with data up to date confirm via developer.    
  12. Parameters of database were set according to the new server ram and kernel settings.

ORACLE INSTALLATION :

  • Installed Kernel Parameters on linux server – /etc/sysctl.conf

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

  • Add the following lines to the “/etc/security/limits.conf” file.
  • Install the following packages if they are not already present.

rpm -Uvh binutils-2.*

rpm -Uvh compat-libstdc++-33*

rpm -Uvh compat-libstdc++-33*.i386.rpm

rpm -Uvh elfutils-libelf*

rpm -Uvh gcc-4.*

rpm -Uvh gcc-c++-4.*

rpm -Uvh glibc-2.*

rpm -Uvh glibc-common-2.*

rpm -Uvh glibc-devel-2.*

rpm -Uvh glibc-headers-2.*

rpm -Uvh ksh*

rpm -Uvh libaio-0.*

rpm -Uvh libaio-devel-0.*

rpm -Uvh libgomp-4.*

rpm -Uvh libgcc-4.*

rpm -Uvh libstdc++-4.*

rpm -Uvh libstdc++-devel-4.*

rpm -Uvh make-3.*

rpm -Uvh sysstat-7.*

rpm -Uvh unixODBC-2.*

rpm -Uvh unixODBC-devel-2.*

rpm -Uvh numactl-devel-*
  • Create the new groups and users.

We need to create new groups and users to install the oracle.

groupadd oinstall

groupadd dba

groupadd oper

groupadd asmadmin

useradd -g oinstall -G dba,oper,asmadmin oracle

passwd oracle

  • Create the directories in which the Oracle software will be installed.

Here we need to create directories to install the oracle software and after creating the directory we need to assign the privileges.

mkdir -p /u01/app/oracle/product/12c/dbsguru

chown -R oracle:oinstall /u01

chmod -R 775 /u01

  • Setup .bash_profile –

export ORACLE_SID=DBSGURU

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME =/u01/app/oracle/product/12c/dbsguru

  • Start the Oracle Universal Installer (OUI) to install the oracle and we need to create same name database on it using (DBCA)

    RunInstaller will install the oracle software and then dbca will create the required database.

./runInstaller

Click here to get more Step by Step Oracle 19c Binary Installation and Database Creation On Linux.


MIGRATION:


Before starting migration took full expdp backup from window DB server and database was clean shutdown to start the migration process to maintain the consistency of the data.

expdp '"/as sysdba"' DIRECTORY=exp_dir full= Y dumpfile=exp_dbguru_20200902.dmp logfile=mig_dbguru_20200902.log parallel=2
  • Create required tablespaces, roles & profiles on linux DB server to make error-less import.
  • Imported database through impdp utility
 impdp '"/AS SYSDBA"' DIRECTORY=exp_dir full= Y dumpfile=EXP_dbguru_20200902.DMP logfile=imp_mig_dbguru_20200902.log parallel=2


Click here to get more on Full Database Refresh Using EXPDP-IMPDP Datapump command

  • Alter database in archive log mode

    We will put here databsae in archive log mode.

select name, open_mode, log_mode, current_scn from v$database;

shutdown immediate;

startup mount;

alter database archivelog;

alter database open;

  • Recompile all invalid objects in the database

We have to recompile the invalid objects with utlrp.sql

@$ORACLE_HOME/rdbms/admin/utlrp.sql
  • Gather database stats

    We will gather statistics on database level to avoid any performance degradation.

EXEC DBMS_STATS.gather_database_stats(estimate_percent => 25 , degree => 4 , cascade => TRUE);


This document is only for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.


Hope so you like this article
!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our pursuit.

Related Articles


Loading

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

<strong>Hello and welcome to DBsGuru,</strong>DBsGuru is a group of experienced DBA professionals and serves databases and their related community by providing technical blogs, projects, training. Technical blogs are the source of vast information not about databases but its related product like middleware, PL/SQL, replication methodology, and so on.Thanks for the visits!<strong>Share Learn Grow!</strong>

6 Comments

  • Main point you have missed ..
    Create required tablespaces, roles & profiles on linux DB server to make error-less import

    This one is imp you should provide more info like how to generate dynamic query for this

    1. Thanks Shashi for the feedback. In this article, database is migrated with full=Y option and doesnot require explicitly to create roles etc. However, we have taken your request and we will try to cover the same topics in other articles.

      Please keep visiting us for new article and your feedback always motivate us.

Leave a Reply

Your email address will not be published. Required fields are marked *