Oracle Database 11g R2 (11.2) Installation On Oracle Enterprise Linux 7 (OEL7)

This article describes the installation of Oracle Database 11g R2 (11.2.0.4) 64-bit on Oracle Linux 7 (OL7) 64-bit.

1. Install Oracle Enterprise Linux 7:

You can follow this article to Install Oracle Linux 7 on VM: OEL 7 Installation

2. Oracle Installation Prerequisites:

You can perform all prerequisites two ways: Automatic Setup or Manual Setup. If you choose Automatic Setup, the package will take care all prerequisites and you don’t need to perform anything manually.

So choose the option either section 2.1 or 2.2.

2.1 Automatic Setup:

oracle-rdbms-server-11gR2-preinstall package will perform all required prerequisites:

[root@dbupgrade ~]# yum install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: langpacks
ol7_UEKR3                                                                                                      | 2.5 kB  00:00:00
ol7_latest                                                                                                     | 2.7 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el7 will be installed
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
--> Processing Dependency: compat-libcap1 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
--> Processing Dependency: ksh for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
--> Processing Dependency: libaio-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
--> Processing Dependency: compat-libstdc++-33 for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
--> Processing Dependency: libstdc++-devel for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
--> Running transaction check
---> Package compat-libcap1.x86_64 0:1.10-7.el7 will be installed
---> Package compat-libstdc++-33.x86_64 0:3.2.3-72.el7 will be installed
---> Package gcc-c++.x86_64 0:4.8.5-39.0.5.el7 will be installed
--> Processing Dependency: libstdc++ = 4.8.5-39.0.5.el7 for package: gcc-c++-4.8.5-39.0.5.el7.x86_64
--> Processing Dependency: gcc = 4.8.5-39.0.5.el7 for package: gcc-c++-4.8.5-39.0.5.el7.x86_64
---> Package ksh.x86_64 0:20120801-142.0.1.el7 will be installed
---> Package libaio-devel.x86_64 0:0.3.109-13.el7 will be installed
--> Processing Dependency: libaio(x86-64) = 0.3.109-13.el7 for package: libaio-devel-0.3.109-13.el7.x86_64
---> Package libstdc++-devel.x86_64 0:4.8.5-39.0.5.el7 will be installed
--> Running transaction check
---> Package gcc.x86_64 0:4.8.3-9.el7 will be updated
---> Package gcc.x86_64 0:4.8.5-39.0.5.el7 will be an update
--> Processing Dependency: cpp = 4.8.5-39.0.5.el7 for package: gcc-4.8.5-39.0.5.el7.x86_64
--> Processing Dependency: libgomp = 4.8.5-39.0.5.el7 for package: gcc-4.8.5-39.0.5.el7.x86_64
--> Processing Dependency: libgcc >= 4.8.5-39.0.5.el7 for package: gcc-4.8.5-39.0.5.el7.x86_64
---> Package libaio.x86_64 0:0.3.109-12.el7 will be updated
---> Package libaio.x86_64 0:0.3.109-13.el7 will be an update
---> Package libstdc++.x86_64 0:4.8.3-9.el7 will be updated
---> Package libstdc++.x86_64 0:4.8.5-39.0.5.el7 will be an update
--> Running transaction check
---> Package cpp.x86_64 0:4.8.3-9.el7 will be updated
---> Package cpp.x86_64 0:4.8.5-39.0.5.el7 will be an update
---> Package libgcc.x86_64 0:4.8.3-9.el7 will be updated
---> Package libgcc.x86_64 0:4.8.5-39.0.5.el7 will be an update
---> Package libgomp.x86_64 0:4.8.3-9.el7 will be updated
---> Package libgomp.x86_64 0:4.8.5-39.0.5.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================
 Package                                          Arch               Version                             Repository              Size
======================================================================================================================================
Installing:
 oracle-rdbms-server-11gR2-preinstall             x86_64             1.0-6.el7                           ol7_latest              22 k
Installing for dependencies:
 compat-libcap1                                   x86_64             1.10-7.el7                          ol7_latest              17 k
 compat-libstdc++-33                              x86_64             3.2.3-72.el7                        ol7_latest             190 k
 gcc-c++                                          x86_64             4.8.5-39.0.5.el7                    ol7_latest             7.2 M
 ksh                                              x86_64             20120801-142.0.1.el7                ol7_latest             882 k
 libaio-devel                                     x86_64             0.3.109-13.el7                      ol7_latest              12 k
 libstdc++-devel                                  x86_64             4.8.5-39.0.5.el7                    ol7_latest             1.5 M
Updating for dependencies:
 cpp                                              x86_64             4.8.5-39.0.5.el7                    ol7_latest             5.9 M
 gcc                                              x86_64             4.8.5-39.0.5.el7                    ol7_latest              16 M
 libaio                                           x86_64             0.3.109-13.el7                      ol7_latest              24 k
 libgcc                                           x86_64             4.8.5-39.0.5.el7                    ol7_latest             103 k
 libgomp                                          x86_64             4.8.5-39.0.5.el7                    ol7_latest             159 k
 libstdc++                                        x86_64             4.8.5-39.0.5.el7                    ol7_latest             306 k

Transaction Summary
======================================================================================================================================
Install  1 Package  (+6 Dependent packages)
Upgrade             ( 6 Dependent packages)

Total download size: 32 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for ol7_latest
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/compat-libcap1-1.10-7.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Public key for compat-libcap1-1.10-7.el7.x86_64.rpm is not installed
(1/13): compat-libcap1-1.10-7.el7.x86_64.rpm                                                                   |  17 kB  00:00:00
(2/13): compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm                                                            | 190 kB  00:00:00
(3/13): cpp-4.8.5-39.0.5.el7.x86_64.rpm                                                                        | 5.9 MB  00:00:02
(4/13): gcc-c++-4.8.5-39.0.5.el7.x86_64.rpm                                                                    | 7.2 MB  00:00:02
(5/13): ksh-20120801-142.0.1.el7.x86_64.rpm                                                                    | 882 kB  00:00:00
(6/13): libaio-0.3.109-13.el7.x86_64.rpm                                                                       |  24 kB  00:00:01
(7/13): libaio-devel-0.3.109-13.el7.x86_64.rpm                                                                 |  12 kB  00:00:00
(8/13): libgcc-4.8.5-39.0.5.el7.x86_64.rpm                                                                     | 103 kB  00:00:00
(9/13): libgomp-4.8.5-39.0.5.el7.x86_64.rpm                                                                    | 159 kB  00:00:00
(10/13): libstdc++-4.8.5-39.0.5.el7.x86_64.rpm                                                                 | 306 kB  00:00:00
(11/13): gcc-4.8.5-39.0.5.el7.x86_64.rpm                                                                       |  16 MB  00:00:09
(12/13): libstdc++-devel-4.8.5-39.0.5.el7.x86_64.rpm                                                           | 1.5 MB  00:00:01
(13/13): oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64.rpm                                             |  22 kB  00:00:01
--------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                 3.0 MB/s |  32 MB  00:00:10
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid     : "Oracle OSS group (Open Source Software group) <[email protected]>"
 Fingerprint: 4214 4123 fecf c55b 9086 313d 72f9 7b74 ec55 1f03
 Package    : 7:oraclelinux-release-7.1-1.0.5.el7.x86_64 (@anaconda/7.1)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : libgcc-4.8.5-39.0.5.el7.x86_64                                                                                    1/19
  Updating   : libstdc++-4.8.5-39.0.5.el7.x86_64                                                                                 2/19
  Installing : libstdc++-devel-4.8.5-39.0.5.el7.x86_64                                                                           3/19
  Updating   : libaio-0.3.109-13.el7.x86_64                                                                                      4/19
  Installing : libaio-devel-0.3.109-13.el7.x86_64                                                                                5/19
  Installing : compat-libstdc++-33-3.2.3-72.el7.x86_64                                                                           6/19
  Installing : ksh-20120801-142.0.1.el7.x86_64                                                                                   7/19
  Installing : compat-libcap1-1.10-7.el7.x86_64                                                                                  8/19
  Updating   : cpp-4.8.5-39.0.5.el7.x86_64                                                                                       9/19
  Updating   : libgomp-4.8.5-39.0.5.el7.x86_64                                                                                  10/19
  Updating   : gcc-4.8.5-39.0.5.el7.x86_64                                                                                      11/19
  Installing : gcc-c++-4.8.5-39.0.5.el7.x86_64                                                                                  12/19
  Installing : oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64                                                            13/19
  Cleanup    : gcc-4.8.3-9.el7.x86_64                                                                                           14/19
  Cleanup    : libstdc++-4.8.3-9.el7.x86_64                                                                                     15/19
  Cleanup    : libgcc-4.8.3-9.el7.x86_64                                                                                        16/19
  Cleanup    : cpp-4.8.3-9.el7.x86_64                                                                                           17/19
  Cleanup    : libgomp-4.8.3-9.el7.x86_64                                                                                       18/19
  Cleanup    : libaio-0.3.109-12.el7.x86_64                                                                                     19/19
  Verifying  : libaio-0.3.109-13.el7.x86_64                                                                                      1/19
  Verifying  : oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64                                                             2/19
  Verifying  : libgcc-4.8.5-39.0.5.el7.x86_64                                                                                    3/19
  Verifying  : libgomp-4.8.5-39.0.5.el7.x86_64                                                                                   4/19
  Verifying  : libstdc++-devel-4.8.5-39.0.5.el7.x86_64                                                                           5/19
  Verifying  : gcc-4.8.5-39.0.5.el7.x86_64                                                                                       6/19
  Verifying  : cpp-4.8.5-39.0.5.el7.x86_64                                                                                       7/19
  Verifying  : compat-libstdc++-33-3.2.3-72.el7.x86_64                                                                           8/19
  Verifying  : compat-libcap1-1.10-7.el7.x86_64                                                                                  9/19
  Verifying  : libaio-devel-0.3.109-13.el7.x86_64                                                                               10/19
  Verifying  : libstdc++-4.8.5-39.0.5.el7.x86_64                                                                                11/19
  Verifying  : ksh-20120801-142.0.1.el7.x86_64                                                                                  12/19
  Verifying  : gcc-c++-4.8.5-39.0.5.el7.x86_64                                                                                  13/19
  Verifying  : gcc-4.8.3-9.el7.x86_64                                                                                           14/19
  Verifying  : cpp-4.8.3-9.el7.x86_64                                                                                           15/19
  Verifying  : libgcc-4.8.3-9.el7.x86_64                                                                                        16/19
  Verifying  : libaio-0.3.109-12.el7.x86_64                                                                                     17/19
  Verifying  : libstdc++-4.8.3-9.el7.x86_64                                                                                     18/19
  Verifying  : libgomp-4.8.3-9.el7.x86_64                                                                                       19/19

