Sunday 27 August 2017

How to Install Oracle 12c Release 2 on CentOS/RHEL 6.X

Install Oracle 12c Release 2 on CentOS/RHEL 6.X

What is Oracle Database?
An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. A database server is the key to solving the problems of information management.

Requirements :-
*) For large-scale installation we need to use multicore processors with High availability.
*) Recommended minimum RAM needed for Oracle is 2GB or more.
*) Swap must be enabled double the size of RAM.
*) Disk space must be more than 20GB, its depends on edition which are we going to choose for installing.
*) /tmp directory must have free space more than 1GB for error free installation.
*) Supported Linux operating systems are RHEL, Centos, Oracle.
*) Both x86_64 and i686 packages are required for installation.

Step 1: Set up Hostname and bind it.
# vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=int-oracle.indusnet.co.in

--- Save and Quit (:wq) ---

# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.0.14.151   int-oracle.indusnet.co.in      int-oracle

--- Save and Quit (:wq) ---

Step 2: Disable firewall and put selinux on permissisve or disabled mode.
# service iptables stop
# chkconfig iptables off

# vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

--- Save and Quit (:wq) ---

# setenforce 0

**Remeber you need to restart the server for the changed selinux settings to put on effect.

Step 3: Install the Dependency required packages using YUM.
# yum -y install wget binutils compat-libcap1 smartmontools compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBC unixODBC-devel xorg* xterm

Step 4: Change the kernel parameters.
# vi /etc/sysctl.conf

## Add the lines at last of the file

# ORACLE 12c Configuration
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

--- Save and Quit (:wq) ---

# sysctl -p
# vi /etc/security/limits.conf

## Add the lines at the last of the file

# ORACLE 12c Configuration
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

--- Save and Quit (:wq) ---

# vi /etc/security/limits.d/90-nproc.conf

# Change number of process from 1024 to 16384
* soft    nproc    1024
# To this
    *  nproc 16384

--- Save and Quit (:wq) ---

Step 5: Create required groups and users for Oracle.
# groupadd -g 520 oinstall
# groupadd -g 521 dba
# groupadd -g 522 oper
# useradd -u 520 -g oinstall -G dba,oper oracle
# passwd oracle
Changing password for user oracle.
New password: *****
Retype new password: *****

Step 6: Create required directories and assign them proper permission / ownerships.
# mkdir -p /u01/app/oracle/product/12/dbhome_1
# chown -Rf oracle:oinstall /u01
# chmod -Rf 775 /u01

Step 7: Configure bash profile for oracle user.
# vi /home/oracle/.bash_profile

## Add these lines at the end of the file

# ORACLE 12c Configuration
PATH=$PATH:$HOME/bin
export TMP=/u01/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=int-oracle.indusnet.co.in
export ORACLE_UNQNAME=ora12c
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12/dbhome_1
export ORACLE_SID=ora12c
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

--- Save and Quit (:wq) ---

Step 8: Now switch to the directory where the installation file (download first) exists extract it.
# mkdir /u01/binaries/

** Download the Oracle 12c Installation Package from http://download.oracle.com/otn/linux/oracle12c/122010/linuxx64_12201_database.zip and Login with the Oracle Login Details and put the installation zip file to the /u01/binaries/ directory.

# unzip linuxx64_12201_database.zip

** Connect the Server with X-Manager and with oracle user that has been created in Step 5.

$ cd /u01/binaries/database/
$ ./runInstaller

In installation window
Step 1 : Configure security updates => Untick the option "I wish to receive security updates via My oracle support" & Provide an Email Address.
Step 2 : Installation option => Select Create & configure Database.(Incase if you want to configure database choose install database software only )
Step 3 : System Class => Select Server Class.
Step 4 : Grid installation option => Select Single instance database installation.
Step 5 : Install Type => Select Typical install
Step 6 : Typical installation =>
Make sure at this step we have following paths selected
Oracle_Base =/u01/app/oracle
Software location=/u01/app/oracle/product/12/dbhome_1
Storage type= File system
Database file location=/u01/app/oracle/oradata
OSDBA Group=dba
Global database name=ora12c
Password=<provide password>
Select option Pluggable Database name=pdbora12c
Step 7 : It should not make any issue regarding packages or other checks.
Step 8 : Install.

While the installation is going on it will ask to run following two scripts from root user.
/u01/app/oracle/product/12/dbhome_1/root.sh
/u01/app/oraInventory/oraInstroot.sh

** The whole process would take some time..

$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
ora12c

SQL> quit

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog.