How to install Oracle 18c on CentOS 7

Share on Social Media

Learn step-by-step how to install Oracle 18c on CentOS 7, including prerequisites, configuration, and troubleshooting tips for a smooth setup. #centlinux #linux #oracle

What is Oracle 18c?

Oracle 18c is a version of Oracle’s database management system, part of the Oracle Database family. Introduced as a cloud-first release, Oracle 18c offers several enhancements and new features designed to improve performance, scalability, and manageability. Key features of Oracle 18c include:

  1. Autonomous Database: Incorporates machine learning to automate database management tasks such as tuning, backups, and updates, reducing the need for manual intervention.
  2. Improved Performance: Enhancements like in-memory optimizations, faster query execution, and better handling of large data sets.
  3. Scalability and High Availability: Features like Oracle Real Application Clusters (RAC) and Active Data Guard ensure high availability and scalability.
  4. Security Enhancements: Includes advanced data encryption, user access controls, and improved auditing capabilities to safeguard data.
  5. Multitenancy: Support for container databases (CDB) and pluggable databases (PDB) to simplify database consolidation and management.
  6. Cloud Integration: Designed to work seamlessly with Oracle Cloud Infrastructure, providing easy migration and deployment options.

Oracle 18c is designed to provide a robust, high-performance database solution suitable for a wide range of applications, from small-scale implementations to large enterprise environments.

How to install Oracle 18c on CentOS 7
How to install Oracle 18c on CentOS 7

Linux Server Specification

In this article, we will install Oracle 18c on CentOS 7 on-premises database server in Silent mode.

We have provisioned a CentOS 7 minimal installed virtual machine with following specifications:

  • CPU – 3.4 Ghz (2 Cores)
  • Memory – 2 GB
  • Storage – 60 GB
  • Hostname – oracle-01.centlinux.com
  • IP Address – 192.168.116.148 /24
  • Operating System – CentOS 7.6

Recommended Training: Oracle SQL Performance Tuning Masterclass (2025) from Code Star Academy

1637872 886a 26
show?id=oLRJ54lcVEg&bids=1597309

Configure Local DNS Resolver

To configure name resolution, we can either use a central DNS server or we can use local DNS resolver. To keep it simple, we are using local DNS resolver for our server.

Connect to oracle-01.centlinux.com using ssh as root user and execute following command.

cat >> /etc/hosts << EOF
192.168.116.148 oracle-01.centlinux.com oracle-01
EOF

Verify name resolution by using ping command.

ping oracle-01.centlinux.com

Output:

PING oracle-01.centlinux.com (192.168.116.148) 56(84) bytes of data.
64 bytes from oracle-01.centlinux.com (192.168.116.148): icmp_seq=1 ttl=64 time=0.053 ms
64 bytes from oracle-01.centlinux.com (192.168.116.148): icmp_seq=2 ttl=64 time=0.068 ms

Disable Transparent Hugepages

Transparent Hugepages can cause memory allocation delays during runtime. Therefore, to avoid performance issues, Oracle recommends to disable Transparent Hugepages before starting installation. Oracle recommends that we instead use Standard Hugepages for enhanced performance.

Verify that Transparent Hugepages are enabled on our CentOS 7 server.

cat /sys/kernel/mm/transparent_hugepage/enabled

Output:

[always] madvise never

The [always] flag shows that the Transparent Hugepages are in used by our CentOS 7 server.

To disable Transparent Hugepages we have to edit GRUB configuration.

vi /etc/default/grub

Look for GRUB_CMDLINE_LINUX and add transparent_hugepage=never at the end. After editing this directive should be looks like as follows.

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never"

Generate /etc/grub.cfg file using modified configurations.

grub2-mkconfig -o /boot/grub2/grub.cfg

Output:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-957.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-957.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-07fcd178406f4b3ca09084082364afba
Found initrd image: /boot/initramfs-0-rescue-07fcd178406f4b3ca09084082364afba.img
done

Reboot the machine to verify configurations.

systemctl reboot

After reboot, check status of Transparent HugePages again.

cat /sys/kernel/mm/transparent_hugepage/enabled

Output:

always madvise [never]

Transparent Hugepages has been disabled.

