Install Oracle Database 12c on Centos 7

Oracle Database is a relational database management system (RDBMS) from the Oracle Corporation. I will guide Install Oracle Database 12c on centos 7 for Dev Environment step by step.

Step 1: Intro

My system is as below:

[root@DBOracle ~]# hostnamectl
Static hostname: DBOracle.DevopsRoles.local
Icon name: computer-vm
Chassis: vm
Machine ID: 248dbd1f6d5b4bbb85e743d11d4e994e
Boot ID: 7eded015f6a242e9a9e8c982d754cc26
Virtualization: kvm
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-862.6.3.el7.x86_64
Architecture: x86-64

Prerequisites

  • The firewall allows port Oracle Database
  • SELinux allows Oracle Database

In this guide, I will stop the firewall and SELinux disable mode 🙂 for a test install Oracle Database.

Step 2: Prepare to install Oracle database 12c step-by-step

Install required packages

[root@DBOracle ~]# yum install -y binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 \
glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 \
libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64 \
libXtst.x86_64 make.x86_64 sysstat.x86_64 zip unzip smartmontools net-tools

Create user and group for Oracle Database

[root@DBOracle ~]# groupadd oinstall
[root@DBOracle ~]# groupadd dba
[root@DBOracle ~]# useradd -g oinstall -G dba oracle
[root@DBOracle ~]# passwd oracle

Add the parameters to the /etc/sysctl.conf as below

fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 1987162112
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

Check and apply the new value-add parameters atop

sysctl -p
sysctl -a

the limit for Oracle users in /etc/security/limits.conf file

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
#Oracle recommended value for stack is set to 10240 for user oracle
oracle soft stack 10240

Oracle installation requires GUI access. I will install an X Window System on the Server Oracle Database

[root@DBOracle ~]# yum groupinstall -y "X Window System"

The use command below, to access to install Oracle databases in Step 3

ssh -X oracle@192.168.1.114

Download Oracle Databases

If you do not have an Oracle account yet, then register one to download it!

[root@DBOracle ~]# cd ~oracle/
[root@DBOracle ~]# unzip linuxx64_12201_database.zip -d /stage
[root@DBOracle ~]# chown -R oracle:oinstall /stage/database

Create folder U01 for Oracle installation files and folder U02 for the Oracle database files.

[root@DBOracle ~]# mkdir -p /U01 /U02

Change the owner and group of the new folder and set permissions to ‘755’

[root@DBOracle ~]# chown -R oracle:oinstall /U01 /U02
[root@DBOracle ~]# chmod -R 775 /U01 /U02
[root@DBOracle ~]# chmod g+s /U01 /U02

Yeah! let’s go install Oracle Database 12c. Are you ready

Step 3: Install Oracle Database 12c

From the client open a new terminal and connect to the server Oracle database.

ssh -X oracle@192.168.1.114

Install Oracle Database 12c as below:

[root@DBOracle ~]# cd /stage/database
[root@DBOracle ~]# ./runInstaller

The display terminal is as below:

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB. Actual 26587 MB Passed
Checking swap space: must be greater than 150 MB. Actual 9535 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-07-05_10-20-03PM. Please wait ...

The installation GUI Oracle Database 12c as the picture below:

Select Installation Option

The choice “Create and configure a database” –> Next

Install Oracle Database 12c on Centos 7

Configure Security Updates

For Dev Environment

  • Email: None
  • Uncheck: I wish to receive security updates via My Oracle Support

For Production Environment

  • Email: Input your email
  • Check: I wish to receive security updates via My Oracle Support
  • My Oracle Support Password: Input your password
Install Oracle Database 12c on Centos 7_2

Select System Class

For Dev Environment

  • The choice ” Desktop class” –> Next

For production Environment

  • The choice “Server class” –> Next
Install Oracle Database 12c on Centos 7 3

Typical Install Configuration

  • Oracle base: /U01/home/oracle/app/oracle
  • Software location: /U01/home/oracle/app/oracle/product/12.2.0/dbhome_1
  • Database file location: /U02
  • Global database name: DevopsRoles
  • Password: DevopsRoles123
  • Uncheck: Create a Container database
Install Oracle Database 12c on Centos 7 4

Create Inventory

Install Oracle Database 12c on Centos 7 5

Summary

Install Oracle Database 12c on Centos 7 6

Install Product

Install Oracle Database 12c on Centos 7 7

During installation display pop-up as below

Install Oracle Database 12c on Centos 7 8

Open a new terminal and Login the root account into the server Oracle Database run two commands in the pop-up as below:

