Oracle 19c Pre-Installation on Linux 7.9
I would like to share the process of setting up my Oracle Database test environment with you. Along with all the errors I encountered during this journey.
At our company, our Database Consultant always emphasizes, “Prepare a document so that even a passerby can install the Oracle Database.” and this is truly invaluable. I also want to follow this belief and show you everything from the very basics, starting from scratch.
Furthermore, our Consultant often say, “Anyone who knows how to read and write can do this job.” If someone successfully performs the installation using this document from scratch, could they please let me know? 🙂
First and foremost, we need order. We need to know what we are doing. We must carefully plan all the necessary definitions for our server. I used VMware Workstation 17 Player for the installation of the virtual test server. All the needed links are down below.
1- VMware Workstation 17 Player
I have created the environment and storage details below. Maintaining an organized structure always facilitates smooth progress. I will explain the disk configuration in detail during the installation process.
If you notice any mistakes in what I’ve written, feel to free to send a message.
Alright let’s start the installation. We can proceed by creating a new virtual machine.
If you prefer you can add the ISO later but I’m adding at this stage.
I’m indicating the file path for the ISO that I downloaded by selecting it. I had set my server name as “TESTSRV1.” I’m also specifying the logical name of my virtual machine here in the same way.
Since I planned ahead, I know that I will need approximately 150 GB of space for disk configuration. I am proceeding with the option Split virtual disk into multiple files. While using a single large file reduces complexity, splitting into smaller chunks can offer greater flexibility.
I’ve set the server’s memory to 4 GB. As it’s going to be a test server, we don’t need excessive memory and CPU power.
NAT Network allows virtual machines to communicate with each other, enabling the creation of isolated networks for testing and development environments without the need to use actual network resources.
Play virtual machine!
Select Install Oracle Linux 7.9 using down and up keys.
Set your local area timezone.
Set the keyboard choice the server will need.
Move up the keyboard option you want to be in standard.
KDUMP can be disabled because of its potential performance impact, storage issues, or incompatibility with specific usage scenarios. Enabling or disabling kdump should be evaluated based on system requirements and usage scenarios.
Security policies are rules and procedures created to safeguard systems and data, restrict unauthorized access and ensure compliance with standards. However, there are instances where disabling a security policy might be necessary.
And you know, this is our test server :)
I’m enabling my network and applying the hostname as “TESTSRV1". And I have to manually configure the IP address that was automatically assigned by DHCP. So I have to continue with Configure option.
I’m selecting the option marked in yellow. This will prevent me from having to manually bring the network up every time the server is restarted. I’m also entering the manually assigned IP address received from DHCP.
I’m completing this process by selecting Done.
We have come to one of the most crucial parts. We need to configure and set up our disks properly. Select Installation Destination.
Click I will configure partitioning and done. Next, the screen on the right will open. Click on the “+” to proceed.
I had specified the disks I need in the “Disk Configuration” section. However, we need to partition these into VG (Volume Groups) and LV (Logical Volumes). VGs and LVs provide flexible storage management through LVM. This helps you make better use of disk space, manage data effectively, and size according to requirements.
After clicking on ‘+’, the mount point screen will appear. The ‘/’ directory is the root directory, and I had decided to allocate 20 GB here. And after click “Add mount point”.
It automatically assigned the volume group for the root.
I will proceed by creating a volume group named “vg_root” for system disks. For this, I am selecting the “Create a new volume group” option.
I’m saving it by entering “vg_root” in the name field.
As you can see Root’s volume group is changed. I’m changing the logical volume (lv) to “lv_root”. Then click modify.
While configuring the disks I need for Oracle Database, I will assign a dedicated volume group (VG) to each one. For example, I have created a volume group named “vg_u01” for the /u01 disk as shown below.
What I’m showing below is about using the predefined vg_root when configuring the /var disk without creating a new vg_root again.
I’m allocating 2 GB to the /boot partition. For swap as a best practice, it’s recommended to have the swap space be 2 or 4 times the server’s memory. I allocated twice the amount of my memory. Of course, on a test server, you might not need swap at all.
After all the configurations, the final view of VGs and LVs looks like this.
Begin Installation.
After select begin installation you need to create root and user password.
Select “make this user administrator” for admin rights.
Then reboot.
We’re in :)
We are just a few steps away from moving on to the Oracle software installation. The Oracle software installation will continue in another article, but for now, there should be a few more basic settings to be done on the server. I will proceed by reviewing and implementing them step by step.
I use an application that makes Linux usage easier. You can also download it from the link below.
After you download MobaXterm, open the program and right click to “User sessions” then select “New session”.
Select SSH and enter your server IP to Remote host. If you wanted you can add specific username but I’m skipping now. Then OK.
Let’s check our disks status. I am checking the disk status using the command “df -kh”
df -kh
It’s possible to examine the disk structure, VG, and LV structure better from here. Yes, performance is crucial for a databases, isn’t it?
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 8.9M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mapper/vg_root-lv_root 19G 1.3G 18G 7% /
/dev/mapper/vg_u01-lv_u01 47G 33M 47G 1% /u01
/dev/mapper/vg_backup-lv_backup 19G 33M 19G 1% /backup
/dev/mapper/vg_root-lv_var 9.4G 100M 9.3G 2% /var
/dev/mapper/vg_root-lv_home 19G 33M 19G 1% /home
/dev/mapper/vg_temp-lv_temp 9.4G 33M 9.3G 1% /temp
/dev/mapper/vg_fra-lv_fra 19G 33M 19G 1% /fra
/dev/sda1 1.9G 169M 1.7G 9% /boot
tmpfs 393M 0 393M 0% /run/user/1000
Hosts and Hostname
I am switching to root user using the “sudo su -” command. As you can see below, there is no information about the server in the hosts file. We will add this information. The hostname will be “TESTSRV1” as requested.
[ezgioracle@TESTSRV1 ~]$ sudo su -
[sudo] password for ezgioracle:
Last login: Sun Aug 27 00:07:21 +03 2023 on pts/0
[root@TESTSRV1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@TESTSRV1 ~]# hostname
TESTSRV1
Below, I am entering the file path using the vi
editor. Once inside the file:
- Press the down arrow to go to the end of the text.
- Press “o”.
- Enter the server’s IP and server’s name.
- Press “esc” to exit insert mode.
- Type “:wq” followed by Enter to save and exit.
[root@TESTSRV1 ~]# vi /etc/hosts
[root@TESTSRV1 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.186.180 TESTSRV1
You can find the all “vi” shortcuts right below the link. Introduction Vi editor.
Firewall and Selinux
To avoid temporary connectivity issues, I am permanently disabling firewall settings on the test server. I am using the following commands for this purpose:
[root@TESTSRV1 ~]# systemctl stop firewalld
[root@TESTSRV1 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@TESTSRV1 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
Aug 26 21:50:34 TESTSRV1 systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 26 21:50:35 TESTSRV1 systemd[1]: Started firewalld - dynamic firewall daemon.
Aug 26 21:50:35 TESTSRV1 firewalld[1027]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configura...t now.
Aug 27 00:27:03 TESTSRV1 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Aug 27 00:27:03 TESTSRV1 systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
I am also disabling SELinux for similar reasons. To do this, edit the “/etc/selinux/config” file and make sure the SELINUX is set as follows;
[root@TESTSRV1 selinux]# cd /etc/selinux
[root@TESTSRV1 selinux]# vi config
[root@TESTSRV1 selinux]# cat 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=disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Once inside the file:
1- Press the down arrow to go to the “SELINUX=” text.
2- Press “i” to insert mode.
3- Edit “SELINUX=” to “SELINUX=disabled”
4- Press “esc” to exit insert mode.
5- Type “:wq” followed by Enter to save and exit.
If SELinux is configured after installation, the server will need a reboot for the change to take effect.
As can see that SELinux is enabled before reboot;
[root@TESTSRV1 selinux]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: disabled
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
After reboot;
[root@TESTSRV1 selinux]# reboot
[root@TESTSRV1 ~]# sestatus
SELinux status: disabled
Updated and Pre-Installation
I am using the root user for this process. To fetch the Oracle 19c pre-install repository, you can use the command “yum install -y oracle-database-preinstall-19c”. If you encounter the error below, follow the steps I’ll provide.
Error down below;
failure: repodata/repomd.xml from ol7_UEKR6: [Errno 256] No more mirrors to try. https://yum.oracle.com/repo/OracleLinux/OL7/UEKR6/x86_64/repodata/repomd.xml:
[Errno 14] curl#6 — “Could not resolve host: yum.oracle.com; Unknown error”
I will edit the contents of the resolv.conf file using the command “vi /etc/resolv.conf”. You need to enter the nameserver and next to it, the server’s gateway here. This way, you can fetch the repositories.
[root@TESTSRV1 ~]# vi /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.186.2
~
Great, the repositories are being fetched successfully.
The downloaded dependencies are as follows:
Installed:
oracle-database-preinstall-19c.x86_64 0:1.0-3.el7
Dependency Installed:
GeoIP.x86_64 0:1.5.0-14.el7 bind-libs.x86_64 32:9.11.4-26.P2.el7_9.14 bind-libs-lite.x86_64 32:9.11.4-26.P2.el7_9.14
bind-license.noarch 32:9.11.4-26.P2.el7_9.14 bind-utils.x86_64 32:9.11.4-26.P2.el7_9.14 compat-libcap1.x86_64 0:1.10-7.el7
geoipupdate.x86_64 0:2.5.0-2.el7 glibc-devel.x86_64 0:2.17-326.0.9.el7_9 glibc-headers.x86_64 0:2.17-326.0.9.el7_9
gssproxy.x86_64 0:0.7.0-30.el7_9 kernel-headers.x86_64 0:3.10.0-1160.95.1.0.1.el7 keyutils.x86_64 0:1.5.8-3.el7
ksh.x86_64 0:20120801-144.0.1.el7_9 libICE.x86_64 0:1.0.9-9.el7 libSM.x86_64 0:1.2.2-2.el7
libX11.x86_64 0:1.6.7-4.el7_9 libX11-common.noarch 0:1.6.7-4.el7_9 libXau.x86_64 0:1.0.8-2.1.el7
libXext.x86_64 0:1.3.3-3.el7 libXi.x86_64 0:1.7.9-1.el7 libXinerama.x86_64 0:1.1.3-2.1.el7
libXmu.x86_64 0:1.1.2-2.el7 libXrandr.x86_64 0:1.5.1-2.el7 libXrender.x86_64 0:0.9.10-1.el7
libXt.x86_64 0:1.1.5-3.el7 libXtst.x86_64 0:1.2.3-1.el7 libXv.x86_64 0:1.0.11-1.el7
libXxf86dga.x86_64 0:1.1.4-2.1.el7 libXxf86misc.x86_64 0:1.0.3-7.1.el7 libXxf86vm.x86_64 0:1.1.4-1.el7
libaio-devel.x86_64 0:0.3.109-13.el7 libbasicobjects.x86_64 0:0.1.1-32.el7 libcollection.x86_64 0:0.7.0-32.el7
libdmx.x86_64 0:1.1.3-3.el7 libevent.x86_64 0:2.0.21-4.el7 libini_config.x86_64 0:1.3.1-32.el7
libnfsidmap.x86_64 0:0.25-19.el7 libpath_utils.x86_64 0:0.2.1-32.el7 libref_array.x86_64 0:0.1.5-32.el7
libstdc++-devel.x86_64 0:4.8.5-44.0.3.el7 libtirpc.x86_64 0:0.2.4-0.16.el7 libverto-libevent.x86_64 0:0.2.5-4.el7
libxcb.x86_64 0:1.13-1.el7 lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.0.1.el7 mailx.x86_64 0:12.5-19.el7
net-tools.x86_64 0:2.0-0.25.20131004git.el7 nfs-utils.x86_64 1:1.3.0-0.68.0.1.el7.2 psmisc.x86_64 0:22.20-17.el7
quota.x86_64 1:4.01-19.el7 quota-nls.noarch 1:4.01-19.el7 rpcbind.x86_64 0:0.2.0-49.el7
smartmontools.x86_64 1:7.0-2.el7 sysstat.x86_64 0:10.1.5-20.0.3.el7_9 tcp_wrappers.x86_64 0:7.6-77.el7
unzip.x86_64 0:6.0-24.0.1.el7_9 xorg-x11-utils.x86_64 0:7.5-23.el7 xorg-x11-xauth.x86_64 1:1.0.9-1.el7
Dependency Updated:
glibc.x86_64 0:2.17-326.0.9.el7_9 glibc-common.x86_64 0:2.17-326.0.9.el7_9
Complete!
Then, I proceed with the update and upgrade.
[root@TESTSRV1 ~]# yum update -y
[root@TESTSRV1 ~]# yum upgrade -y
User Privileges for oracle
When we installed the Oracle 19c pre-install, the oracle user and necessary groups were also included. You can verify this as shown below.
[root@TESTSRV1 ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
However, now we need to set a password for the oracle user in order to use it. “passwd oracle” command is used for this purpose.
[root@TESTSRV1 ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
The /u01 disk we created will contain all the installation files for Oracle. After the software is installed, important files for the database will also be located under /u01. Now, following best practices, I am creating the directory path and granting permissions to the oracle user in this location.
[root@TESTSRV1 ~]# mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
[root@TESTSRV1 ~]# chown -R oracle:oinstall /u01 /fra /backup /temp
[root@TESTSRV1 ~]# chmod -R 775 /u01 /fra /backup /temp
I have created the directory “/u01/app/oracle/product/19.3.0/dbhome_1". Then, I granted the necessary permissions to the oinstall group, which Oracle uses during installation processes.
I have assigned read, write and execute permissions (775) for the disks and directory paths that Oracle Database will use to a specific user, group or others.
Environment for oracle user
I am switching to the oracle user because the next steps involve setting up various environments in the oracle user bash_profile. I am creating a directory in the oracle user home to place the scripts.
[root@TESTSRV1 product]# sudo su oracle
[oracle@TESTSRV1 product]$ mkdir -p /home/oracle/scripts
I am navigating to the /home/oracle/scripts directory and using the vi editor to create the setenv.sh file inside it.
[oracle@TESTSRV1 product]$ cd /home/oracle/scripts
[oracle@TESTSRV1 scripts]$ vi setenv.sh
I’m inputting the required environments into the setenv.sh file. The modifications I’ve made are as follows:
#oracle
export TMP=/temp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=TESTSRV1
export ORACLE_UNQNAME=TESTDB1
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=TESTDB
export DATA_DIR=/u01/app/oracle/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
ORACLE_HOSTNAME= Our server hostname
ORACLE_UNQNAME= This will be our database unique name.
ORACLE_SID= This will be our instance name for our databases.
I am navigating to the /home/oracle directory to editing .bash_profile.
[oracle@TESTSRV1 scripts]$ cd /home/oracle
[oracle@TESTSRV1 ~]$ ls -a
. .. .bash_history .bash_logout .bash_profile .bashrc .kshrc scripts
I navigate to the end of the .bash_profile file and write ". /home/oracle/scripts/setenv.sh" before saving.
The leading “.” means that every time an Oracle user logs in, it executes these environments. Dot is important there. Otherwise, you would need to re-run the environments every time you login oracle user.
[oracle@TESTSRV1 ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
. /home/oracle/scripts/setenv.sh
I switch to the root user and navigate to the /etc directory. There, I create the oratab file using the “vi” command and input the following lines. The crucial part here is ensuring that the “TESTDB:/u01/app/oracle/product/19.3.0/dbhome_1:N” at the bottom is correctly entered.
[root@TESTSRV1 /]# cd /etc
[root@TESTSRV1 etc]# vi oratab
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
TESTDB:/u01/app/oracle/product/19.3.0/dbhome_1:Y
The “Y” expression indicates that the database needs to be automatically started during system boot. This means that the database will be automatically started every time the system boots up.
Switch to the root or local admin user and reboot the server. You cannot reboot it with the oracle user. After the reboot, when you run the command “cd $ORACLE_HOME” it should take you to the required directory.
[oracle@TESTSRV1 ezgioracle]$ cd $ORACLE_HOME
[oracle@TESTSRV1 dbhome_1]$ pwd
/u01/app/oracle/product/19.3.0/dbhome_1
Unzip Oracle 19c file
I’m clicking on the “+” in Mobaxterm to open a new tab. In this tab, I will use the scp command to transfer the Oracle 19c zip file from my local computer to the virtual server in the required directory.
scp [zip file name] oracle@[server ip address]:[directory path to send the zip file]
For example;
scp LINUX.X64_193000_db_home.zip oracle@192.168.186.180:/u01/app/oracle/product/19.3.0/dbhome_1
And my zip file is here;
[oracle@TESTSRV1 dbhome_1]$ pwd
/u01/app/oracle/product/19.3.0/dbhome_1
[oracle@TESTSRV1 dbhome_1]$ ll
total 2987996
-rwx------ 1 oracle oinstall 3059705302 Aug 27 02:39 LINUX.X64_193000_db_home.zip
The final step is to unzip the zip file. After unzipping, the necessary files will be created underneath. Do not interrupt the unzip process before it completes entirely. To do this, I’m using the following command:
[oracle@TESTSRV1 dbhome_1]$ unzip -oq LINUX.X64_193000_db_home.zip
[oracle@TESTSRV1 dbhome_1]$ ll
total 2988088
drwxr-xr-x 2 oracle oinstall 102 Apr 18 2019 addnode
drwxr-xr-x 6 oracle oinstall 4096 Apr 17 2019 apex
drwxr-xr-x 9 oracle oinstall 93 Apr 17 2019 assistants
drwxr-xr-x 2 oracle oinstall 8192 Apr 18 2019 bin
drwxr-xr-x 4 oracle oinstall 87 Apr 18 2019 clone
drwxr-xr-x 6 oracle oinstall 55 Apr 17 2019 crs
drwxr-xr-x 3 oracle oinstall 18 Apr 17 2019 css
drwxr-xr-x 11 oracle oinstall 119 Apr 17 2019 ctx
drwxr-xr-x 7 oracle oinstall 71 Apr 17 2019 cv
drwxr-xr-x 3 oracle oinstall 20 Apr 17 2019 data
drwxr-xr-x 3 oracle oinstall 19 Apr 17 2019 dbjava
drwxr-xr-x 2 oracle oinstall 22 Apr 17 2019 dbs
drwxr-xr-x 5 oracle oinstall 4096 Apr 18 2019 deinstall
.
.
.
.
-rwxr-x--- 1 oracle oinstall 1783 Mar 8 2017 runInstaller
If you’ve seen the “runInstaller” that’s buddy is who will help us install the software🙂
Overall, the processes on the server for installing Oracle Database are similar to these steps.
Thank you for reading!