Install Oracle Database 21C using rpm on OEL8

This article presents how to install Oracle 21C on Oracle Enterprise Linux 8 (OEL8) using rpm

Read following article how to install Oracle Enterprise Linux 8: Install Oracle Linux 8 (OEL8) (for comfort set 8G memory for your virtual machine before proceeding with Oracle software installation).

OS configuration and preparation

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

su - root

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

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

192.168.122.1 oel8 oel8.dbaora.com

Set hostname

hostnamectl set-hostname oel8.dbaora.com --static

It’s recommended to update OS with latest packages

dnf update

Software

Software for 21C is available on OTN or edelivery

Database software to download just single rpm

oracle-database-ee-21c-1.0-1.ol8.x86_64.rpm

All you need to do is logon as root and install above rpm

dnf install oracle-database-ee-21c-1.0-1.ol8.x86_64.rpm

Output is here

[root@oel8 /]# dnf install oracle-database-ee-21c-1.0-1.ol8.x86_64.rpm
Last metadata expiration check: 20:47:23 ago on Wed 16 Feb 2022 03:46:32 PM CET.
Dependencies resolved.
==================================================================================================================================================
Package Architecture Version Repository Size
==================================================================================================================================================
Installing:
oracle-database-ee-21c x86_64 1.0-1 @commandline 2.6 G
Installing dependencies:
compat-openssl10 x86_64 1:1.0.2o-3.el8 ol8_appstream 1.1 M
ksh x86_64 20120801-254.0.1.el8 ol8_appstream 927 k
libXxf86dga x86_64 1.1.5-1.el8 ol8_appstream 26 k
libdmx x86_64 1.1.4-3.el8 ol8_appstream 22 k
libnsl x86_64 2.28-164.0.3.el8 ol8_baseos_latest 104 k
lm_sensors-libs x86_64 3.4.0-23.20180522git70f7e08.el8 ol8_baseos_latest 59 k
oracle-database-preinstall-21c x86_64 1.0-1.el8 ol8_appstream 30 k
sysstat x86_64 11.7.3-6.0.1.el8 ol8_appstream 425 k
xorg-x11-utils x86_64 7.5-28.el8 ol8_appstream 136 k

Transaction Summary
==================================================================================================================================================
Install 10 Packages

Total size: 2.6 G
Total download size: 2.8 M
Installed size: 7.1 G
Is this ok [y/N]: y
Downloading Packages:
(1/9): lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64.rpm 373 kB/s | 59 kB 00:00
(2/9): libnsl-2.28-164.0.3.el8.x86_64.rpm 544 kB/s | 104 kB 00:00
(3/9): libXxf86dga-1.1.5-1.el8.x86_64.rpm 757 kB/s | 26 kB 00:00
(4/9): libdmx-1.1.4-3.el8.x86_64.rpm 577 kB/s | 22 kB 00:00
(5/9): compat-openssl10-1.0.2o-3.el8.x86_64.rpm 3.4 MB/s | 1.1 MB 00:00
(6/9): oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm 322 kB/s | 30 kB 00:00
(7/9): ksh-20120801-254.0.1.el8.x86_64.rpm 3.9 MB/s | 927 kB 00:00
(8/9): sysstat-11.7.3-6.0.1.el8.x86_64.rpm 6.4 MB/s | 425 kB 00:00
(9/9): xorg-x11-utils-7.5-28.el8.x86_64.rpm 2.2 MB/s | 136 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 6.7 MB/s | 2.8 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libdmx-1.1.4-3.el8.x86_64 1/10
Installing : libXxf86dga-1.1.5-1.el8.x86_64 2/10
Installing : xorg-x11-utils-7.5-28.el8.x86_64 3/10
Installing : ksh-20120801-254.0.1.el8.x86_64 4/10
Running scriptlet: ksh-20120801-254.0.1.el8.x86_64 4/10
Installing : compat-openssl10-1:1.0.2o-3.el8.x86_64 5/10
Running scriptlet: compat-openssl10-1:1.0.2o-3.el8.x86_64 5/10
Installing : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 6/10
Running scriptlet: lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 6/10
Installing : sysstat-11.7.3-6.0.1.el8.x86_64 7/10
Running scriptlet: sysstat-11.7.3-6.0.1.el8.x86_64 7/10
Installing : libnsl-2.28-164.0.3.el8.x86_64 8/10
Installing : oracle-database-preinstall-21c-1.0-1.el8.x86_64 9/10
Running scriptlet: oracle-database-ee-21c-1.0-1.x86_64 10/10
Installing : oracle-database-ee-21c-1.0-1.x86_64 10/10
Running scriptlet: oracle-database-ee-21c-1.0-1.x86_64 10/10
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service configuration script
as root: /etc/init.d/oracledb_ORCLCDB-21c configure