Installed:
  oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el7

Dependency Installed:
  compat-libcap1.x86_64 0:1.10-7.el7     compat-libstdc++-33.x86_64 0:3.2.3-72.el7     gcc-c++.x86_64 0:4.8.5-39.0.5.el7
  ksh.x86_64 0:20120801-142.0.1.el7      libaio-devel.x86_64 0:0.3.109-13.el7          libstdc++-devel.x86_64 0:4.8.5-39.0.5.el7

Dependency Updated:
  cpp.x86_64 0:4.8.5-39.0.5.el7              gcc.x86_64 0:4.8.5-39.0.5.el7               libaio.x86_64 0:0.3.109-13.el7
  libgcc.x86_64 0:4.8.5-39.0.5.el7           libgomp.x86_64 0:4.8.5-39.0.5.el7           libstdc++.x86_64 0:4.8.5-39.0.5.el7

Complete!

2.2. Manual Setup:

2.2.1. Add following line to /etc/sysctl.conf file:

# Oracle DB
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
[root@dbupgrade ~]# /sbin/sysctl -p
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

2.2.2. Add the following lines to the “/etc/security/limits.conf” file:

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

2.2.3. Add the following line to the “/etc/pam.d/login” file, if it does not already exist.

session    required     pam_limits.so

2.2.4. Install 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 elfutils-libelf-devel -y

2.2.5. Create User and Group:

groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
#Create below group and assing to user if you have plan to seperate few roles:
#groupadd -g 54324 backupdba
#groupadd -g 54325 dgdba
#groupadd -g 54326 kmdba

useradd -g oinstall -G dba,oper oracle

