Install Oracle Database 12.2 on Linux

Introduction

Installing Oracle Database 12.2 on Linux system might seem daunting at first, but with the right guidance, it can be a smooth process. In this guide, we’ll take you through the step-by-step procedure to install Oracle Database on a Linux environment. By the end of this tutorial, you’ll have a functional Oracle Database instance up and running.

Steps for Installation:

  • 1. Prerequisites Automatic Setup
  • 2. Prerequisites Manual Setup
  • 3. Install Oracle Database Binary (Software only)
  • 4. Create Database by DBCA

1. Prerequisites Automatic Setup

To perform all your prerequisite setup automatically, issue the following command or you can proceed with manual setup explained in 2nd point.

[root@prod]# yum install oracle-database-server-12cR2-preinstall -y

2. Prerequisites Manual Setup

a) Download and Unzip the oracle 12.2 Setup

Download or copy the oracle setup file to any location as per your requirement. In this case it is /u01.

Give chmod 775 permission to the setup file:
# chmod 775 <filename.zip>

Unzip Oracle_DB_12.2.zip:
Once unzipped it will show a folder named database at the unzipped location.

Give chmod 775 permission to database folder:
# chmod -R 775 database

b) Put a full hostname for the server in /etc/hosts file.

<IP-address> <full-host-name> <machine-name>

c) Add the following lines to the /etc/sysctl.conf file

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Run the following commands to change the current kernel parameters.
/sbin/sysctl -p

d) Add the following lines to a file called /etc/security/limits.conf

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728

e) Install Required Packages

The following packages are listed as required, including the 32-bit version of some of the packages. Many of the packages should be installed already. If you don’t have internet in the machine in that case you can create local yum repository in linux to install these packages.

yum install binutils -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install zlib-devel -y
yum install zlib-devel.i686 -y

f) Create new groups, users & directories

groupadd -g 5001 oinstall
groupadd -g 5002 dba
groupadd -g 5003 oper


useradd -u 5007 -g oinstall -G dba,oper oracle
usermod -g oinstall -G dba,oper oracle


##set password of oracle by##

passwd oracle



##Create Directories and Give Permissions##

mkdir -p /u01/app/oracle/product/12.2.0.1/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

g) Stop and Disable Firewall

You will need to stop and disable the firewall or configure it. To disable it, do the following.

systemctl stop firewalld

systemctl disable firewalld

systemctl status firewalld

Or just type setup in terminal it will open Setup utility & navigate through System services to disable firewall

Install Oracle Database 12.2 on Linux
Install Oracle Database 12.2 on Linux

h) Set secure Linux to permissive by editing the /etc/selinux/config file

SELINUX=Permissive

Install Oracle Database 12.2 on Linux

Once the change is complete, restart the server or run the following command.
# setenforce Permissive

i) Login with Oracle user and add below entries .bash_profile

#Oracle environment settings

export TMP=/tmp
export TMPDIR=$TMP
export HOSTNAME=prod.infoinflux.com
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1
export ORACLE_SID=PROD
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Now prerequisites are completed

3. Install Oracle Database Binary (Software only)

Go to software extracted location and run the run installer

Before you run runInstaller give chown permission to database folder from root user:
#chown -R oracle:oinstall database

Run from Oracle User:

[oracle@prod database]$ ./runInstaller
Starting Oracle Universal Installer…

Checking Temp space: must be greater than 500 MB. Actual 89608 MB Passed
Checking swap space: must be greater than 150 MB. Actual 16383 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-08-21_06-08-03AM. Please wait …

Follow the Screens below in Slides:

At the end of software installation it will ask to run the mentioned script from root user

/u01/app/oraInventory/orainstRoot.sh

/u01/app/oracle/product/12.2.0.1/db_1/root.sh
Install Oracle Database 12.2 on Linux

Oracle Software or Binary Installation is completed successfully.

4. Create Database by DBCA

Now We will create a database with DBCA. Type dbca from oracle user or type $ORACLE_HOME/bin/dbca
[oracle@prod ~]$ $ORACLE_HOME/bin/dbca

Follow the Screens below in Slides:

  • Install Oracle Database 12.2 on Linux

Conclusion

Congratulations! You’ve successfully installed Oracle Database 12.2 on Linux system. Remember, this guide provides a basic overview of the installation process. Depending on your specific setup and requirements, there might be additional steps or considerations. Always refer to Oracle’s official documentation for the most accurate and up-to-date instructions.

Leave a Comment

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