-0.8 C

How to Install Oracle 18 c on Centos 7

Mel Khamlichi
Mel Khamlichihttp://www.osradar.com
Founder of Osradar, from Amsterdam Netherlands

Oracle Database is a multi-model database management system produced and marketed by Oracle. It is a database mostly used for running OLTP (online transaction processing), data warehousing and mixed database workloads. Oracle Database 18c, is the latest generation Oracle database and can be deployed on-premises and/or in Oracle Cloud running on general purpose hardware or planned systems specifically planned for database workloads such as Oracle Exadata and Oracle Database Appliance. It facilitates all kind of businesses with the fastest access, most scalable and reliable database technology for secure and cost-effective deployment of transnational and analytical workloads in the Cloud, on-premises and Hybrid Cloud configurations. Please keep in mind that Oracle Database 18c is just a “minor” release and Oracle Database 18c adds new functionality and enhancements to features of Oracle Database 12c.

2. Installation:

Today we are going to install oracle 18c on Centos 7. Oracle database utilize minimum resources of machine. Each Linux distribution has its own preferred package format. CentOS/RHEL are derived from Fedora, anduse “rpm” packages, whereas Debian derived distros like Ubuntu use “deb” files. So Centos needs .rpm package to install. So first we have to download rpm package of oracle 18c. I have downloaded.

For installation first we have to login to the CentOS as root user as root privileges are required to install packages by issuing command

 #sudo -s

 Then we need to update CentOS for latest update by issuing the command.

#yum –y update

 It will take some time according to the updates. Now go to the directory where .rmp files    are located. In my case files are located in /opt. For oracle it is prerequisite that we have to install first “oracle-database-preinstall-18c”. to install any rpm package we have to use the command “rpm –ivh (package name)”.

#rpm –ivh oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

As you can see in the above picture there is dependencies error so we have to fix the issue first. So we install all required libraries. First error was “compat-libstdc++-33” so we will install it first by this command.

# yum –y install compat-lisbstdc++-3

Once it complete, it will look like above image. Second error was “ksh”, so we will install it by this command

# yum –y install ksh

3rd error was “libaio-devel”, we will install it by this command

# yum –y install libaio-devel

Now we will install Oracle 18c Preinstall

#rpm –ivh oracle-database-preinstall-18c-1.0-1.el7.x86_64.rpm

It will take some time. Once it complete, It will show like this

Now we can check which files are created by “ oracle-preinstall package” by using this command

 # rpm –ql oracle-database-preinstall-18c-1.0-1.el7.x86_64

As shown in the picture:


It will show the Config files that are created by Oracle preinstall18c as above in the picture.Now we will install actual rpm of “oracale-database-18c” by this command as shown in the picture below

# cd /opt

#rpm –ivh oracle-database-ee-18c-1.0-1.x86_64.rpm

It will take some time to complete. Once it completed it will look like

Now we will open Config file.  Including listener port All parameter are in this file are mentioned. No need to change anything here. We can open this file by using this command

# vim /etc/sysconfig/oracledb_ORCLCDB-18c.conf

Now will set database credentials and parameters by issuing the command

#  /etc/init.d/oracledb_ORCLCDB-18c configure

It will take some time to complete and will provide database information and settings as shown below.

Now we will go to database path and configure the database parameters.

# cd oracle/
#cd product/18c/dbhome_1


Now we will change the default password of oracle by this command as shown below.

Now log off the current user and log in as “oracle” user with above password that is reset. Oracle user is created by database. Now we will create environment variables for the user oracle. Open the file .bash_profile by this command

# vim /home/oracle/.bash_profile

And add two lines without quotations under #user specific environment.

“export ORACLE_HOME=/opt/oracle/product/18c/dbhome_1”

Then append “:$ORACLE_HOME/bin“ at end of the line “ PATH=$PATH………”

It will look like


Then open terminal and login as root #su. Now we have to edit host files.

#vim /etc/hostname

Delete that whole line in the file and give any name that is easy to remember.

Then go the file name hosts

#vim /etc/hosts

Mention here machine’s IP address and hostname that was written in above file. In the next step we have to mention host name in listener.ora file.

#vim /opt/oracle/product/18c/dbhome_1/network/admin/listener.ora

Here replace “hostname” with original host name is mentioned above file. It will look like as shown below.

Now open the file tnsnames.ora file and replace “hostname” with original host name.

#vim  /opt/oracle/product/18c/dbhome_1/network/admin/tnsnames.ora

It will look like

Now we will start oracle listener “lsnrctl” by using this command

#cd /opt/oracle/product/18c/dbhome_1/network/admin

#lsnrctl start

it will look like

Now we will start SQL plus tool, it works to run SQL queries

# sqlplus '/ as sysdba'

Now we will issue command to start oracle database.

SQL> startup;

SQL> select * from tab:

It shows our DB is working fine

Now execute procedure in order to enable remote procedure.

SQL> exit

As oracle database is working at port so we will allow port 5500 in firewall

#firewall-cmd –add-port=5500/tcp

Almost installation is done. Now will open oracle database web page in the browser by this link


in my case this is

We log in as user “sys” and enter password that we set earlier.  We logged in successfully.

Oracle data base 18c is installed, configured, created and logged in successfully.





- Advertisement -


Please enter your comment!
Please enter your name here

Donate to Osradar

Latest article