3. Additional Setup:

3.1. Change password for oracle user:

[root@dbupgrade ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

3.2. SELINUX setting changes to permissive:

[root@dbupgrade ~]# cat /etc/selinux/config | grep SELINUX
# SELINUX= can take one of these three values:
SELINUX=enforcing
# SELINUXTYPE= can take one of three two values:
SELINUXTYPE=targeted
[root@dbupgrade ~]# cat /etc/selinux/config | grep SELINUX
# SELINUX= can take one of these three values:
SELINUX=permissive
# SELINUXTYPE= can take one of three two values:
SELINUXTYPE=targeted

3.3. Disable Firewall:

$ systemctl stop firewalld
$ systemctl disable firewalld

3.4. Create directories for installation oracle software:

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

4. Oracle Database 11gR2 Software Installation:

4.1. Unzip Oracle Software:

[oracle@dbupgrade software]$ ls -lrt
total 2487204
-rw-r–r–. 1 oracle oinstall 1395582860 Nov 12 2018 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r–r–. 1 oracle oinstall 1151304589 Nov 12 2018 p13390677_112040_Linux-x86-64_2of7.zip

[oracle@dbupgrade software]$ unzip p13390677_112040_Linux-x86-64_1of7.zip
[oracle@dbupgrade software]$ unzip p13390677_112040_Linux-x86-64_2of7.zip

[oracle@dbupgrade software]$ cd database/
[oracle@dbupgrade database]$ ls -lrt
total 48
drwxr-xr-x.  2 oracle oinstall    28 Aug 27  2013 sshsetup
-rwxr-xr-x.  1 oracle oinstall  3267 Aug 27  2013 runInstaller
drwxr-xr-x.  2 oracle oinstall    33 Aug 27  2013 rpm
drwxr-xr-x.  2 oracle oinstall    58 Aug 27  2013 response
-rw-r--r--.  1 oracle oinstall 30016 Aug 27  2013 readme.html
drwxr-xr-x. 14 oracle oinstall  4096 Aug 27  2013 stage
-rw-r--r--.  1 oracle oinstall   500 Aug 27  2013 welcome.html
drwxr-xr-x.  4 oracle oinstall  4096 Aug 27  2013 install

4.2. Edit the response file and provide follow details for software installation:

[oracle@dbupgrade response]$ pwd
/u01/software/database/response

[oracle@dbupgrade response]$ cat db_install.rsp | grep =
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=dbupgrade
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory/
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true

4.2. Install oracle software (only) in silent mode:

[oracle@dbupgrade database]$ pwd
/u01/software/database

[oracle@dbupgrade database]$ ./runInstaller -ignorePrereq -waitforcompletion -silent  -responseFile /u01/software/database/response/db_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 23201 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 6143 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-10-04_03-24-22PM. Please wait ...You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2020-10-04_03-24-22PM.log
The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2020-10-04_03-24-22PM.log' for more details.

As a root user, execute the following script(s):
        1. /u01/app/oraInventory/orainstRoot.sh
        2. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

Successfully Setup Software.

4.3. Execute orainstRoot.sh and root.sh script from root user:

[root@dbupgrade ~]# /u01/app/oraInventory/orainstRoot.sh
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@dbupgrade ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_dbupgrade.localdomain_2020-10-04_15-29-11.log for the output of root script
[root@dbupgrade ~]#

5. Oracle Database Creation using DBCA:

[oracle@dbupgrade database]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@dbupgrade oradata]$ export PATH=$PATH:/u01/app/oracle/product/11.2.0/dbhome_1/bin

[oracle@dbupgrade oradata]$ dbca -silent -createDatabase -gdbname orcl -sid orcl -templatename General_Purpose.dbc -syspassword orclsys -systempassword orclsys -emConfiguration none -datafileDestination /u02/oradata/orcl

Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

Validation:

[oracle@dbupgrade oradata]$ . oraenv
ORACLE_SID = [orcl] ?
The Oracle base has been set to /u01/app/oracle
[oracle@dbupgrade oradata]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Oct 4 16:44:15 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT OPEN_MODE, NAME FROM V$DATABASE;

OPEN_MODE            NAME
-------------------- ---------
READ WRITE           ORCL