Blog | Oct 31, 2014

Oracle 12c for Pro Newbies : The Installation

Hi Readers!!!

I have just successfully installed Oracle 12c Database standalone installation on virtual machine (using Oracle VM Virtual Box) and I would like to share my experience with you. The platform I used is the Oracle Linux 5.6. However, the steps for installation are almost the same as for RHEL 5.6 except for some packages which may vary (Refer to Oracle Database Installation Guide for a complete list of packages). I always recommend that the DBA should skim at least once through the Quick Installation guide provided by Oracle before deploying the software on a server. 
As a first step, you should ensure that the machine is prepared for an installation, which is referred to as a pre-installation task.

We would be breaking the installation process into two phases:

1. Preparing My Machine (Pre-12c installation)
2. Installing 12c Database

Preparing My Machine

Before you proceed with the installation of Oracle 12c on Linux, you should first try to fulfill all the prerequisites that the software demands from you. The basic prerequisites are:

1. RAM (Random Access Memory)
The most important component for an Oracle Instance perhaps is the memory on the machine. The minimum RAM required by Oracle 12c is 1GB which will be enough for the installation to complete considering all other caveats met. However, the recommended size is 2GB or more.

Checking the RAM size:
[root@12ctst ~]# grep -i memtotal /proc/meminfo
MemTotal:        1243872 kB

2. Swap Space
“Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space.” – www.centos.org

Oracle defines the swap space requirement as:

 

RAM            Swap Space
1-2 GB 1.5 * RAM
2-16 GB = RAM
>16 GB 16 GB

Checking the Swap size:
[root@12ctst ~]# grep -i SwapTotal /proc/meminfo
SwapTotal:   1920000 kB

3. Storage Space
Storage Space required generally depends on the amount of data that needs to be stored in the database and hence varies from one environment to the other. However, the installation files generally need anticipated space. As per Oracle documentation, a minimum of 6.4 GB is required for the software files.

