Skip to main content

Install Oracle Database 19c On Red Hat 8

Overview

Oracle Database 19c is a multi-model database which 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 19c (19.3) 64-bit on Red Hat 8 64-bit.

Lab Environment

Server MachineWork Station or Client Machine
OS ReleaseRed Hat Enterprise Linux release 8.4 (Ootpa)Red Hat Enterprise Linux release 8.4 (Ootpa)
Kernel4.18.0-305.3.1.el8_4.x86_644.18.0-305.7.1.el8_4.x86_64
Oracle Release19.3Oracle SQL Developer Version 19.2.1.247
IP Address192.168.201.11110.100.20.197
Host NameServerClient
User NameAdminUser
Table 01: Lab Environment

Step 1: Download Software

Go to the below office site.

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

And download the following version. As of date Tue Aug 3 13:01:35 +06 2021, the latest version of the Oracle Database for Red Hat is:

Oracle Database 19c (19.3) for Linux x86-64

Step 2: Edit Server Host File

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

Server_IP_address fully_qualified_host_name host_name

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

After that, the file will be like that:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.201.111 Server.localdomain Server

Here, Server is the hostname and the IP address of the server is 192.168.201.111.

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 Manual Setup for this reason we need to complete all tasks by ourselves, and then we go Additional Setup if you want to go with the Automatic Setup checkout here.

3.1. The Manual Setup:

In this process, we will complete most of your prerequisites system setup tasks manually and will complete the following tasks:

Installs any additional RPM packages and dependencies that required
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 bc
[Admin@Server ~]$ sudo dnf install -y binutils
[Admin@Server ~]$ sudo dnf install -y compat-libcap1
[Admin@Server ~]$ sudo dnf install -y compat-libstdc++-33
[Admin@Server ~]$ sudo dnf install -y dtrace-modules
[Admin@Server ~]$ sudo dnf install -y dtrace-modules-headers
[Admin@Server ~]$ sudo dnf install -y dtrace-modules-provider-headers
[Admin@Server ~]$ sudo dnf install -y dtrace-utils
[Admin@Server ~]$ sudo dnf install -y elfutils-libelf
[Admin@Server ~]$ sudo dnf install -y elfutils-libelf-devel
[Admin@Server ~]$ sudo dnf install -y fontconfig-devel
[Admin@Server ~]$ sudo dnf install -y glibc
[Admin@Server ~]$ sudo dnf install -y glibc-devel
[Admin@Server ~]$ sudo dnf install -y ksh
[Admin@Server ~]$ sudo dnf install -y libaio
[Admin@Server ~]$ sudo dnf install -y libaio-devel
[Admin@Server ~]$ sudo dnf install -y libdtrace-ctf-devel
[Admin@Server ~]$ sudo dnf install -y libXrender
[Admin@Server ~]$ sudo dnf install -y libXrender-devel
[Admin@Server ~]$ sudo dnf install -y libX11
[Admin@Server ~]$ sudo dnf install -y libXau
[Admin@Server ~]$ sudo dnf install -y libXi
[Admin@Server ~]$ sudo dnf install -y libXtst
[Admin@Server ~]$ sudo dnf install -y libgcc
[Admin@Server ~]$ sudo dnf install -y librdmacm-devel
[Admin@Server ~]$ sudo dnf install -y libstdc++
[Admin@Server ~]$ sudo dnf install -y libstdc++-devel
[Admin@Server ~]$ sudo dnf install -y libxcb
[Admin@Server ~]$ sudo dnf install -y make
[Admin@Server ~]$ sudo dnf install -y net-tools
[Admin@Server ~]$ sudo dnf install -y nfs-utils
[Admin@Server ~]$ sudo dnf install -y python
[Admin@Server ~]$ sudo dnf install -y python-configshell
[Admin@Server ~]$ sudo dnf install -y python-rtslib
[Admin@Server ~]$ sudo dnf install -y python-six
[Admin@Server ~]$ sudo dnf install -y targetcli
[Admin@Server ~]$ sudo dnf install -y smartmontools
[Admin@Server ~]$ sudo dnf install -y sysstat
[Admin@Server ~]$ sudo dnf install -y unixODBC
[Admin@Server ~]$ sudo dnf install -y unixODBC-devel
[Admin@Server ~]$ sudo dnf install -y libnsl
[Admin@Server ~]$ sudo dnf install -y libnsl.i686
[Admin@Server ~]$ sudo dnf install -y libnsl2
[Admin@Server ~]$ sudo dnf install -y 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. Set Kernel Parameter Values

We can choose either “/etc/sysctl.conf” or “/etc/sysctl.d/98-oracle.conf” file to set the following Kernel parameters. In this case we choose “/etc/sysctl.d/98-oracle.conf” file:

Note:

Step 4: Make sure that all your database instances are up (including ASM instances) as they would run on production. Use the script hugepages_settings.sh in Document 401749.1 to calculate the recommended value for the vm.nr_hugepageskernel parameter. e.g.:


