How to Install Oracle Database 18c XE on CentOS 7.6

I am currently building a home server using CentOS 7.6. I install this OS on my AMD Phenom desktop. I am planning to use this server for my Oracle Database as well as Virtualization host. So in this port, I am going to share how to install Oracle Database 18c XE on CentOS 7.6.

I was thinking that installing Oracle in Linux is super hard. But in fact, even I cannot say that it is super easy, I still can do this. With some efforts and patience, I was able to run Oracle Database 18c on my CentOS Linux. If you are interested, here are the steps.


Before I install the Oracle Database, I do the following tasks:

  1. Update CentOS >> yum update command
  2. Create new “oracle” user >> useradd oracle command. I also create new password for my oracle user.
  3. Change or set the hostname. Edit the /etc/hosts file. I change my hostname to: server.griyaku.lan

Here is my /etc/hosts file looks like. Make sure you enter the hostname in a correct format.

Steps to Install Oracle Database 18c XE on CentOS 7.6

Here are the general steps of Installing Oracle Database 18c XE on CentOS 7.6.

  1. Download the installation files
  2. Install Oracle pre-install file
  3. Install and Configure Oracle Database
  4. Edit PATH
  5. Test the Connection
  6. Configure Database
  7. Configure Oracle Enterprise manager

Step 1. Download the Oracle Database 18c XE installation files

Use the link below to download the oracle pre-install file and also the Oracle database 18c XE installation file. Save the file to your download directory.

There are two files you will need to download.

You should now have the following files:

  • oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm
  • oracle-database-xe-18c-1.0-1.x86_64.rpm

Step 2. Install Oracle Pre-Install file

Step 3. Install and Configure Oracle Database

Now, install the Oracle Database package with this command as root

This install process will take some times. In my case, it takes up to 15 minutes. Once installed, you will see the following

Configure Oracle Database Installation

This is an important step. Make sure it completes successfully and no error. Run this command as root user. During this process, you will need to create a password that will be used for SYS, SYSTEM and PDBADMIN accounts.

The configuration process will take up to 30 minutes in my case. So, be patient.

Edit tnsnames.ora

We are going to edit the tnsnames.ora file. We need to add our pluggable database information to this file.

Add these lines to the end of the file

Change the value server.griyaku.lan with your hostname/domain name. Or, you can also put the IP address of your server running Oracle.

Step 4. Modify PATH

Now, let’s modify the PATH. We need to edit the file ~/.bash_profile.

Add the following line

Next, execute this command using oracle account

Step 5. Test the Connection using SQLPlus

You can try to connect to the new Oracle database using sqlplus

Step 6. Configure Database

Now we need to configure the database so it starts automatically during the system boot. To do this, login as root and execute this command

OK, so now Oracle database will be started on system boot. We can also start and stop the database manually using Oracle command

Step 7. Configure Oracle Enterprise Manager

We can access the Oracle Enterprise Manager using address:

But, by default, Oracle EM only accessible from the localhost. We need to configure the Oracle EM so it accessible from remote client. Login to Oracle using sqlplus

At first, I can open the EM from the CentOS machine. But, I cannot open it from other computer. So, I need to configure the firewalld to allow https and port 5500 used by Oracle EM. Here is the commands

Final Words

It’s a great feeling that I have successfully installed the Oracle Database 18c XE on my CentOS 7. It took about 2 hours to get everything run smoothly. The database configure process take a long time. So, that’s it. I hope you enjoy this article.



Leave a Reply

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