Install Oracle 18c Prerequisites

Install prerequisite software packages using yum command.

yum install -y bc binutils compat-libcap1 compat-libstdc++-33 glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender-devel libXrender libgcc libstdc++ libstdc++-devel libxcb make smartmontools sysstat net-tools nfs-utils gcc-c++

Create User and Groups for Oracle 18c

Create OS users and groups as required by Oracle Database 18c.

groupadd -g 1501 oinstall
groupadd -g 1502 dba
groupadd -g 1503 oper
groupadd -g 1504 backupdba
groupadd -g 1505 dgdba
groupadd -g 1506 kmdba
groupadd -g 1507 racdba
useradd -u 1501 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba oracle
echo "oracle" | passwd oracle --stdin

Output:

Changing password for user oracle.
passwd: all authentication tokens updated successfully.

Set Security Limits for Oracle User

Execute following command to set security limits for oracle user.

cat >> /etc/security/limits.d/30-oracle.conf << EOF
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728
EOF

Adjust Kernel Parameters

Set following Kernel parameters as required by Oracle Database 18c.

cat >> /etc/sysctl.d/98-oracle.conf << EOF
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
EOF

Reload Kernel parameter file.

sysctl -p

Adjust SELinux Mode

Set SELinux to Permissive mode.

sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/sysconfig/selinux
setenforce permissive

Configure Linux Firewall

Allow Oracle SQL* Net Listener port 1521/tcp in Linux Firewall.

firewall-cmd --permanent --add-port=1521/tcp
firewall-cmd --reload

Create Directories for Oracle 18c Database

We are using following two directories, One for the RDBMS software and other for the Oracle Databases.

mkdir -p /u01/app/oracle/product/18.3.0/dbhome_1
mkdir -p /u02/oradata
chown -R oracle:oinstall /u01 /u02
chmod -R 775 /u01 /u02

Set Environment Variables in CentOS 7

Switch to oracle user.

su - oracle

Use following commands to set environment variables for oracle user.

cat >> ~/.bash_profile << EOF
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=oracle-01.centlinux.com
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/18.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata
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

Install Oracle 18c on CentOS 7 in Silent Mode

We have downloaded Oracle Database 18c (18.3) for Linux from Oracle website and transferred the zip file to our CentOS 7 virtual machine using WinSCP.

Switch to oracle user and unzip downloaded zip file.

su - oracle
unzip LINUX.X64_180000_db_home.zip -d $ORACLE_HOME

Start Oracle Database 18c installation in Silent mode.

cd $ORACLE_HOME
./runInstaller -ignorePrereq -waitforcompletion -silent \
oracle.install.option=INSTALL_DB_SWONLY \
ORACLE_HOSTNAME=${ORACLE_HOSTNAME} \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=${ORA_INVENTORY} \
ORACLE_HOME=${ORACLE_HOME} \
ORACLE_BASE=${ORACLE_BASE} \
oracle.install.db.InstallEdition=EE \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSBACKUPDBA_GROUP=backupdba \
oracle.install.db.OSDGDBA_GROUP=dgdba \
oracle.install.db.OSKMDBA_GROUP=kmdba \
oracle.install.db.OSRACDBA_GROUP=racdba \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true

Output:

Launching Oracle Database Setup Wizard...

[WARNING] [INS-13014] Target environment does not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2019-03-20_10-26-13PM.log
ACTION: Identify the list of failed prerequisite checks from the log: installActions2019-03-20_10-26-13PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
/u01/app/oracle/product/18.3.0/dbhome_1/install/response/db_2019-03-20_10-26-13PM.rsp

You can find the log of this install session at:
/tmp/InstallActions2019-03-20_10-26-13PM/installActions2019-03-20_10-26-13PM.log

As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/18.3.0/dbhome_1/root.sh

Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[oracle-01]

Execute /u01/app/oracle/product/18.3.0/dbhome_1/root.sh on the following nodes:
[oracle-01]

Successfully Setup Software with warning(s). Moved the install session logs to: /u01/app/oraInventory/logs/InstallActions2019-03-20_10-26-13PM

Oracle Universal Installer is giving warning because we are installing on a system with 2 GB RAM, whereas Oracle recommends at least 8 GB RAM for Oracle Database 18c installation. Therefore, you can safely ignore this warning.

