//
you're reading...
Database, Oracle Installation & Configuration

Install Oracle Database 11g R2 on Linux RHEL/CentOS 6.5 – Section 2 (Single Instance)

Install Oracle Database 11g R2 – Prepare the OS Environment for Grid and Oracle Software

Create the users (grid, oracle) and groups for grid infrastructure and oracle software

groupadd -g 1000 oinstall
groupadd -g 1200 asmadmin
groupadd -g 1201 asmdba
groupadd -g 1202 asmoper
groupadd -g 1300 dba
groupadd -g 1301 oper
useradd -m -u 1100 -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "Grid Infrastructure Owner" grid
useradd -m -u 1101 -g oinstall -G dba,oper,asmdba -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle

Prepare the storage for Grid and Oracle home
Notice: For Oracle Grid Infrastructure installation, the oracle base and oracle home is in different sub folder

1) Poweroff the Linux Virtual Machine

2) Add 2 virtual disk as

  • oragi 30GB (In the Linux Server map with /dev/sdb1)
  • ora01 30GB (In the Linux Sever map with /dev/sdc1)

3) Create folder ‘/oragi’ and ‘/ora01’

root@newzonetechdb02> mkdir /oragi
root@newzonetechdb02> mkdir /ora01

4) fdisk /dev/sdb (Do the disk alignment)

fdisk_1

5) fdisk /dev/sdc

fdisk_2

6) mount the /dev/sdb1 and /dev/sdc1

[root@newzonetechdb02]# mkfs.ext3 /dev/sdb1
[root@newzonetechdb02]# mkfs.ext3 /dev/sdc1 
[root@newzonetechdb02]# mount -t ext3 /dev/sdb1 /oragi
root@newzonetechdb02]# mount -t ext3 /dev/sdc1 /ora01

Create the path for grid and oracle installation

1) Create oracle home folder

[root@newzonetechdb02]# mkdir -p /ora01/app/oracle/product/11.2.0.4/dbhome_1

2) Create the oracle inventory folder

[root@newzonetechdb02]# mkdir -p /ora01/app/oraInventory

3) Create the grid folder

[root@newzonetechdb02]# mkdir -p /oragi/app/11.2.0.4/grid

4) Create the base folder for Grid

[root@newzonetechdb02]# mkdir -p /ora01/app/grid

5) grant permission to grid:oinstall for grid home

[root@newzonetechdb02]# chown -R grid:oinstall /oragi
[root@newzonetechdb02]# chmod -R 775 /oragi

6) grant permission to oracle:oinstall for Oracle home

[root@newzonetechdb02]# chown -R oracle:oinstall /ora01
[root@newzonetechdb02]# chmod -R 775 /ora01

7) grant the permmission of oracle_base as grid:oinstall for GRID

[root@newzonetechdb02]# cd /ora01/app/
[root@newzonetechdb02]# chown -R grid:oinstall grid/
[root@newzonetechdb02]# cd /ora01/app/
[root@newzonetechdb02]# chown -R grid:oinstall oraInventory/

Setup Oracle Environment

kernel parameters, session, security and oracle_base

[root@newzonetechdb02]# vi /etc/sysctl.conf

Insert the following content

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

Apply the kernel parameters to live

[root@newzonetechdb02]# sysctl -p

session required pam_limits.so

[root@newzonetechdb02]# vi /etc/pam.d/login

Insert the folowing content

session required pam_limits.so

Adding following line on /etc/security/limits.conf

[root@newzonetechdb02]# vi /etc/security/limits.conf
grid      soft  nproc   2047
grid      hard  nproc   16384
grid      soft  nofile  1024
grid      hard  nofile  65536
oracle    soft  nproc   2047
oracle    hard  nproc   16384
oracle    soft  nofile  1024
oracle    hard  nofile  65536

Install RPMs for Oracle and Grid Software

rpm -ivh binutils-2.20.51.0.2-5.36.el6.x86_64.rpm
rpm -ivh compat-libcap1-1.10-1.x86_64.rpm
rpm -ivh compat-libcap1-1.10-1.i686.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm
rpm -ivh elfutils-libelf-0.152-1.el6.x86_64.rpm
rpm -ivh elfutils-libelf-devel-0.152-1.el6.x86_64.rpm
rpm -ivh gcc-4.4.7-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.7-4.el6.x86_64.rpm
rpm -ivh glibc-2.12-1.132.el6.x86_64.rpm
rpm -ivh glibc-2.12-1.132.el6.i686.rpm
rpm -ivh glibc-common-2.12-1.132.el6.x86_64.rpm
rpm -ivh glibc-devel-2.12-1.132.el6.x86_64.rpm
rpm -ivh glibc-devel-2.12-1.132.el6.i686.rpm
rpm -ivh glibc-headers-2.12-1.132.el6.x86_64.rpm
rpm -ivh ksh-20120801-10.el6.x86_64.rpm
rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm
rpm -ivh libaio-0.3.107-10.el6.i686.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.i686.rpm
rpm -ivh libgcc-4.4.7-4.el6.x86_64.rpm
rpm -ivh libgcc-4.4.7-4.el6.i686.rpm
rpm -ivh libstdc++-4.4.7-4.el6.x86_64.rpm
rpm -ivh libstdc++-4.4.7-4.el6.i686.rpm
rpm -ivh libstdc++-devel-4.4.7-4.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.7-4.el6.i686.rpm
rpm -ivh make-3.81-20.el6.x86_64.rpm
rpm -ivh numactl-devel-2.0.7-8.el6.x86_64.rpm
rpm -ivh sysstat-9.0.4-22.el6.x86_64.rpm
rpm -ivh unixODBC-2.2.14-12.el6_3.x86_64.rpm
rpm -ivh unixODBC-2.2.14-12.el6_3.i686.rpm
rpm -ivh unixODBC-devel-2.2.14-12.el6_3.x86_64.rpm

Setup the .bash_profile for user grid

[grid@newzonetechdb02]# vi /home/grid/.bash_profile

Insert the following content

# setup .bash_profile start

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

alias ls="ls -FA"

ORACLE_SID=+ASM; export ORACLE_SID
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/ora01/app/grid; export ORACLE_BASE
ORACLE_HOME=/oragi/app/11.2.0.4/grid; export ORACLE_HOME
ORACLE_PATH=/ora01/app/oracle/common/oracle/sql; export ORACLE_PATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/ora01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp

alias numuse='who | wc -l'
alias ohome='cd $ORACLE_HOME ; pwd'
alias sid='env | grep ORACLE_SID'
alias bin='cd $ORACLE_HOME/bin ; pwd'
alias home='cd $HOME ; pwd'
alias sqlplus='rlwrap sqlplus'
alias asmcmd='rlwrap asmcmd'
umask 022

# setup .bash_profile end

Setup the .bash_profile for user oracle

[oracle@newzonetechdb02]# vi /home/oracle/.bash_profile

Insert the following content

# setup .bash_profile end

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

alias ls="ls -FA"
ORACLE_SID=TESTDB; export ORACLE_SID
ORACLE_UNQNAME=TESTDB; export ORACLE_UNQNAME
JAVA_HOME=/usr/local/java; export JAVA_HOME
ORACLE_BASE=/ora01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/dbhome_1; export ORACLE_HOME
ORACLE_PATH=/ora01/app/common/oracle/sql; export ORACLE_PATH
# SQLPATH=/u01/app/common/oracle/sql; export SQLPATH
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
PATH=${PATH}:/ora01/app/common/oracle/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp

alias numuse='who | wc -l'
alias ohome='cd $ORACLE_HOME ; pwd'
alias sid='env | grep ORACLE_SID'
alias bin='cd $ORACLE_HOME/bin ; pwd'
alias home='cd $HOME ; pwd'
alias sqlplus='rlwrap sqlplus'
alias asmcmd='rlwrap asmcmd'

. ~/.aliases
clear screen

Setup the NTP service

add the “-x” option into the following line in the “/etc/sysconfig/ntpd” file.

OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid"
[root@newzonetechdb02]# service ntpd restart
[root@newzonetechdb02]# vi /etc/ntp.conf

add following line to the file ‘/etc/ntp.conf’

server newzonetechdb02

References
Oracle® Database Installation Guide 11g Release 2 (11.2) for Linux http://docs.oracle.com, Retrieved on 2014-10-20

Install Oracle Database 11g R2 on Linux using Oracle ASM – (OL5) http://www.idevelopment.info, Retrieved on 2014-10-20

Advertisements

About daviewning

I am an Oracle DBA

Discussion

Trackbacks/Pingbacks

  1. Pingback: Install Oracle Database 11g R2 on Linux CentOS 6.5 – Before Start | DBTechZone - February 13, 2016

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: