How to Install Oracle Database 12CR2 Standalone in Red Hat Linux Step by step

12c install


1   Downloading Database Files.

2   Database Software.

3   OS Configuration And Preparation.

4   Oracle Installation.

4.1 Prerequisites.

4.2 Add groups.

4.3 Add user Oracle for database software.

4.4 Change password for user Oracle.

5  Manual Setup.

5.1 Additional Setup.

5.2 Installation.

1 – Downloading Database Files

Software for 12CR2 is available on OTN or edelivery

2 – Database Software

linuxx64_12201_database. zip

Unzip the file

unzip linuxx64_12201_database. zip

3  – OS Configuration And Preparation

OS configuration is executed as root. To login as root and execute following command in terminal.

su – root

The “/etc/hosts” file must contain a fully qualified name for the server.


For example.      localhost.localdomain localhost

Set hostname

hostnamectl set-hostname localhost.localdomain–static

4 – Oracle Installation

4.1 Prerequisites

The following command for update and packages

# yum install oracle-database-server-12cR2-preinstall -y

# yum update -y

Manually  the following setup tasks.

Add the following lines to the “/etc/sysctl.conf” file, or in a file called “/etc/sysctl.d/98-oracle.conf”.

4.2 Add groups

#groups for database management
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
groupadd -g 54330 racdba

4.3 Add user Oracle for database software

useradd -u 54321 -g oinstall \
-G dba, oper, backupdba, dgdba, kmdba, racdba oracle

4.4 Change password for user Oracle

passwd oracle

5 – Manual Setup

 Add the following lines to the “/etc/sysctl.conf” file, or in a file called “/etc/sysctl.d/98-oracle.conf”.

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 command to change the current kernel parameters.

/sbin/sysctl -p

Add the following lines to a file called “/etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf” file.

# (RHEL7)
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -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 libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install libXtst -y
yum install libXtst.i686 -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 libxcb -y
yum install libxcb.i686 -y
yum install make -y
yum install nfs-utils -y
yum install net-tools -y
yum install smartmontools -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y

Create the new groups and users.

groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
#groupadd -g 54324 backupdba
#groupadd -g 54325 dgdba
#groupadd -g 54326 kmdba
#groupadd -g 54327 asmdba
#groupadd -g 54328 asmoper
#groupadd -g 54329 asmadmin
#groupadd -g 54330 racdba
useradd -u 54321 -g oinstall -G dba,oper oracle

Uncomment the extra groups you require.

5.1 – Additional Setup

The following steps must be performed, whether you did the manual or automatic setup.

Set the password for the “oracle” user.

passwd oracle

Set secure Linux to permissive by editing the “/etc/selinux/config” file, making sure the SELINUX flag is set as follows.


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

# setenforce Permissive

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or here. To disable it, do the following.

# systemctl stop firewalld

# systemctl disable firewalld

If you are not using Oracle Linux and UEK, you will need to manually disable transparent huge pages.

Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/

chown -R oracle:oinstall /u01

chmod -R 775 /u01

Putting mount points directly under root is typically a bad idea. It’s done here for simplicity, but for a real installation “/” should be reserved for the OS. Add a reference to the “” file at the end of the “/home/oracle/.bash_profile” file.

Vi /home/oracle/.bash_profile


Create a “” and “” script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.

cat >

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
# User specific environment and startup programs

export PATH

# Oracle bash_profile Environment Settings

TMP=/tmp; export TMP

ORACLE_HOSTNAME=database.localdomain; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
DB_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export DB_HOME
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch:/dbvisit/standby:$BASE_PATH; export PATH

if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
ulimit -u 16384 -n 65536

The following command for start bash_profile

/home/oracle . .bash_profile  

5.2 – Installation

Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.

/u01/install/database/./runInstaller     Uncheck checkbox “I wish to receive security updates via My Oracle Support” and then click “Next” button.     Ignore following message and click “Yes” button.     Select “Create and configure a database” then click “Next” button.     Select “Server class” and click “Next” button.     Accept default “Single instance database installation” and click “Next” button.     Select “Advanced install” to later select more options during database installation and click “Next” button.     You can select here type of binaries to install. Once it’s done click “Next” button.     Here you should see directories for ORACLE_BASE and ORACLE_HOME for your binaries according to environmental settings. Click “Next” button.      Accept default and click “Next” button.      Accept default “General Purpose/ transaction Processing” and click “Next” button.      “database name” to add your first container database “cozum” and database “cozum”, click “Next” button.      Specify more details about your database on 3 tabs where you can define memory settings, character set and if to install sample schema on your database. Once you are applying like these pictures with your settings click “Next” button.   Specify directory where you want to install your database files then click “Next” button.     On this page you can register your database in Oracle Enterprise Manager”. Accept default settings and click “Next” button.     Do not Check checkbox “Enable Recovery” Click oracle Automatic Storage Management and click “Next” button.     Specify password for each user or enter the same for all. Once it’s done click “Next” button.     Here you can specify OS group for each oracle group. Accept default settings and click “Next” button.     Checks are started to verify if OS is ready to install database software.      If everything is right click “Install” button. It’s the last moment to come back to each of previous point and make changes.      Installation in progress.     Once binaries are installed the last step is to run 2 scripts as user root.

–execute scripts


/u01/app/oracle/product/12.2.0/db_1/     12C installation is completed. Click “Close” button.     Another summary with information about “Enterprise manager database express”      Try to login as SYS to Enterprise manager Database express 12C.

NOTE – It requires installing flash plug-in and running listener. In addition don’t provide container name to connect.

Great, Have a nice day.

Also you can check out my other post: How to Create and Configure a Pluggable Database