top of page

Oracle 12c Installation on Oracle Linux

Install Oracle 12c on Oracle Linux with ease using this guide.

In this article, we will be looking at Oracle 12cR2 installation on Oracle Linux 7.7 version. The steps are exactly same for OEL 6 and all other versions of OEL 7.x


For this demonstration purpose, I have used virtualbox VM with 4 GB RAM and 120 GB hard disk. I have setup the virtual machine with exact same steps described in the following article Install Oracle Linux on VirtualBox (OEL 7.7)

Oracle 12c Prerequisites


Use the YUM repository to perform all the pre-install steps. Make sure your VM is able to ping google.com before executing below command

yum install -y oracle-database-server-12cR2-preinstall

Set password for the oracle user

passwd oracle

Create directories which will hold Oracle software installation

mkdir -p /u01/app/oracle/product/12.2.0.1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

Setup Oracle user bash_profile

su - oracle
vi .bash_profile

Delete all and paste below. Make sure to change environment variables according to your environment

# .bash_profile

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

# User specific environment and startup programs
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=prod

export NLS_LANG=american_america.al32utf8
export NLS_DATE_FORMAT="yyyy-mm-dd:hh24:mi:ss"

PATH=$PATH:$HOME/.local/bin:$ORACLE_HOME/bin

export PATH

Export the bash profile

. .bash_profile

Download Oracle 12c and copy the 12c software file to /tmp location and unzip into ORACLE_HOME location

cd $ORACLE_HOME

unzip -qo /tmp/linuxx64_12201_database.zip

At this stage, you have two options to install Oracle software: silent mode and graphical mode. We will look at both methods below, choose the one that suits your environment.


Oracle 12c Silent Install


Start the run installer in silent mode to begin the installation

cd $ORACLE_HOME/database

./runInstaller -ignoreSysPrereqs -showProgress -silent       \
oracle.install.option=INSTALL_DB_SWONLY                      \
ORACLE_HOSTNAME=${HOSTNAME}                                  \
UNIX_GROUP_NAME=oinstall                                     \
INVENTORY_LOCATION=/u01/app/oraInventory                     \
SELECTED_LANGUAGES=en,en_GB                                  \
ORACLE_HOME=${ORACLE_HOME}                                   \
ORACLE_BASE=${ORACLE_BASE}                                   \
oracle.install.db.InstallEdition=EE                          \
oracle.install.db.OSDBA_GROUP=dba                            \
oracle.install.db.OSOPER_GROUP=dba                           \
oracle.install.db.OSBACKUPDBA_GROUP=dba                      \
oracle.install.db.OSDGDBA_GROUP=dba                          \
oracle.install.db.OSKMDBA_GROUP=dba                          \
oracle.install.db.OSRACDBA_GROUP=dba                         \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false                   \
DECLINE_SECURITY_UPDATES=true                                \
oracle.installer.autoupdates.option=SKIP_UPDATES

Once installation is completed, run the root scripts and you can move to DBCA create database.


Oracle 12c GUI Install


Start the runInstaller and follow the below screens to install Oracle 12cR2 software

cd /u01/database
./runinstaller

Uncheck to disable receiving security updates and click on next. You will get a warning, just click OK to proceed



Once installation is done, run the root script and create database using DBCA.



DBCA Create Database


Fire Database Configuration Assistant to create 12c database

#for GUI database creation 
dbca  

#for silent database creation
dbca -silent -createDatabase                   \
-templateName General_Purpose.dbc              \
-gdbName ${ORACLE_SID}                         \
-sid ${ORACLE_SID}                             \
-createAsContainerDatabase false               \
-emConfiguration NONE                          \
-datafileDestination /u01/db_files             \
-storageType FS                                \
-characterSet AL32UTF8                         \
-totalMemory 2048                              \
-recoveryAreaDestination /u01/FRA              \
-sampleSchema true

Enjoy!

Become a top notch dba with DBA Genesis
Start your DBA career today
bottom of page