Oracle Database 18c has been installed. Now connect as root user and execute the post-installation scripts.

/u01/app/oraInventory/orainstRoot.sh

Output:

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.

Now execute following script as root user.

/u01/app/oracle/product/18.3.0/dbhome_1/root.sh

Output:

Check /u01/app/oracle/product/18.3.0/dbhome_1/install/root_oracle-01.centlinux.com_2019-03-20_22-42-29-680074976.log for the output of root script

Create Oracle Multitenant Database in Silent Mode

Manually start default Oracle Listener.

lsnrctl start

Output:

LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 20-MAR-2019 22:47:53

Copyright (c) 1991, 2018, Oracle. All rights reserved.

Starting /u01/app/oracle/product/18.3.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/oracle-01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle-01.centlinux.com)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date 20-MAR-2019 22:47:53
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle-01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle-01.centlinux.com)(PORT=1521)))
The listener supports no services
The command completed successfully

Create an Oracle Multitenant Database in Silent mode as follows.

dbca -silent -createDatabase \
-templateName General_Purpose.dbc \
-gdbname ${ORACLE_SID} -sid  ${ORACLE_SID} \
-responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword 123 \
-systemPassword 123 \
-createAsContainerDatabase true \
-numberOfPDBs 1 \
-pdbName ${PDB_NAME} \
-pdbAdminPassword 123 \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-totalMemory 800 \
-storageType FS \
-datafileDestination "${DATA_DIR}" \
-redoLogFileSize 50 \
-emConfiguration NONE \
-ignorePreReqs

Output:

