Install Oracle 12c on CentOS 7 – Part II

Note: This tutorial is just for installing/testing Oracle for personal purposes. If you are installing for some production environments, consult expert advice. This is a second part of two part blog on how to install Oracle 12c on CentOS 7. First part can be found here Now create a user ‘oracle’ and groups ‘dba’ and ‘oracle’. Then login into GUI using user ‘oracle’.
[oracle@centos7 12c]$ ll
total 2.6G
-rw-r--r-- 1 vivek users 968M Aug  5 08:06
-rw-r--r-- 1 vivek users 1.6G Aug  5 08:16
Get the Oracle pre-requisites repo for their website. After setting up the repo, issue the command:
[oracle@centos7 12c]$ sudo yum install oracle-rdbms-server-11gR2-preinstall
  Open the ‘terminal’ and go to the path where you have downloaded the Oracle 12 downloads When you get the below GUI, un-tick the check box and proceed further. Follow the snapshots.
Figure 1
Figure 2
  Your choice for Desktop or Server class. My choice is server class as I wanted to understand the different options.
Figure 3
Figure 4
Figure 5
Figure 6
Figure 8
  As we are installing for development/testing purposes, ignoring few pre-requisites won’t matter.
Figure 9
Figure 10
Figure 11
  Database creation in progress.
Figure 13
  Your database details:
Figure 14
  On hitting the “Password Management” in the above screen you will get this screen. Change passwords of users you want to.
Figure 15
Figure 16
  We are done here installing Oracle! Now small tips. You can setup your centOS7 to start at run level 3. Refer THIS. Now with VirtualBox, you can use VBoxManage and VBoxHeadless to manage and run Virtual Machines from terminal and in background. And, install or enable SSH on your CentOS server. Refer THIS So if you have your own LAN set up. Go to network settings for this machine in VirtualBox and choose “Bridged Adapter”
Network Settings

Network Settings

vivek@WorkHorse:~/Documents $ VBoxManage list vms
"CentOS7_X64" {9ad0fbb0-fb12-4246-aa9c-e4250607a5a9}
"Win7" {49884b71-04dc-4b63-b56b-d025e012ea9b}
To see all options of VBoxManage, hit enter after tying in VBoxManage on terminal. Now we can see that, it has listed two VM’s for me. We need CentOS7_X64. Now we will start it using VBoxHeadless.
vivek@WorkHorse:~/Documents $ VBoxHeadless -s CentOS7_X64 &
[1] 28043
vivek@WorkHorse:~/Documents $ Oracle VM VirtualBox Headless Interface 5.0.12_SUSE
(C) 2008-2016 Oracle Corporation
All rights reserved.

vivek@WorkHorse:~/Documents $
Now, get IP of your VM. And do this
vivek@WorkHorse:~/Documents $ ssh oracle@
Last login: Tue Jan 26 23:33:09 2016 from
[oracle@centos7 ~]$
Set up your shell login script like below.
 # .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc

# User specific environment and startup programs


export PATH
. /u01/app/oracle/product/12.1.0/db_1/bin/
Now logout and login again. And start your database and listeners:
[oracle@centos7 ~]$ dbstart $ORACLE_HOME
Processing Database instance "orcl": log file /u01/app/oracle/product/12.1.0/db_1/startup.log
[oracle@centos7 ~]$ lsnrctl status

LSNRCTL for Linux: Version - Production on 28-JAN-2016 23:29:02

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

Alias                     LISTENER
Version                   TNSLSNR for Linux: Version - Production
Start Date                28-JAN-2016 23:27:55
Uptime                    0 days 0 hr. 1 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/centos7/listener/alert/log.xml
Listening Endpoints Summary...
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
If port 1521 is open in firewall, then you can connect to this database from anywhere in your LAN. To shutdown database and CentOS server:
oracle@centos7 ~]$ dbshut $ORACLE_HOME
Processing Database instance "orcl": log file /u01/app/oracle/product/12.1.0/db_1/shutdown.log
[oracle@centos7 ~]$ sudo /sbin/shutdown -h now
[sudo] password for oracle:
Connection to closed by remote host.
Connection to closed.
vivek@WorkHorse:~/Documents $
[1]  + 28043 done       VBoxHeadless -s CentOS7_X64
vivek@WorkHorse:~/Documents $

Leave a Comment

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.