CentLinux | Learn How to Install CentOS/Rocky Linux Servers

Sunday, February 7, 2016

How to Install Oracle Database 12c on CentOS 7

Install Oracle Database 12c on CentOS 7

The Oracle Database 12c is the latest stable release of Industry’s most famous Relational Database Management System (RDBMS). Oracle Database 12c is a multi-model database, that can organize data in various models. But it is commonly used in Online Transaction Processing (OLTP) and Online Analytical Processing (OLAP) models.

In this article, we will install Oracle Database 12c on a CentOS 7 server. We follow the Oracle database documentation to configure the Oracle Database 12c as per the best practices.


Recommended Training: Oracle Database Administration Workshop ( 12c and Higher)
Recommended Books: Pro Oracle Database 18c Administration by Michelle Malcher & Darl Kuhn


Table of Contents:


Environment Specification:

We are using a CentOS 7 minimal virtual machine with following specification.

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


Oracle Database 12c Post Installation Configurations:

There is a good alternative to manual configuration, i.e. oracle-rdbms-server-12cR1-preinstall.x86_64.rpm package. But unfortunately, it required UEK (Unbreakable Enterprise Kernel) that is only shipped with OEL (Oracle Enterprise Linux) 6 or later. 

Therefore, if you are planning to install on OEL 6 or later than you can download and install it to save your time, otherwise you have to configure prerequisites manually.

Since, we are installing Oracle Database 12c on CentOS 7, therefore, we will perform everything manually for the sake of demonstration.

Set hostname and add an entry in the Local DNS Resolver.

# hostnamectl set-hostname dbserver.test.local
# echo " dbserver.test.local dbserver" >> /etc/hosts

Execute the following command to add these Kernel parameters in /etc/sysctl.conf file.

# 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

# sysctl –p

Set security limits for oracle user.

# cat >> /etc/security/limits.conf << EOF
> oracle soft nofile 1024
> oracle hard nofile 65536
> oracle soft nproc 2047
> oracle hard nproc 16384
> oracle soft stack 10240
> oracle hard stack 32768

Install prerequisite packages using yum command.

# 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

Create required OS user and groups.

# groupadd -g 1101 oinstall
# groupadd -g 1102 dba
# groupadd -g 1103 oper
# groupadd -g 1104 backupdba
# groupadd -g 1105 dgdba
# groupadd -g 1106 kmdba
# groupadd -g 1107 asmdba
# groupadd -g 1108 asmoper
# groupadd -g 1109 asmadmin

# useradd -u 1101 -g oinstall -G dba,oper oracle
# echo “oracle” | passwd oracle –stdin

Oracle Database 12c is currently not compatible with SELinux. Therefore, either we need to disable SELinux or put it into permissive mode.

# sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/sysconfig/selinux
# setenforce permissive

Configure Linux Firewall to allow Oracle SQL* Net Listener to accept service requests on its default port.

# firewall-cmd –-permanent –-add-port=1521/tcp
# firewall-cmd –-reload

Create directories for Oracle RDBMS Software.

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

To redirect X-Server display to your client machine, execute following command (make sure you have a X-Server utility, e.g. XMing, running on the client to capture the X-Server display. Also set the display variable in the Putty)

Set Linux environment variables for oracle user as follows.

# xhost +
# su – oracle
$ cat >> vi ~/.bash_history << EOF
> # Oracle Settings
> export TMP=/tmp
> export TMPDIR=$TMP
> export DISPLAY= # Set your Client IP here
> export ORACLE_HOSTNAME=dbserver.test.local
> export ORACLE_UNQNAME=cdb1
> export ORACLE_BASE=/u01/app/oracle
> export ORACLE_HOME=$ORACLE_BASE/product/
> export ORACLE_SID=cdb1
> export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
> export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
> export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib


Installing Oracle Database 12c on CentOS 7:

Start Oracle Database 12c installation.

$ cd /soft/12c/database
$ chmod u+x runInstaller
$ chmod u+x install/.oui
$ ./runInstaller


Uncheck I wish to receive security updates via My Oracle Support. Click on Next.


Click on Next.


Select Install database software only. Click on Next.


Select Single instance database installation. Click on Next.


Add your required languages. Click on Next.


Select Enterprise Edition. Click on Next.


Installer automatically selects installation directories, based on ORACLE_BASE and ORACLE_HOME environment variables. Click on Next.


Click on Next.


Click on Next.


Click on Install.


Login as root user on our CentOS 7 server and execute both scripts.


Installation of Oracle Database 12c on CentOS 7 has been completed. Be noted that database services won’t start automatically. We have to either write a bash script or Install Oracle Grid Infrastructure 12c as Stand Alone Server for this purpose.

If you find this article useful? Consider supporting us by Buy Me A Coffee

No comments:

Post a Comment

© 2023 CentLinux. All Rights Reserved.