[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/cdb1.
Database Information:
Global Database Name:cdb1
System Identifier(SID):cdb1
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb1/cdb1.log" for further details.

We have set a simple password, therefore dbca is giving us warnings.

Connect as root and execute following command to enable auto restart of CDB1 database.

sed -i 's/:N$/:Y/g' /etc/oratab

Connect to CDB1 using sqlplus.

sqlplus / as sysdba

Enable Oracle Managed Files (OMF) by executing following command at sqlplus shell.

ALTER SYSTEM SET DB_CREATE_FILE_DEST='/u02/oradata' SCOPE=BOTH;

Alter PDB1 so it will be open automatically at the time of database startup of CDB1 Database.

ALTER PLUGGABLE DATABASE PDB1 SAVE STATE;

Setup AutoStart of Oracle 18c Database and Listener

To AutoStart Oracle 18c Database and Listener we must create a systemd service as follows:

vi /usr/lib/systemd/system/dbora.service

And add following directives therein.

[Unit]
Description=Oracle Database Service
After=network.target
 
[Service]
Type=forking
ExecStart=/u01/app/oracle/product/18.3.0/dbhome_1/bin/dbstart /u01/app/oracle/product/18.3.0/dbhome_1
ExecStop=/u01/app/oracle/product/18.3.0/dbhome_1/bin/dbshut /u01/app/oracle/product/18.3.0/dbhome_1
User=oracle
TimeoutSec=300s
 
[Install]
WantedBy=multi-user.target

Start and enable dbora.service.

systemctl daemon-reload
systemctl enable dbora.service
systemctl start dbora.service

Check status of dbora.service.

systemctl status dbora.service

Output:

â dbora.service - Oracle Database Service
Loaded: loaded (/usr/lib/systemd/system/dbora.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2019-03-21 09:13:28 PKT; 1min 31s ago
Process: 12004 ExecStart=/u01/app/oracle/product/18.3.0/dbhome_1/bin/dbstart /u01/app/oracle/product/18.3.0/dbhome_1 (code=exited, status=0/SUCCESS)
Main PID: 10315 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/dbora.service
ââ12017 /u01/app/oracle/product/18.3.0/dbhome_1/bin/tnslsnr LISTEN...
ââ12505 ora_mz04_cdb1
ââ12507 ora_q005_cdb1
ââ12513 ora_mz03_cdb1
ââ12553 ora_qm03_cdb1

Mar 21 09:12:55 oracle-01.centlinux.com systemd[1]: Starting Oracle Database Se...
Mar 21 09:12:55 oracle-01.centlinux.com dbstart[12004]: Processing Database ins...
Mar 21 09:13:28 oracle-01.centlinux.com systemd[1]: Started Oracle Database Ser...
Hint: Some lines were ellipsized, use -l to show in full.

We have successfully install Oracle 18c on CentOS 7 server.

Final Thoughts

Installing Oracle 18c on CentOS 7 involves several critical steps, including preparing the system environment, configuring required kernel parameters, and completing the Oracle installation through the Oracle Universal Installer (OUI). While the process can seem complex, following each step carefully ensures a successful and stable installation.

With Oracle 18c up and running, you’re now ready to start managing databases, optimizing performance, and exploring the advanced features Oracle provides. Always remember to apply the latest patches and follow best practices for security and performance tuning in a production environment.

Need expert AWS and Linux system administration? From cloud architecture to server optimization, I provide reliable and efficient solutions tailored to your needs. Hire me on Fiverr today!

Feel free to reach out for expert advice and ensure your Oracle 18c setup is done correctly and efficiently!

Looking for something?

21 responses to “How to install Oracle 18c on CentOS 7”

  1. SUDHIR Avatar

    IT IS VERY HELP FULL ARTICALS THANK YOU.

  2. Anonymous Avatar
    Anonymous

    work perfectly on my vmware vm ….ty man

  3. Anonymous Avatar
    Anonymous

    how do you connect to this new oracle db remotely?

  4. Ahmer M Avatar

    By using an Oracle Database client.

  5. Unknown Avatar

    Very helpful guide. Thank you! God bless you!

  6. Ziaul Avatar

    HI
    I am getting the below Error. Please help me.

    [oracle@oracledb ~]$ lsnrctl start
    -bash: lsnrctl: command not found
    [oracle@oracledb ~]$

  7. Ahmer M Avatar

    Looks the command path is not included in PATH environment variable. Try Following commands.

    export PATH=/u01/app/oracle/product/18.3.0/dbhome_1/bin/:$PATH
    echo "export PATH=/u01/app/oracle/product/18.3.0/dbhome_1/bin/:$PATH" >> ~/.bash_profile
    lsnrctl start

  8. Ziaul Avatar

    Thanks you very much. It is working fine.

    But i want to manage DB through remotely . Could you tell me which oracle database client is best and also open source

    Thanks
    Ziaul

  9. Ahmer M Avatar

    Please use Oracle Database Client.

  10. kulbhushan singh Avatar

    On Doing DBCA createDatabase I get following error :

    8% complete
    Copying database files
    9% complete
    [WARNING] ORA-00821: Specified value of sga_target 600M is too small, needs to be at least 3092M
    ORA-01078: failure in processing system parameters

    [FATAL] ORA-01034: ORACLE not available

    31% complete
    100% complete
    [FATAL] ORA-01034: ORACLE not available

    I followed each and every step of the document. Kindly guide.

  11. Ahmer M Avatar

    Please share the command that you have used for database creation.

  12. Rudolfo1967 Avatar

    Hello Ahmer Mansoor, when i come to the point to do the silent install via commandline i get a [Warning] [INS-08101] unexpected failure in status "supportedOSCheck" but the only additional information is – java.lang.NullPointerException and the silent install is halted.
    Do you have any idea what the problem could be? Thank you – Rudolf

  13. Ahmer M Avatar

    Hi, the error seems to be due to an unsupported operating system.

    Please check your Operating System certification for the Oracle database 18c at Oracle Support website.

  14. Rudolfo1967 Avatar

    Thank you for your reply – i tried with CentOS 8 – Best Regards – Rudolf

  15. Unknown Avatar

    Great tutorial. Thank you. Everything works on OL7

  16. Dan Howard Avatar

    The link to the oracle download is broken. Is the RPM good enough?

  17. Ahmer M Avatar

    Yes, the RPM is good enough but it is no longer available for free download.

    According to Oracle:

    "Oracle Database Enterprise Edition 10.2, 11.x, 12.x, and 18c are available as a media or FTP request for those customers who own a valid Oracle Database product license for any edition."

  18. Priapus Avatar

    Can these same steps be used to install Oracle 18c on RHEL 7.9?

Leave a Reply