Author Photo

Being a Linux Enthusiast and a Fan of Open Source Software, I created Ahmer’s SysAdmin Recipes blog to share my experiences with other System Administrators. The curiosity doesn’t let me stop; therefore, I am constantly trying to learn new software tools and techniques. Whereas I also have the passion and the patience to teach the others.

I am always ready to accept new challenges and wish to explore the areas, that I haven’t worked on. Please give me your feedback and help me improve this blog.

Sunday, 7 February 2016

Install Oracle Database 12c on CentOS 7

Install Oracle Database 12c on CentOS 7The 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.


System Specification:

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


Oracle Database 12c Installation:

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 6+ (Oracle Enterprise Linux). 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 pre-requisites manually.

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

Set hostname and add an entry in the /etc/hosts.

[root@dbserver ~]# hostnamectl set-hostname dbserver.test.local [root@dbserver ~]# echo " dbserver.test.local dbserver" >> /etc/hosts

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

[root@dbserver ~]# 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 >EOF [root@dbserver ~]# sysctl –p

Set security limits for oracle user.

[root@dbserver ~]# 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 >EOF

Install pre-requisite packages using yum command.

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

Create required OS User and Groups.

[root@dbserver ~]# groupadd -g 1101 oinstall [root@dbserver ~]# groupadd -g 1102 dba [root@dbserver ~]# groupadd -g 1103 oper [root@dbserver ~]# groupadd -g 1104 backupdba [root@dbserver ~]# groupadd -g 1105 dgdba [root@dbserver ~]# groupadd -g 1106 kmdba [root@dbserver ~]# groupadd -g 1107 asmdba [root@dbserver ~]# groupadd -g 1108 asmoper [root@dbserver ~]# groupadd -g 1109 asmadmin [root@dbserver ~]# useradd -u 1101 -g oinstall -G dba,oper oracle [root@dbserver ~]# echo “oracle” | passwd oracle –stdin

Change SELinux mode to Permissive.

[root@dbserver ~]# sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/sysconfig/selinux [root@dbserver ~]# setenforce permissive

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

[root@dbserver ~]# firewall-cmd –-permanent –-add-port=1521/tcp [root@dbserver ~]# firewall-cmd –-reload

Create Directories for Oracle RDBMS Software.

[root@dbserver ~]# mkdir -p /u01/app/oracle/product/ [root@dbserver ~]# chown -R oracle:oinstall /u01 [root@dbserver ~]# 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.

[root@dbserver ~]# xhost + [root@dbserver ~]# su – oracle [oracle@dbserver ~]$ 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 >EOF

Start Oracle Database 12c installation.

[oracle@dbserver ~]$ cd /soft/12c/database [oracle@dbserver database]$ chmod u+x runInstaller [oracle@dbserver database]$ chmod u+x install/.oui [oracle@dbserver database]$ ./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 and execute both scripts.


Installation of Oracle Database 12c 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.

Install Oracle Database 12c on CentOS 7


No comments:

Post a Comment