September 26, 2021
How to install oracle 12c R12 on centOS 7

How To Install Oracle Database 12c Release 2 on CentOS 7

The Oracle database installation process is a challenging job and must be done carefully. Because the installation guide that we read, sometimes does not have a positive impact on our installation process. Sometimes in the middle of the installation process, we are experienced stuck and the installation process was failed. In this article I will try to explain how to install Oracle Database 12c Enterprise edition from beginning to end. My reference source also comes from several existing online, with a few steps that are adjusted.

Oracle Database is an object-relational database management system (RDBMS) developed by Oracle Corporation.The Oracle Database is available under a Proprietary and OTN Standard License. Oracle Corp has prepare the official website for downloading the oracle sources to be installed.

System Prerequisites

In this section, we will briefly describe how to install Oracle Database 12c R2. Before we start, we have to check the system prerequisites. The minimum system spesication should :

  • CPU 2.4 Ghz (2 Core)
  • Memory 2 GB
  • Storage “/ “ of 46 GB, Swap of 4 GB
  • Operating System CentOS 7.2
System requirement

We have the CentOS 7 which is live on VMware machine with 2GB Memory and 2 cores CPU. For preparing system envrironment we also need root user for creating new user and group and also applying new kernell parameters and install new packages.

Oracle Database 12c R2 Installation steps

Download and extract the Oracle Database 12c source