Running scriptlet: oracle-database-preinstall-21c-1.0-1.el8.x86_64 10/10
Running scriptlet: oracle-database-ee-21c-1.0-1.x86_64 10/10
Verifying : libnsl-2.28-164.0.3.el8.x86_64 1/10
Verifying : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64 2/10
Verifying : compat-openssl10-1:1.0.2o-3.el8.x86_64 3/10
Verifying : ksh-20120801-254.0.1.el8.x86_64 4/10
Verifying : libXxf86dga-1.1.5-1.el8.x86_64 5/10
Verifying : libdmx-1.1.4-3.el8.x86_64 6/10
Verifying : oracle-database-preinstall-21c-1.0-1.el8.x86_64 7/10
Verifying : sysstat-11.7.3-6.0.1.el8.x86_64 8/10
Verifying : xorg-x11-utils-7.5-28.el8.x86_64 9/10
Verifying : oracle-database-ee-21c-1.0-1.x86_64 10/10

Installed:
compat-openssl10-1:1.0.2o-3.el8.x86_64 ksh-20120801-254.0.1.el8.x86_64 libXxf86dga-1.1.5-1.el8.x86_64
libdmx-1.1.4-3.el8.x86_64 libnsl-2.28-164.0.3.el8.x86_64 lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64
oracle-database-ee-21c-1.0-1.x86_64 oracle-database-preinstall-21c-1.0-1.el8.x86_64 sysstat-11.7.3-6.0.1.el8.x86_64
xorg-x11-utils-7.5-28.el8.x86_64

Complete!

As result of installation of oracle-database-ee-21c-1.0-1.ol8.x86_64.rpm automatically following steps are configured:

  • extra pre-required rpm are downloaded and installed eg. ksh, systat  and so on …
  • os settings dedicated for oracle are applied eg. /etc/sysctl.conf
  • os user oracle is created
  • os groups dedicated for user oracle are created: oinstall dba oper backupdba dgdba kmdba racdba
  • binaries are installed in directory ORACLE_BASE /opt/oracle. ORACLE_HOME is /opt/oracle//product/21c/dbhome_1
  • In log you can see command to install listener and database automatically. However before doing that some other steps should be done
    • /etc/init.d/oracledb_ORCLCDB-21c configure.

Extra steps to do manually:

  • create directory /home/oracle as user root for oracle user
mkdir /home/oracle
chown oracle:oinstall /home/oracle/
  • create .bash_profile in /home/oracle as user oracle

Example /home/oracle/.bash_profile for user oracle

# Oracle Settings
export TMP=/tmp

export ORACLE_HOSTNAME=oel8.dbaora.com
export ORACLE_UNQNAME=ORCLCDB
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/21c/dbhome_1
export ORACLE_SID=ORCLCDB

PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

alias cdob='cd $ORACLE_BASE'
alias cdoh='cd $ORACLE_HOME'
alias tns='cd $ORACLE_HOME/network/admin'
alias envo='env | grep ORACLE'

umask 022

if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
       ulimit -u 16384 
       ulimit -n 65536
    else
       ulimit -u 16384 -n 65536
    fi
fi

envo

Time to install listener and database with following command

/etc/init.d/oracledb_ORCLCDB-21c configure

WARNING – to execute it successful your /etc/hosts must include ip adress for your machine

[oracle@oel8 ~]$ cat /etc/hosts
192.168.122.1 oel8 oel8.dbaora.com
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

Output from running it. Listener is configured LISTENER with port 1521 and pluggable database ORCLDB

[root@oel8 ~]# /etc/init.d/oracledb_ORCLCDB-21c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.Verify connection

Connection test

[oracle@oel8 ~]$ sqlplus / as sysdba

SQL*Plus: Release 21.0.0.0.0 - Production on Sat Mar 5 13:05:49 2022
Version 21.3.0.0.0

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

Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0

SQL> show parameter db_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string ORCLCDB
SQL> alter session set container=ORCLPDB1;

Session altered.

SQL> show con_id

CON_ID
------------------------------
3
SQL> show con_name

CON_NAME
------------------------------
ORCLPDB1
SQL>

Have a fun 🙂

  Tomasz

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.