Skip to main content

Software-only Installation of oracle Database 21c on RHEL 8

Overview


Oracle Database 21c is a multi-model database that provides full support for relational and non-relational data, such as JSON, XML, text, spatial and graph data. There are lots of new features available in this new release like partitioned hybrid tables, encryption capabilities in the built-in data dictionary, statistics-only queries, and many more. It also enables Oracle's Autonomous Database Cloud Services. This article describes the installation of Oracle Database 21c 64-bit on Red Hat 8 64-bit.

Lab Environment


Particulars                                 Database Info
--------------                                  -------------------------------------------------------
OS Release                                  Red Hat Enterprise Linux release 8.4 (Ootpa)
Kernel                                          4.18.0-425.10.1.el8_7.x86_64
IP Address                                   192.168.0.10
Host Name                                  oemsrv
User Name                                  Admin, oracle
ORACLE_HOME                      /opt/oracle/product/21c/db_1
Oracle Release                            Oracle Database 21.3.0.0.0
SQL*Plus Release                      21.0.0.0.0
DATABASE_ROLE                   PRIMARY
db_unique_name                         emproddbdc
db_name                                      emproddb
IS_CDB                                       YES
OPEN_MODE                             READ WRITE
LOG_MODE                               ARCHIVELOG
FLASHBACK_ON                     YES
remote_login_passwordfile         EXCLUSIVE

Step 1: Download the Software


Go to the below office site.

https://www.oracle.com/database/technologies/oracle21c-linux-downloads.html

And download the following version. As of date Tue Feb 21 10:44:44 AM +06 2023, the latest version of the Oracle Database for Red Hat is:

Oracle Database 21c (21.3) for Linux x86-64 (RPM)

Step 2: Edit Server Host File

Add the hostname and IP address in the last line of the "/etc/hosts" file in the following format.

Server_IP_address fully_qualified_host_name host_name

[Admin@Server ~]$ sudo sed -i '$ a 192.168.0.10 oemsrv.localdomain oemsrv' /etc/hosts

Here, oemsrv is the hostname and the IP address of the server is 192.168.0.10.

Step 3: Basic Prerequisites for Oracle Installation


We divided this step into three sections (1) the Automatic Setup or (2) the Manual Setup and (3) the Additional Setup. The Additional Setup is mandatory for both processes. In this tutorial, we follow the Automatic Setup that will complete all of our manual tasks, and then we go to Additional Setup. If you want to go with the Manual Setup, check out here.
 

3.1. The Automatic Setup


In this process, the Oracle Database Preinstallation RPM package will complete most of your prerequisites system setup tasks:

Automatically downloads and installs any additional RPM packages and dependencies
As needed, sets sysctl.conf settings and recommendations values for system startup parameters, and driver parameters
Sets hard and soft resource limits, and kernel parameter
Creates an oracle user and the oraInventory (oinstall) and OSDBA (dba) groups
For Linux x86_64 machines, Sets numa=off in the kernel.

3.1.1. Install Dependent Package


At first, manually install some basic prerequisite rpm that will suppress future conflicts:

[Admin@Server ~]$ sudo dnf install -y unixODBC unixODBC-devel libnsl libnsl.i686 libnsl2 libnsl2.i686

May you not find the following RPM packages in the local repository.

compat-libcap1
compat-libstdc++-33


So, download these RPMs from the rpm finder:

[Admin@Server ~]$ sudo wget https://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/compat-libcap1-1.10-7.el7.x86_64.rpm
[Admin@Server ~]$ sudo wget https://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm


And then install:

[Admin@Server ~]$ sudo dnf -y localinstall compat-libcap1-1.10-7.el7.x86_64.rpm
[Admin@Server ~]$ sudo dnf -y localinstall compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm

3.1.2. Install Oracle 21c Prerequisite Package


To perform all our prerequisite setup automatically, we need to install the oracle-provided "oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm" package. By default, this package is not present in the Red Hat repository list.

To download this rpm, run the following command:

[Admin@Server ~]$ curl -o oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm

And then install as follows:

[Admin@Server ~]$ sudo dnf -y localinstall oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
[Admin@Server ~]$ sudo dnf update -y


3.3. The Additional Setup

 
In this section, we can do some configurations such as the password set for oracle user, change the SELinux tag to permissive, stop the firewall, create installation directories etc. These steps are described in the following section:

3.3.1. Set the password for oracle user:


[Admin@Server ~]$ sudo passwd oracle

Provide your super-secret password for the oracle user.

3.3.2. Set SELinux flag:


Change the SELinux flag to permissive in the"/etc/selinux/config" file.

[Admin@Server ~]$ sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config

3.3.3. Stop and disable the firewall service:


[Admin@Server ~]$ sudo systemctl stop firewalls
[Admin@Server ~]$ sudo systemctl disable firewalls

To configure the firewall please follow the link.

3.3.4. Create database installation directory:


Oracle home directory,

[Admin@Server ~]$ sudo mkdir -p /opt/oracle/product/21c/db_1

Change the permission of these directories to oracle user.

[Admin@Server ~]$ sudo chown -R oracle:oinstall /opt
[Admin@Server ~]$ sudo chmod -R 775 /opt


Step 4. Configure Environment Variable


This step creates a script file for the environment variable and then assigns it (the script file) to the "/home/oracle/.bash_profile" file. To complete this task, Log in to the oracle user.

[Admin@Server ~]$ su - oracle

Create a directory to keep the scripts:

[oracle@Server ~]$ mkdir /home/oracle/.scripts

Create a script file named "Oracle21cEnvVar.sh" in that directory. And put the following content to that file:

[oracle@Server ~]$ cat > /home/oracle/.scripts/Oracle21cEnvVar.sh <<EOF

