In this blog, we will learn the installation of Oracle Database 19c in Oracle Linux 7. You may have seen different ways to install it. But I have described the installation as one of the easiest and simple ways.
To set up this, I have launched one AWS instance of Oracle Linux 7.

Requirement of swap space:-
We need swap space as per the total RAM size on the server. The required swap space size is as given below:-
RAM up to 1024MB then swap = 2 times the size of RAM
RAM between 2049MB and 8192MB then swap = equal to the size of RAM
RAM more than 8192MB then swap size = 0.75 times the size of RAM
I have one extra disk of 5 GB for swap space. We will configure swap space first.
Create a partition with fdisk DISK-NAME command for swap.
fdisk DISK-NAME

Type n and then press enter.

Type p and press enter.

For Partition number option keep it default and press enter.
For First sector option keep it default and press enter.
For Last sector option keep it default and enter.

Type t to set disk type as swap and then press enter. Type 82 to set this partition as swap and press enter.

Type w to save this change and exit.

Open /etc/fstab file with any text editor. Make an entry for the swap partition in that file.
PARTITION-NAME swap swap defaults 0 0

Now set the newly created partition as swap with mkswap command.
mkswap PARTITION-NAME

Activate swap space for use with swapon command. And then run free -h to check space.
swapon -a
free -h

Let’s start step-by-step configuration.
Set hostname:-
hostnamectl set-hostname <HOSTNAME>

Make an entry in /etc/hosts file for the local server:-
echo "<IP ADDRESS> <FULL MACHINE NAME> <MACHINE NAME> " >> /etc/hosts

Now reboot the server.
Install “oracle-database-preinstall-19c” package.
yum install -y oracle-database-preinstall-19c
Enable password authentication.
Open /etc/ssh/sshd_config file and search for “PasswordAuthentication no”. Change it to “PasswordAuthentication yes” and restart SSH service.


Set password for oracle user.
passwd oracle

Check if SELinux is permissive or disabled, if it is not then change it to permissive or disabled.

Create the directories in which the Oracle software will be installed.
mkdir -p /opt/app/oracle/db
mkdir -p /opt/data/oradata
Go to Oracle’s official site and download the Oracle Database 19c zip file.
Link to download the file:- https://www.oracle.com/in/database/technologies/oracle19c-linux-downloads.html
Note: To download this file you need to log in with Oracle account credentials.
Copy Oracle Database zip file to /opt/app/oracle/db directory and unzip it.
unzip LINUX.X64_193000_db_home.zip
Change ownership and permission of these files.
chown -R oracle:oinstall /opt/app /opt/data
chmod -R 775 /opt/app /opt/data
Login to the server with oracle user in X11 forwarding mode.
ssh -Y oracle@<IP Address

Go to /opt/oracle directory and run runInstaller script.
./runInstaller

Step 1: Now Oracle Database setup page will open. Select Create and configure a single instance database option and click Next.
Step 2: In the Select Class page select Server class and click Next.
Step 3: In the Database Edition page, select Enterprise Edition and click Next.
Step 4: In the Installation Location page verify /opt/oracle in Oracle base and click Next.
Step 5: In the Create Inventory page, verify /opt/oraInventory as Inventory Directory and click Next.
Step 6: In the Configuration Type page, select General Purpose / Transaction Processing and click Next.
Step 7: In the Database Identifiers page, change Global Database Name from orcl.localdomain to orcl and click Next.
Step 8: In the Configuration Options page, allocate memory as per your requirement. And click Next.
Step 9: Keep Database Storage page as default and click Next.
Step 10: Keep Management Options as default and click Next.
Step 11: In the Recovery Options page, Click on Enable Recovery and click Next.
Step 12: In the Schema Passwords page, click on Use the same password for all accounts, type your password and click Next.
Step 13: Keep Operating System Groups as default, and click on Next.
Step 14: Keep Root script execution page as default, and click Next.
Step 15: Now it will check the prerequisite.

Step 15: In the Summary page, verify setup and click on Install.
Step 16: After a few minutes Execute Configuration Scripts pop-up page will open. On this page, two scripts are written that need to run in the server as the root user.



Now again go back to the installation page and click on OK on Execute Configuration Scripts pop-up page. Now seat back and relax for a few minutes.
Make one scripts directory in /home/oracle.
mkdir /home/oracle/scripts
Create an environment file called “setEnv.sh”. The “$” characters are escaped using “\”. If you are not creating the file with the cat
command, you will
need to remove the escape characters.
cat > /home/oracle/scripts/setEnv.sh <<EOF
#oracle setting
export TMP=/tmp
export TMPDIR=\$TMP
export ORACLE_HOSTNAME=oracle-db.localdomain
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=\$ORACLE_BASE/db
export ORA_INVENTORY=/opt/data/oraInventory
export ORACLE_SID=orcl
export PDB_NAME=pdb1
export DATA_DIR=/opt/data/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
EOF
Add a reference to the “setEnv.sh” file at the end of the “/home/oracle/.bash_profile” file.
echo ". /home/oracle/scripts/setEnv.sh" >> /home/oracle/.bash_profile
Check listener status. You can see service status is showing ready.
lsnrctl status

Now time to login to Oracle Database.
sqlplus '/' as sysdba

We can check information about tables using the below command.
select * from tab;
To check the currently connected database.
show con_name;

To Login Oracle Database remotely first make sure that either iptables and firewall are disabled or allows Oracle Database port (1521) from it. We can download and use SQL Developer application to connect the database. I am using dbeaver for it.
Link to download SQL Developer https://www.oracle.com/database/sqldeveloper/technologies/download/
Put the server details and credentials. Then click on Test Connection.

Access Oracle Enterprise Manager Database Express
To access Oracle Enterprise Manager Database Express. Go to the browser and search https://IP-Address:5500/em. Login with user credentials.


So we have successfully installed Oracle Database 19c in Oracle Linux 7.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Your article helped me a lot, is there any more related content? Thanks!