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 VERSION | Windows Server 2012 R2 Standard |
DATABASE VERSION | 12c Enterprise Edition Release 12.1.0.2.0 – 64bit |
DATABASE NAME | DBSGURU |
Target:
LINUX SERVER VERSION | Linux x86_64 |
DATABASE VERSION | 12c Enterprise Edition Release 12.1.0.2.0 – 64bit |
DATABASE NAME | DBSGURU |
SUMMARY:
- Checked hardware, operating system, version and storage of both source & target servers.
- Verified the database edition and version.
- Kernel Parameters were set on the database to new Linux server.
- Directories were created on the server regarding ORACLE HOME and ORACLE BASE and other logs directory.
- 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.
- Data protection and security implicated related to re-hosting the data.
- Database was clean shutdown to start the migration process to maintain the consistency of the data.
- Backup was taken of the database and transferred to the new server on the appropriate directory.
- Installation of the Oracle software on the server.
- Backup was restored to the new servers with archive mode.
- Database was up and running with data up to date confirm via developer.
- 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
- Oracle Critical Database Patch ID for July 2024 along with enabled Download Link
- Oracle Critical Database Patch ID for April 2024 along with enabled Download Link
- Oracle Critical Database Patch ID for April 2023 along with enabled Download Link
- Oracle Critical Database Patch ID for January 2023 along with enabled Download Link
- Steps to Apply Combo Patch (Oct 2022) on Clusterware in Two Node RAC in Oracle
Nice. Very well described.
Awesome document… Very nicely put… Thanks a lot for this effort.
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
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.
You are right, For Full Impdp actually we no need to create tablespace, roles and profiles and users
Wonderful article team dbsguru.