We need the valid sources for Oracle Database 12c R2, the trusted source must be coming from Oracle official website. Here’s the valid URL, OTN: Oracle Database 12c Release 1 ( Software (64-bit). when we have had the valid source, then we have to extract it to temporary folder.

[root@dbdev12c ~]# unzip
[root@dbdev12c ~]# unzip 

Setup The System Environment

The system environment setup is needed to ensure all required parameters are met with oracle system requirement. There are several task to be perfomed like : OS user and group creation, oracle software directory creation, update paremeter kernell, install required packages.

1. Create required OS user and Group

The next step is to create required OS User and Groups. We need an oracle user, with oinstall, dba and oper group in our OS environment.

[root@dbdev12c ~]# groupadd -g 54321 oinstall
[root@dbdev12c ~]# groupadd -g 54322 dba
[root@dbdev12c ~]# groupadd -g 54323 oper
[root@dbdev12c ~]# useradd -u 54321 -g oinstall -G dba,oper oracle
[root@dbdev12c ~]# passwd oracle
 Changing password for user oracle.
 New password: 
 Retype new password: 
 passwd: all authentication tokens updated successfully.
2. Setting up the oracle user profile

Edit the /home/oracle/.bash_profile file and add the following line :

export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=ol7-122.localdomain
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/
export ORACLE_SID=cdb1
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH  
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 
3. Oracle software directory creation
[root@dbdev12c ~]# mkdir -p /u01/app/oracle/product/
[root@dbdev12c ~]# chown -R oracle:oinstall /u01
[root@dbdev12c ~]# chmod -R 775 /u01
4. Change SELinux mode to Permissive
[root@dbdev12c ~]# vi /etc/selinux/config
[root@dbdev12c ~]# sestatus
 SELinux status:                 enabled
 SELinuxfs mount:                /sys/fs/selinux
 SELinux root directory:         /etc/selinux
 Loaded policy name:             targeted
 Current mode:                   permissive
 Mode from config file:          permissive
 Policy MLS status:              enabled
 Policy deny_unknown status:     allowed
 Max kernel policy version:      31
5. Update Paremeters Kernell

Add the following lines to the /etc/sysctl.conf file and then reload it.

[root@dbdev12c ~]#  # cat >> /etc/sysctl.conf << EOF 
>fs.file-max = 6815744
>kernel.sem = 250 32000 100 128
>kernel.shmmni = 4096
>kernel.shmall = 1073741824
>kernel.shmmax = 4398046511104
>net.core.rmem_default = 262144
>net.core.rmem_max = 4194304
>net.core.wmem_default = 262144
>net.core.wmem_max = 1048576
>fs.aio-max-nr = 1048576
>net.ipv4.ip_local_port_range = 9000 65500
[root@dbdev12c ~]# sysctl -p 

6. Install pre-requisite packages

By using yum command, we have to install prerequiste command related to Oracle databse installation.

[root@dbdev12c ~]# yum install binutils -y
[root@dbdev12c ~]# yum install compat-libcap1 -y
[root@dbdev12c ~]# yum install compat-libstdc++-33 -y
[root@dbdev12c ~]# yum install compat-libstdc++-33.i686 -y
[root@dbdev12c ~]# yum install glibc -y
[root@dbdev12c ~]# yum install glibc.i686 -y
[root@dbdev12c ~]# yum install glibc-devel -y
[root@dbdev12c ~]# yum install glibc-devel.i686 -y
[root@dbdev12c ~]# yum install ksh -y
[root@dbdev12c ~]# yum install libaio -y
[root@dbdev12c ~]# yum install libaio.i686 -y
[root@dbdev12c ~]# yum install libaio-devel -y
[root@dbdev12c ~]# yum install libaio-devel.i686 -y
[root@dbdev12c ~]# yum install libX11 -y
[root@dbdev12c ~]# yum install libX11.i686 -y
[root@dbdev12c ~]# yum install libXau -y
[root@dbdev12c ~]# yum install libXau.i686 -y
[root@dbdev12c ~]# yum install libXi -y
[root@dbdev12c ~]# yum install libXi.i686 -y
[root@dbdev12c ~]# yum install libXtst -y
[root@dbdev12c ~]# yum install libXtst.i686 -y
[root@dbdev12c ~]# yum install libgcc -y
[root@dbdev12c ~]# yum install libgcc.i686 -y
[root@dbdev12c ~]# yum install libstdc++ -y
[root@dbdev12c ~]# yum install libstdc++.i686 -y
[root@dbdev12c ~]# yum install libstdc++-devel -y
[root@dbdev12c ~]# yum install libstdc++-devel.i686 -y
[root@dbdev12c ~]# yum install libxcb -y
[root@dbdev12c ~]# yum install libxcb.i686 -y
[root@dbdev12c ~]# yum install make -y
[root@dbdev12c ~]# yum install nfs-utils -y
[root@dbdev12c ~]# yum install net-tools -y
[root@dbdev12c ~]# yum install smartmontools -y
[root@dbdev12c ~]# yum install sysstat -y
[root@dbdev12c ~]# yum install unixODBC -y
[root@dbdev12c ~]# yum install unixODBC-devel -y
7. Limit the oracle user

We need to configure some limits for the oracle user. Specify the max number process and max number of open files descriptors. 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

Oracle Database 12c Installation

After all environment is ready, the next step is to execute the executable file with oracle user, we have created. There is a need to configure the desktop environment to show the Installation java based dialog box appeared. I have installed the Xming for this purpose.

Login with oracle user and go to the file located and just do the ./runInstaller. Ussually the file is located on the <extracted location>/installer/database/.

run installer
Oracle database 12C installaton option
Oracle database 12C system class
Oracle database 12C Install type
Oracle database 12C Enterprise database edition
Oracle database 12C Crate inventory
Oracle database 12C configuration type

In this case, it was found if the Swap size prerequisite condition has the warning status. The expected value was 5.67GB but the actual value was only 3GB. For mitigation this case, we have to resize the swap are. We used the file as a swap area with size about 4.3 GB as below :

After all prerequisite database Oracle installation was passed, we were faced with the Summary as below and just click the ‘Install’ button to continue the installation process.

The installation was just initiated and all will be run automatically run.

At the middle of process we were prompted to execute the two files with root user, name : /u01/app/oraInventory/ and /u01/app/oracle/product/

[root@dbdev12c database]# /u01/app/oraInventory/ 
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.

[root@dbdev12c database]# /u01/app/oracle/product/ 
Performing root user operation.
The following environment variables are set as:
     ORACLE_OWNER= oracle
     ORACLE_HOME=  /u01/app/oracle/product/
 Enter the full pathname of the local bin directory: [/usr/local/bin]: 
    Copying dbhome to /usr/local/bin …
    Copying oraenv to /usr/local/bin …
    Copying coraenv to /usr/local/bin …
 Creating /etc/oratab file…
 Entries will be added to the /etc/oratab file as needed by
 Database Configuration Assistant when a database is created
 Finished running generic part of root script.
 Now product-specific root actions will be performed.
 Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] : 
 Oracle Trace File Analyzer (TFA - User Mode) is available at :
 Oracle Trace File Analyzer (TFA - Daemon Mode) can be installed by running this script :

After all installation was completed done, we could test it with hitting the OEM website, as shown below.

Oracle database 12C OEM on the first use

Share this article via :

Leave a Reply

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