Saturday, 11 January 2025

Installing Oracle Database Software on Oracle Linux 8

This post talks about Installation of Oracle Database on Oracle Linux 8. Here I am running a Virtual Machine creating using Virtual Box and have installed OL8 on it. Also, I am going with Oracle Database 19c version as it's one of the latest version which is being used in the market as of now.

If you also want to see how I have configured the VM on virtual box, please comment below and I'll create one post for that as well.

So let's start.

1) Check if hostname is properly configured

hostnamectl set-hostname oravm19c.practice.com

2) Check if '/etc/hosts' files is properly configured with IP and fully qualified name.

[root@localhost ~]# cat /etc/hosts 

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

192.168.29.67	oravm19c.practice.com	oravm19c

3) Install prerequisites as shown below. This one command reduces your manual efforts and get the job done for you.

[root@localhost ~]# dnf install -y oracle-database-preinstall-19c
Oracle Linux 8 BaseOS Latest (x86_64)                                                                                          11 MB/s |  86 MB     00:07    
Oracle Linux 8 Application Stream (x86_64)                                                                                     11 MB/s |  66 MB     00:06    
Latest Unbreakable Enterprise Kernel Release 7 for Oracle Linux 8 (x86_64)                                                     11 MB/s |  52 MB     00:04    
Last metadata expiration check: 0:00:09 ago on Saturday 11 January 2025 07:45:15 AM EST.
Dependencies resolved.
==============================================================================================================================================================
 Package                                       Architecture          Version                                           Repository                        Size
==============================================================================================================================================================
Installing:
 oracle-database-preinstall-19c                x86_64                1.0-2.el8                                         ol8_appstream                     31 k
Installing dependencies:
 glibc-devel                                   x86_64                2.28-251.0.2.el8                                  ol8_baseos_latest                 89 k
 ksh                                           x86_64                20120801-267.0.1.el8                              ol8_appstream                    923 k
 libaio-devel                                  x86_64                0.3.112-1.el8                                     ol8_baseos_latest                 19 k
 libnsl                                        x86_64                2.28-251.0.2.el8                                  ol8_baseos_latest                111 k
 libstdc++-devel                               x86_64                8.5.0-21.0.1.el8                                  ol8_appstream                    2.1 M
 libxcrypt-devel                               x86_64                4.1.1-6.el8                                       ol8_baseos_latest                 25 k
 lm_sensors-libs                               x86_64                3.4.0-23.20180522git70f7e08.el8                   ol8_baseos_latest                 59 k
 make                                          x86_64                1:4.2.1-11.el8                                    ol8_baseos_latest                498 k
 sysstat                                       x86_64                11.7.3-13.0.2.el8_10                              ol8_appstream                    427 k

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

Total download size: 4.2 M
Installed size: 18 M
Downloading Packages:
(1/10): libaio-devel-0.3.112-1.el8.x86_64.rpm                                                                                  70 kB/s |  19 kB     00:00    
(2/10): libxcrypt-devel-4.1.1-6.el8.x86_64.rpm                                                                                1.1 MB/s |  25 kB     00:00    
(3/10): glibc-devel-2.28-251.0.2.el8.x86_64.rpm                                                                               269 kB/s |  89 kB     00:00    
(4/10): lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64.rpm                                                            1.2 MB/s |  59 kB     00:00    
(5/10): libnsl-2.28-251.0.2.el8.x86_64.rpm                                                                                    322 kB/s | 111 kB     00:00    
(6/10): make-4.2.1-11.el8.x86_64.rpm                                                                                          4.5 MB/s | 498 kB     00:00    
(7/10): ksh-20120801-267.0.1.el8.x86_64.rpm                                                                                   8.3 MB/s | 923 kB     00:00    
(8/10): oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm                                                                   2.1 MB/s |  31 kB     00:00    
(9/10): sysstat-11.7.3-13.0.2.el8_10.x86_64.rpm                                                                               4.8 MB/s | 427 kB     00:00    
(10/10): libstdc++-devel-8.5.0-21.0.1.el8.x86_64.rpm                                                                          7.4 MB/s | 2.1 MB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                         6.5 MB/s | 4.2 MB     00:00     
Oracle Linux 8 BaseOS Latest (x86_64)                                                                                         3.0 MB/s | 3.1 kB     00:00    
Importing GPG key 0xAD986DA3:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                      1/1 
  Installing       : libxcrypt-devel-4.1.1-6.el8.x86_64                                                                                                  1/10 
  Installing       : glibc-devel-2.28-251.0.2.el8.x86_64                                                                                                 2/10 
  Running scriptlet: glibc-devel-2.28-251.0.2.el8.x86_64                                                                                                 2/10 
  Installing       : libstdc++-devel-8.5.0-21.0.1.el8.x86_64                                                                                             3/10 
  Installing       : ksh-20120801-267.0.1.el8.x86_64                                                                                                     4/10 
  Running scriptlet: ksh-20120801-267.0.1.el8.x86_64                                                                                                     4/10 
  Installing       : make-1:4.2.1-11.el8.x86_64                                                                                                          5/10 
  Running scriptlet: make-1:4.2.1-11.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-13.0.2.el8_10.x86_64                                                                                                 7/10 
  Running scriptlet: sysstat-11.7.3-13.0.2.el8_10.x86_64                                                                                                 7/10 
  Installing       : libnsl-2.28-251.0.2.el8.x86_64                                                                                                      8/10 
  Installing       : libaio-devel-0.3.112-1.el8.x86_64                                                                                                   9/10 
  Running scriptlet: oracle-database-preinstall-19c-1.0-2.el8.x86_64                                                                                    10/10 
  Installing       : oracle-database-preinstall-19c-1.0-2.el8.x86_64                                                                                    10/10 
  Running scriptlet: oracle-database-preinstall-19c-1.0-2.el8.x86_64                                                                                    10/10 
  Verifying        : glibc-devel-2.28-251.0.2.el8.x86_64                                                                                                 1/10 
  Verifying        : libaio-devel-0.3.112-1.el8.x86_64                                                                                                   2/10 
  Verifying        : libnsl-2.28-251.0.2.el8.x86_64                                                                                                      3/10 
  Verifying        : libxcrypt-devel-4.1.1-6.el8.x86_64                                                                                                  4/10 
  Verifying        : lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64                                                                              5/10 
  Verifying        : make-1:4.2.1-11.el8.x86_64                                                                                                          6/10 
  Verifying        : ksh-20120801-267.0.1.el8.x86_64                                                                                                     7/10 
  Verifying        : libstdc++-devel-8.5.0-21.0.1.el8.x86_64                                                                                             8/10 
  Verifying        : oracle-database-preinstall-19c-1.0-2.el8.x86_64                                                                                     9/10 
  Verifying        : sysstat-11.7.3-13.0.2.el8_10.x86_64                                                                                                10/10 