# bash /U01/home/oracle/app/oraInventory/orainstRoot.sh
# bash /U01/home/oracle/app/oracle/product/12.2.0/dbhome_1/root.sh

The picture runs commands as below:

Install Oracle Database 12c on Centos 7 9

Finish

Install Oracle Database 12c on Centos 7

Install Oracle Database 12c on Centos 7 10

Step 4: Testing login Oracle databases 12c

The Oracle installation is finished.

ssh root@192.168.1.114
su - oracle

To execute the command below to set the Oracle environment

export ORACLE_SID=DevopsRoles
export ORACLE_HOME=/U01/home/oracle/app/oracle/product/12.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin

Another method set the Oracle environment without losing it after the server Oracle reboot

[root@DBOracle ~]# su - oracle
[oracle@DBOracle ~]$ vi ~/.bash_profile

Add lines set Oracle end of the line in the bash_profile file

#Oracle environment
export ORACLE_SID=DevopsRoles
export ORACLE_HOME=/U01/home/oracle/app/oracle/product/12.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin

To apply the changeset Oracle environment

[oracle@DBOracle ~]$ source ~/.bash_profile

Access the Oracles database with permission privileges

sqlplus / as sysdba

Oracle uses default users. To change the default username ‘sys’

alter user sys identified by yourpassword;

Now, access the Oracle database web-based. Open your web browser https://192.168.1.114:5500/em/

Login Oracle database

User: system
Password: you have set up in step 3

Install Oracle Database 12c on Centos 7 11

Conclusion

Through the article, you have Install Oracle Database 12c on Centos 7. I hope will this your helpful. Thank you for reading the DevopsRoles page!

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

11 thoughts on “Install Oracle Database 12c on Centos 7

  1. Hello Huu,

    I have installed an Oracle 12c database on a VPS Centos 7 server. Connecting to the server as the Oracle user i can connect to the database as sysdba or system.
    But now i want to connect to database with the SQL Developer tool, or open the website xxx:5500/em, but either way the network connection could not be established.
    Can you please tell what i am missing? Or doing wrong?

    Thank you for your help.
    Carlos Wiesemann

      1. Hello Huu,

        The Oracle environment is set.
        Only…
        The Oracle_base (/u01/app/oracle) looks like:
        drwxr-x— 3 Oracle dba 4096 Oct 12 21:47 admin
        drwxr-x— 3 Oracle dba 4096 Oct 12 21:49 audit
        drwxr-xr-x 5 Oracle dba 4096 Oct 12 21:50 cfgtoollogs
        drwxr-xr-x 2 Oracle dba 4096 Oct 12 21:54 checkpoints
        drwxrwxr-x 21 Oracle dba 4096 Oct 12 21:37 diag
        drwxr-x— 3 Oracle dba 4096 Oct 12 21:47 oradata
        drwxrwxr-x 3 Oracle oinstall 4096 Oct 12 21:17 product

        Must the folder ‘product’ be: Oracle dba, instead of Oracle oinstall?

        1. Hi Carlos,

          The Oracle_base (/u01/app/oracle) looks like:

          [oracle@DBOracle ~]$ ll /U01/home/oracle/app/oracle/
          total 24
          drwxr-s—. 3 oracle oinstall 4096 Jul 12 22:02 admin
          drwxr-s—. 3 oracle oinstall 4096 Jul 12 22:05 audit
          drwxr-sr-x. 5 oracle oinstall 4096 Jul 12 22:08 cfgtoollogs
          drwxr-sr-x. 2 oracle oinstall 4096 Jul 12 22:17 checkpoints
          drwxrwxr-x. 21 oracle oinstall 4096 Jul 12 21:35 diag
          drwxr-sr-x. 3 oracle oinstall 4096 Jul 12 21:22 product

          –> Port 5500 not listening solve as below:

          Step 1: You check port 5500 from sys oracle
          SQL> select dbms_xdb_config.gethttpsport from dual;

          GETHTTPSPORT
          ————
          5500

          SQL>

          Step 2: Execute command sql as below

          SQL> exec DBMS_XDB_CONFIG.SETHTTPSPORT(5500);

          Step 3: Try to start the listener service using lsnrctl from command line

          [oracle@DBOracle ~]$ lsnrctl start LISTENER

          Thanks
          Huu

      1. Hi,

        Yes port 5500 is enabled; like other ports.
        Warning: ALREADY_ENABLED: 1521:tcp
        Warning: ALREADY_ENABLED: 5500:tcp
        Warning: ALREADY_ENABLED: 5520:tcp
        Warning: ALREADY_ENABLED: 3938:tcp

        Thank you.
        Carlos

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.