Checking the Disk space:
[root@12ctst ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              37G  2.4G   33G   7% /
/dev/sda1             190M   22M  159M  12% /boot
tmpfs                 608M     0  608M   0% /dev/shm

4. Temporary Directory Space
A minimum of 1GB disk space is required for temporary directory.

Checking the /tmp space:
[root@12ctst ~]# df -h /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              37G  2.4G   33G   7% /

5. Processor Architecture & Operating System Version
Check the supported architectures & OS versions in the Installation Guide.

Checking the architectures and OS version:

[root@12ctst ~]# cat /proc/version
Linux version 2.6.32-100.26.2.el5 (mockbuild@ca-build10.us.oracle.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Jan 18 20:11:49 EST 2011

[root@12ctst ~]# uname -m
x86_64

[root@12ctst ~]# uname -r
2.6.32-100.26.2.el5

6. Packages Required
You should check the packages required for your OS in the Installation Guide. I’m using the Oracle Linux 5.6 in this write-up. You should ensure that all the packages and dependencies are installed successfully on your machine. I would suggest making a list of required packages and verify the installation of each so that the installation proceeds smoothly.

Command:
rpm –q  <Package_Name>

Install the packages & dependencies which are not already installed.

List of packages required for Oracle Linux 5 and Red Hat Linux 5:

 

binutils-2.17.50.0.6 Verified
compat-libstdc++-33-3.2.3 Verified
gcc-4.1.2 Verified
gcc-c++-4.1.2 Verified
glibc-2.5-58 Verified
glibc-devel-2.5-58
Verified
Ksh Verified
libaio-0.3.106 Verified
libaio-devel-0.3.106 Verified
libgcc-4.1.2 Verified
libstdc++-4.1.2 Verified
libstdc++-devel 4.1.2 Verified
libXext-1.0.1 Verified
libXtst-1.0.1 Verified
libX11-1.0.3 Verified
libXau-1.0.1 Verified
libXi-1.0.1 Verified
make-3.81 Verified
sysstat-7.0.2 Verified

 

 

7. Kernel Parameters and Resource Limits
Verify the required kernel parameters and limits from the Installation Guide. If you find the things different, make the following entries in the files:

• /etc/sysctl.conf

fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
  msl  mns  opm mni
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

Oracle Soft nproc 2047
Oracle Hard nproc 16384
Oracle
Soft
nproc 1024
Oracle Soft nproc 65536

With this we come to an end of our first step and now we will begin the 12c Database installation.

Create required OS users and groups
 

Group Typical Linux Group/User name
The Oracle Inventory group oinstall
The OSDBA group dba
The Oracle software owner oracle
The OSOPER group oper

============================================================================================================================

[root@12ctst ~]# groupadd oinstall
[root@12ctst ~]# groupadd dba
[root@12ctst ~]# groupadd oper
[root@12ctst ~]# useradd -u 500 -g oinstall -G dba,oper oracle

Note: Many more groups are available in the Oracle Database 12c viz. asmdba, asmoper, asmadmin, backupdba, dgdba, kmdba etc. More about these groups will be explained later.

Downloading and Unzipping the Oracle Binaries

Now, download the Oracle Database 12c binaries from downloads section of the Oracle website.

Place the binaries under a directory say /home/oracle in my case.

[oracle@12ctst ~]$ ls -ltr
total 2627676
drwxr-xr-x 7 oracle oinstall       4096 Jul  7 20:09 database
-rwxr-xr-x 1 oracle oinstall 1673544724 Aug  6 18:18 linuxamd64_12102_database_1of2.zip
-rwxr-xr-x 1 oracle oinstall 1014530602 Aug  6 18:28 linuxamd64_12102_database_2of2.zip

Use the following commands to unzip the binaries:
[oracle@12ctst ~]$ unzip linuxamd64_12102_database_1of2.zip
[oracle@12ctst ~]$ unzip -v linuxamd64_12102_database_2of2.zip

This creates a directory named database which contains the software after the extract. The database directory contains the following immediate sub-directories and the files:

[oracle@12ctst ~]$ cd database/
[oracle@12ctst database]$ ls -ltr
total 36
-rwxr-xr-x  1 oracle oinstall  500 Feb  7  2013 welcome.html
-rwxr-xr-x  1 oracle oinstall 8533 Jul  7 18:44 runInstaller
drwxr-xr-x  2 oracle oinstall 4096 Jul  7 18:44 rpm
drwxrwxr-x  2 oracle oinstall 4096 Jul  7 19:48 sshsetup
drwxrwxr-x  2 oracle oinstall 4096 Jul  7 19:48 response
drwxr-xr-x 14 oracle oinstall 4096 Jul  7 19:49 stage
drwxr-xr-x  4 oracle oinstall 4096 Aug  6 18:36 install

The oraInst.loc file

Create a file called oraInst.loc. This is generally a single file per host and is placed in the /etc directory on a typical linux system. 
This file is responsible in helping keep track of the versions of the Oracle on a system.
oinstall group is generally used for the management of the inventories. This helps the oinstall group to perform installation and upgrades on a server.

The oraInst.loc contains the following two details:

i. Path of the Oracle Inventory directory
ii. Name of the OS group that can install and upgrade the Oracle software.
[oracle@12ctst ~]$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
[oracle@12ctst ~]$
The record keeping of the version of Oracle installed on a machine is done by the inventory.xml file which resides under the <inventory_loc>/ContentsXML....................
........................................................................................................................................................................................................................................................................................................

[oracle@12ctst ~]$ cat /u01/app/oraInventory/ContentsXML/inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2014, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>12.1.0.2.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.1.0.1/db_1" TYPE="O" IDX="1"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
[oracle@12ctst ~]$
...........................................................................................................................................................................................................................................................................................................

Make sure that the oraInst.loc file is owned by oracle user and the user has proper access privileges for this file.
chown oracle:oinstall oraInst.loc
[root@12ctst ~]# chown oracle:oinstall /etc/oraInst.loc
[root@12ctst ~]# chmod 775 /etc/oraInst.loc
[root@12ctst ~]# ls -ltr /etc/oraInst.loc
-rwxrwxr-x 1 oracle oinstall 57 Aug  6 18:44 /etc/oraInst.loc
You are almost done here. You just have to run the installer and put the required details which will be prompted by the OUI (Oracle Universal Installer) in graphical mode.
Please note that this can be a bottleneck when you are performing the installation remotely. It is better to use the silent install. This means that you provide all the information to the installer in advance and do not wait for it to paint the screen. The file in which you keep all this info is called the response file.

Q. What is the response file?
Response file is a file which helps in automating the Oracle installation by providing all the details in advance. These details are then picked up by the installer itself without interacting with the user.

Q. Where can I find a sample response file?
The sample response files can be found under the directory named database/response/which is created when the binaries are unzipped.
[oracle@12ctst ~]$ cd /home/oracle/database/response/
[oracle@12ctst response]$ ls -ltr
total 116
-rwxrwxr-x 1 oracle oinstall  6038 Jan 24  2014 netca.rsp
-rwxrwxr-x 1 oracle oinstall 74822 Apr  4 10:50 dbca.rsp
-rw-rw-r-- 1 oracle oinstall 25036 Jul  7 17:56 db_install.rsp

Q. Which response file do I choose for the Oracle installation?
db_install.rsp

Q. How do I use this file?
Make a copy of this and place it in a directory say /home/oracle and name it say 12cinst.rsp. Then, edit the file 12inst.rsp for the required configuration.

Q. What are the configuration parameters in this file?
Each configuration parameter is provided with a small explanation of its basic purpose. More explanation can be sought from Oracle docs. The sample response file contains various sections such as Grid installation, Database creation, ASM configuration etc., but here I’m just installing the software without any grid and DB creation options.

The edited file will somewhat look like:
................................................................................................................................................................................................................................................................................................................

# Do not change the following system generated value.

#..............................................................................................................................................................................................................................................................................................................

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=12ctst.motleydata.com
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/etc/oraInst.loc
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/12.1.0.1/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba

#...............................................................................................................................................................................................................................................................................................................

# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.

#................................................................................................................................................................................................................................................................................................................

oracle.install.db.DBA_GROUP=dba

#...............................................................................................................................................................................................................................................................................................................

# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.
# The value to be specified for OSOPER group is optional.

#..............................................................................................................................................................................................................................................................................................................

oracle.install.db.OPER_GROUP=oper

#..............................................................................................................................................................................................................................................................................................................

# The BACKUPDBA_GROUP is the OS group which is to be granted OSBACKUPDBA privileges.

#..............................................................................................................................................................................................................................................................................................................

oracle.install.db.BACKUPDBA_GROUP=dba

#..............................................................................................................................................................................................................................................................................................................

# The DGDBA_GROUP is the OS group which is to be granted OSDGDBA privileges.

#..............................................................................................................................................................................................................................................................................................................

oracle.install.db.DGDBA_GROUP=dba

#..............................................................................................................................................................................................................................................................................................................

# The KMDBA_GROUP is the OS group which is to be granted OSKMDBA privileges.

#.............................................................................................................................................................................................................................................................................................................

oracle.install.db.KMDBA_GROUP=dba

#.............................................................................................................................................................................................................................................................................................................

# Specify whether user doesn't want to configure Security Updates.
# The value for this variable should be true if you don't want to configure
# Security Updates, false otherwise.
#
# The value can be either true or false. If left blank it will be assumed
# to be false.
#
# Example    : DECLINE_SECURITY_UPDATES=false

#.............................................................................................................................................................................................................................................................................................................

DECLINE_SECURITY_UPDATES=true

.................................................................................................................................................................................................................................................................................................................

Now create the /u01 directory make oracle user its owner so that it has the appropriate privileges to work with it.
[root@12ctst ~]# mkdir /u01
[root@12ctst ~]# chown -R oracle:oinstall /u01/
Next run the installer and check the install logs at /u01/app/oraInventory/logs. Name of the install log will be like installActions2014-08-07_05-51-11PM.log
./runInstaller -ignoreSysPrereqs -force -silent -responseFile /home/oracle/12cinst.rsp
Once the installation is complete, you can connect to sqlplus. However, you will have to create a database as we have only installed software so far. For queries mail me at araina@Tricoresolutions.com. The creation of the database and working ethics in Oracle will be explained in the next blog.
Stay connected!!!

References:
http://docs.oracle.com/database/121/index.htm