$ ./hugepages_settings.sh

...

Recommended setting: vm.nr_hugepages = 163842

$

Note: You can also calculate a proper value for the parameter yourself but that is not advised if you do not have extensive experience with HugePages and concepts.


Step 5: Edit the file /etc/sysctl.conf and set the vm.nr_hugepages parameter there:


...

vm.nr_hugepages = 163842

...

This will make the parameter to be set properly with each reboot.


[Admin@Server ~]$ sudo tee -a /etc/sysctl.d/98-oracle.conf >/dev/null <<'EOF'

# start for oracle

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
vm.nr_hugepages = 163842

# end for oracle

EOF

Depending on the file, run the following command to load these kernel parameters to the system.

[Admin@Server ~]$ sudo /sbin/sysctl -p
Or
[Admin@Server ~]$ sudo /sbin/sysctl -p /etc/sysctl.d/98-oracle.conf

3.1.3. Sets Resource Limits

Create a file under ‘/etc/security/limits.d/‘ and assign the recommended resource limits for Oracle Database 19c. These settings can also be done in a *.conf file under /etc/security/limits.d/ directory. Also if there is a *.conf file in /etc/security/limits.d/ that has settings for memlock, setting it up in /etc/security/limits.conf may not work. Make sure you check the files /etc/security/limits.d/*.conf files.

This configuration file may be distribution specific. Contact your system administrator for distribution specific configuration file information.

memlock soft and hard limit: unlimited

[Admin@Server ~]$ sudo tee -a /etc/security/limits.d/resource-limit-oracle-database-19c.conf >/dev/null <<'EOF'

# start for oracle


oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 483183816
oracle soft memlock 483183816


# end for oracle

EOF

Note: Have the memlock user limit set in /etc/security/limits.conf file. Set the value (in KB) slightly smaller than installed RAM. e.g. If you have 64GB RAM installed, you may set:

*   soft   memlock    60397977
*   hard   memlock    60397977

or

oracle   soft   memlock    60397977
oracle   hard   memlock    60397977

Have the memlock user limit set in /etc/security/limits.conf file. Set the value (in KB) slightly smaller than installed RAM. e.g. If you have 512GB RAM installed, you may set:

*   soft   memlock    483183816
*   hard   memlock    483183816

or

oracle   soft   memlock    483183816
oracle   hard   memlock    483183816

3.1.4. Create Oracle User and Groups

The following example shows how to create the user oracle with the user ID 54321; with the primary group oinstall; and with secondary groups dba, asmdba, backupdba, dgdba, kmdba, and racdba:

[Admin@Server ~]$ groupadd -g 54321 oinstall
[Admin@Server ~]$ groupadd -g 54322 dba
[Admin@Server ~]$ groupadd -g 54323 oper 
[Admin@Server ~]$ groupadd -g 54324 backupdba
[Admin@Server ~]$ groupadd -g 54325 dgdba
[Admin@Server ~]$ groupadd -g 54326 kmdba
[Admin@Server ~]$ groupadd -g 54327 asmdba
[Admin@Server ~]$ groupadd -g 54328 asmoper
[Admin@Server ~]$ groupadd -g 54329 asmadmin
[Admin@Server ~]$ groupadd -g 54330 racdba
[Admin@Server ~]$ useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,asmadmin,racdba oracle

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 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 firewalld

To configure the firewall please follow the link.

3.3.4. Create database installation directory:

In this tutorial, we will use different directories for each type of database file.

Note:Do not put the oraInventory directory under the Oracle base directory for a new installation, because that can result in user permission errors for other installations.

[Admin@Server ~]$ sudo mkdir -p /u01/app/oracle/product/19c/db_1
[Admin@Server ~]$ sudo mkdir -p /u02/oradata
[Admin@Server ~]$ sudo mkdir -p /u03/recovery_area

Change the permission of these directories to oracle user.

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

Step 4. Configure Environment Variable

This step creates a script file for the environment variable and then assign 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 “Oracle19cEnvVar.sh” in that directory. And put the following content to that file:

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

#Start Oracle Settings

export TMP=/tmp
export TMPDIR=\$TMP
export ORACLE_HOSTNAME=Server
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/19c/db_1
export ORACLE_OWNER=oracle
export ORACLE_UNQNAME=oracledbdc
export ORACLE_DBNAME=oracledb
export ORACLE_SID=oracledb
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

#End Oracle Settings

EOF

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

[oracle@Server ~]$ echo ". /home/oracle/scripts/Oracle19cEnvVar.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 yum 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: Upload Oracle Database software to Server

In this case, we already download the oracle software on our client machine‘s “/tmp” directory. So, at first, we need to log in to the client machine and then upload the zip file of Oracle software to the “/tmp” directory of the server.

[Admin@Server ~]$ ssh -X User@10.100.20.197
[User@Client ~]$ sudo scp -v /tmp/LINUX.X64_193000_db_home.zip oracle@192.168.201.111:/tmp/

Log in to the server with the oracle user and unzip the software file into the ORACLE_HOME directory.

[User@Client ~]$ ssh -X oracle@192.168.201.111
[oracle@Server ~]$ unzip /tmp/LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19c/db_1

Now reboot (from root or sudo user in this case Admin) the server:

[oracle@Server ~]$ su - Admin
[Admin@Server ~]$ sudo reboot

After rebooting log into the server using oracle user with graphical user interface feature.

[User@Client ~]$ ssh -X oracle@192.168.201.111

Step 7: Suppress the OS Version Error

We may receive the following error when installing Oracle database 19c Installer on 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 OLE8 in “cvu_config” file as:

[oracle@Server ~]$ cp -pvf /u01/app/oracle/product/19c/db_1/cv/admin/cvu_config /u01/app/oracle/product/19c/db_1/cv/admin/cvu_config.bak
[oracle@Server ~]$ sed -i 's/#CV_ASSUME_DISTID=OEL5/CV_ASSUME_DISTID=OEL8/' /u01/app/oracle/product/19c/db_1/cv/admin/cvu_config

Step 8: Installation Oracle Database On Red Hat

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 /u01/app/oracle/product/19c/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:

Configure Option: Create and configure a single instance database
System Class: Server class
Database Edition: Enterprise Edition
Installation Location: /u01/app/oracle
Create Inventory: /u01/app/oraInventory
oraInventory Group Name: oinstall
Configuration Type: General Purpose / Transaction Processing
Database Identificaton:
Global database name: oracledbdc
Oracle system identifier (SID): oracledb
Pluggable database name: hrpdb
Configuration Options:
Memory: Uncheck ‘Enable Automatic Memory Management’
Character sets: use Unicode (AL32UTF8)
Simple schemas: Uncheck ‘Install sample schemas in the database’
Database Storage:
File system: /u02/oradata
Management Options: Uncheck ‘Register with Enterprise Manager (EM) Cloud Control’
Recovery Optionsa: Check ‘Enable Recovery’
File system: /u03/recovery_area
Schema Passwords: Check ‘use the same password for all accounts’ and set same password for SYS, SYSTEM, PDBADMIN USER
Operating System Groups:
Database Administrator (OSDBA) group: dba
Database Operator (OSOPER) group (Optional): oper
Database Backup and Recovery (OSBACKUPDBA) group: backupdba
Data Guard administrative (OSDGDBA) group: dgdba
Encryption Key Management administrative (OSKMDBA) group: kmdba
Real Application Cluster administrative (OSRACDBA) group: racdba
Root script execution: Uncheck ‘Automatically run configuration scripts’
Prerequisite Checks: will run automatically
Summary: Save the summaruy description
Install Product: This section take sometimes. When prompted these following scripts run these from root or sudo user as follows
Finish: If we see the installation process is complete then we see ‘Oracle Enterprise Manager Database Express URL: https://Server.localdomain:5500/em’ this type of popup message and then close the installation window

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

[Admin@Server ~]$ sudo bash /u01/app/oraInventory/orainstRoot.sh
[Admin@Server ~]$ sudo bash /u01/app/oracle/product/19c/db_1/root.sh

Close the installation window when we see the above screen.

Step 9: Post Installation

Set the restart flag to ‘Y‘ in the “/etc/oratab” file from root or sudo user:

[oracle@Server ~]$ su - Admin
[Admin@Server ~]$ sudo sed -i -e 's/oracledb:\/u01\/app\/oracle\/product\/19c\/db_1:N/oracledb:\/u01\/app\/oracle\/product\/19c\/db_1:Y/' /etc/oratab

Creating a Backup of the root.sh Script: Oracle recommends that you back up the root.sh script after you complete an installation. If you install other products in the same Oracle home directory subsequent to this installation, then Oracle Universal Installer updates the contents of the existing root.sh script during the installation. If you require information contained in the original root.sh script, then you can recover it from the backed up root.sh file.

Local Connectivity

Log in to the server using oracle user and connect:

[Admin@Server ~]$ su - oracle
[oracle@Server ~]$ sqlplus / as sysdba

Remote Connectivity

Now we connect the database from our remote client machine. To do this we use Oracle SQL Developer as a client application. If you are new to Oracle SQL Developer please visit here.

Open Oracle SQL Developer and provide the following connection parameter:

Name: Test_DB_Connection_from_Client_Machine
Username: sys
Role: SYSDBA
Password: <Password of SYS user>
Hostname: 192.168.201.111
Port: 1521
Service name: oracledbdc

Connectivity from Oracle SQL Developer:

Click on the Test button it will show the Status is Success then Save and Connect.

Conclusion

This will help you to install Oracle Database 19c 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 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: #

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                                     1 92.168.0.10 Host Name                                  oemsrv User Na