Installed:
  glibc-devel-2.28-251.0.2.el8.x86_64                        ksh-20120801-267.0.1.el8.x86_64             libaio-devel-0.3.112-1.el8.x86_64                  
  libnsl-2.28-251.0.2.el8.x86_64                             libstdc++-devel-8.5.0-21.0.1.el8.x86_64     libxcrypt-devel-4.1.1-6.el8.x86_64                 
  lm_sensors-libs-3.4.0-23.20180522git70f7e08.el8.x86_64     make-1:4.2.1-11.el8.x86_64                  oracle-database-preinstall-19c-1.0-2.el8.x86_64    
  sysstat-11.7.3-13.0.2.el8_10.x86_64                       

Complete!

4) Change password for Oracle User.

[root@localhost ~]# 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.

5) Set Secure Linux to permissive in '/etc/selinux/config' as shown below.

[root@localhost ~]# vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

6) Enforce the changes using.

[root@localhost ~]# setenforce Permissive

7) Disable Firewall.

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# 

8) Create the directories for Oracle Installation and change ownership/permissions.

[root@localhost ~]# mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
[root@localhost ~]# chown -R oracle:oinstall /u01
[root@localhost ~]# chmod -R 775 /u01

9) Open DISPLAY access for all users.

[root@localhost ~]# xhost +

10) Configure environment in bash profile as shown below.

[root@localhost ~]# vi /home/oracle/.bash_profile

# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=oravm19c.practice.com
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=$ORACLE_BASE/oradata

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

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

11) Switch to ORACLE user and change directory to ORACLE_HOME, then unzip the Oracle Software as shown below.

Note: Ensure the zip file is reachable and it must be unzipped to ORACLE_HOME.

[root@localhost ~]# su - oracle
[oracle@oravm19c app]$ cd $ORACLE_HOME
[oracle@oravm19c dbhome_1]$ unzip -oq /u01/app/LINUX.X64_193000_db_home.zip

12) Run installer

[oracle@oravm19c dbhome_1]$ ./runInstaller 

Launching Oracle Database Setup Wizard...


13) If OS Prerequisite check fails. Fix using below,

[oracle@oravm19c dbhome_1]$ export CV_ASSUME_DISTID=OEL7.6

and run again...

[oracle@oravm19c dbhome_1]$ ./runInstaller 
Launching Oracle Database Setup Wizard...

14) Follow the next steps as shown in the below snapshots.
Note: These snapshots only covers the Oracle Software Installation part.










Run the 2 scripts via ROOT in defined sequence when prompt comes,

[root@localhost ~]# /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@localhost ~]# /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/19.3.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Oracle Trace File Analyzer (TFA - Standalone Mode) is available at :
    /u01/app/oracle/product/19.3.0/dbhome_1/bin/tfactl

Note :
1. tfactl will use TFA Service if that service is running and user has been granted access
2. tfactl will configure TFA Standalone Mode only if user has no access to TFA Service or TFA is not installed



At this point, Oracle Software has been successfully installed.

I hope this helps !!

No comments:

Post a Comment