#Start Oracle Settings

export TMP=/tmp
export TMPDIR=\$TMP

export ORACLE_HOSTNAME=oemsrv
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/21c/db_1

export ORACLE_OWNER=oracle
export ORACLE_UNQNAME=oemdbdc
export ORACLE_DBNAME=oemdb
export ORACLE_SID=oemdb

export PATH=\$PATH:\$HOME/bin:\$ORACLE_HOME:\$ORACLE_HOME/bin
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export LIBPATH=\$ORACLE_HOME/lib:\$LIBPATH
export CLASSPATH=\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib

#oem start
export OMS_HOME=/opt/oracle/middleware
export AGENT_HOME=/opt/oracle/agent/agent_inst
#oem stop

#End Oracle Settings

EOF


Now add this file to the end of the"/home/oracle/.bash_profile" file.

[oracle@Server ~]$ echo ". /home/oracle/.scripts/Oracle21cEnvVar.sh" >> /home/oracle/.bash_profile

To start and stop the database using Linux Service with the help of dbstart and dbshut utility respectively. Please check the link.

Step 5: Exporting Graphical User Interface


For exporting GUI display, install these following packages in the server from root or sudo user. Log in to Admin user and run the following command:

[oracle@Server ~]$ su - Admin
[Admin@Server ~]$ sudo dnf install -y xdpyinfo xorg-x11-xauth


And change the value of "ForwardX11" from "no" to "yes" in the following file:

[Admin@Server ~]$ sudo sed -i -E 's/#\s+ForwardX11 no/ForwardX11 yes/' /etc/ssh/ssh_config

Step 6: Unzip Oracle Database software to Home Directory


[oracle@Server ~]$ unzip /tmp/oracle21c/LINUX.X64_213000_db_home.zip -d /opt/oracle/product/21c/db_1

Step 7: Suppress the OS Version Error


We may receive the following error when installing Oracle database 21c Installer on the Red Hat 8 (64-bit) platform:

[INS-13001] Oracle Database is not supported on this operating system. The installer will not perform prerequisite checks on the system.

To suppress this error change the distribution id to OL8 in "cvu_config" file as:

[oracle@Server ~]$ cp -prfv /opt/oracle/product/21c/db_1/cv/admin/cvu_config /opt/oracle/product/21c/db_1/cv/admin/cvu_config.bak
[oracle@Server ~]$ sed -i 's/#CV_ASSUME_DISTID=OL7/CV_ASSUME_DISTID=OL8/' /opt/oracle/product/21c/db_1/cv/admin/cvu_config
 

Step 8: Installation of Oracle Database


Go to the ORACLE_HOME directory and start the Oracle Universal Install (OUI) interactively by issuing the following command. If you want to run this installer silently then check this link.

[oracle@Server ~]$ bash /opt/oracle/product/21c/db_1/runInstaller

In this installation process, we will create and configure an Oracle Database Enterprise Edition Server. For RAC and Upgrade installation choose 'Set UP Software Only'. The Server Class option for a production data center allows for more advanced configuration options such as Oracle RAC, ASM, RMAN, integration with OEM, etc.

Choose the following option for this installation process:

Response File:

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v21.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/opt/oraInventory
ORACLE_BASE=/opt/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=racdba
oracle.install.db.rootconfig.executeRootScript=true
oracle.install.db.rootconfig.configMethod=ROOT


If the installation failed due to a Run Level error please check this link.

I provide executeRootScript=true and credentials for automatically running the script. During the installation process, I only acknowledge it. Close the installation window when we see the successful message.

Conclusion


This will help you to install Oracle Database 21c on Red Hat Linux 8 step by step. If you have any queries please comment to us.

References


This tutorial follows the official docs as a reference Database Installation Guide for Linux.

Comments

Popular posts from this blog

Upgrading Issue for RHEL 7 to 8 With Leapp

Overview The Leapp utility is a framework for updating and upgrading operating systems as well as applications. The operations of this utility consist of two phases 1. the preupgrade Phase – that chack the upgrade possibilities and 2. the actual upgrade phase – that map packages between previous and current versions of the software packages. Issue – 01: After running ‘ sudo leapp preupgrade ‘ sometimes you find the below issue in ‘ /var/log/leapp/leapp-report.txt ‘. Detail: Risk Factor: high (inhibitor) Title: Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed. Summary: Support for the following RHEL 7 device drivers has been removed in RHEL 8: – pata_acpi Key: f08a07da902958defa4f5c2699fae9ec2eb67c5b Remediation: 1. Disable detected kernel drivers in order to proceed with the upgrade process using the rmmod or modprobe -r . rmmod – Simple program to remove a module from the Linux Kernel modprobe – Add and remove modules from the Linux Ke

Upgrading Oracle Linux 6 to 7

Overview It is possible to upgrade an Oracle Linux 6 system to Oracle Linux 7.6 under the following conditions: The system meets the minimum installation requirements for Oracle Linux 7 as described in Chapter 1, System Requirements and Limits. The Oracle Linux 6 system has been completely updated from the ol6_x86_64_latest channel or ol6_latest repository. UEK R3 or UEK R4 has been installed on the system to be upgraded and is the default boot kernel. Upgrading from UEK R2 is not supported. Note that the system is upgraded to use the UEK R5 release provided with Oracle Linux 7.6. Upgrading is supported only for systems that are installed with the Minimal Install base environment. If additional packages are installed from an alternative repository or channel, upgrade might fail or the resulting upgrade might not function as expected. reference: https://docs.oracle.com/en/operating-systems/oracle-linux/7/relnotes7.6/ol7-install.html#ol7-upgrade-ol6 Verifying the system before Upgrade: #