Oracle 11gr2 Patch 3 Installation

Download Software

Download the Oracle software from OTN or MOS depending on your support status.
OTN: Oracle Database 11g Release 2 (11.2.0.1) Software (64-bit) - For unsupported installation.
MOS: Oracle Database 11g Release 2 (11.2.0.3) Software (64-bit) - For supported installation.

Unpack Files

Unzip the files.

mv *.zip /home/oracle

cd /home/oracle

chown oracle linux.x64_11gR2_database_1of2.zip

chgrp oinstall linux.x64_11gR2_database_1of2.zip

chown oracle linux.x64_11gR2_database_2of2.zip

chgrp oinstall linux.x64_11gR2_database_2of2.zip

 

su – oracle

cd /home/oracle

 

# 11.2.0.1

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_2of2.zip

 

#11.2.0.2

unzip p10098816_112020_Linux-x86-64_1of7.zip

unzip p10098816_112020_Linux-x86-64_2of7.zip

 

#11.2.0.3

unzip p10404530_112030_Linux-x86-64_1of7.zip

unzip p10404530_112030_Linux-x86-64_2of7.zip

 




Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1       localhost.localdomain  localhost
123.153.354.15  my_machine.localdomain    my_machine


Automatic Setup

If you plan to use the "oracle-rdbms-server-11gR2-preinstall" package to perform all your prerequisite setup, follow the instructions at http://public-yum.oracle.com to setup the yum repository for OL, then perform the following command.
# yum install oracle-rdbms-server-11gR2-preinstall
All necessary prerequisites will be performed automatically.
Please follow this LINK and come back when you are done.


Manual Setup (optional if you didn't use the oracle-rdbms-server-11gR2-preinstall RPM)

Oracle recommend the following minimum parameter settings. Add or amend the following lines in the "/etc/sysctl.conf" file.

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

The current values can be tested using the following command.

/sbin/sysctl -a | grep <param-name>
Run the following command to change the current kernel parameters.
/sbin/sysctl -p

Add the following lines to the "/etc/security/limits.conf" file.

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

Install the following packages if they are not already present.

# From Oracle Linux 6 DVD
cd /media/cdrom/Server/Packages
rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64* nss-softokn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686* nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*
cd /
eject

Note. This will install all the necessary 32-bit packages for 11.2.0.1. From 11.2.0.2 onwards many of these are unnecessary, but having them present does not cause a problem.

Create the new groups and users.

groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper

useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
passwd oracle

Note. We are not going to use the "ASM" groups, since this installation will not use ASM.


Additional Setup

Disable secure linux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

SELINUX=disabled

Once the change is complete, restart the server.

If you have the Linux firewall enabled, you will need to disable.

Create the directories in which the Oracle software will be installed.

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

Login as root and issue the following command.

xhost +<machine-name>

Login as the oracle user and add the following lines at the end of the ".bash_profile" file.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=my_machine.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


VNC (Optional)
Download it as Oracle from:
https://www.realvnc.com/download/vnc/

As oracle execute:
gunzip VNC-5.0.3-Linux-x64-ANY.tar.gz
tar -xvf VNC-5.0.3-Linux-x64-ANY.tar


Then as root to install it:
cd /home/oracle
cd VNC-5.0.3-Linux-x64
sh vncinstall


Once the installation is done, go back as Oracle and get a FREE license from:
http://www.realvnc.com/products/vnc/licensing

Once you obtained the license, register the product:
vnclicense -add F6B72-NHDKD-RJBB2-3BNQD-3DYMA

Then start the VNCServer
vncserver :1
This last action will ask you for a password, and you will use that one to connect from your desktop.


Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.

./runInstaller

Proceed with the installation of your choice The prerequisites checks will fail for the following version-dependent reasons:

NOTE = If you are planning to also install the patch 11.2.0.3, just install the Oracle Software, do not create the database!!!


Installing Patch 11.2.0.3

Oracle lets you download the full installation package from its support site. So based in the following note:
https://updates.oracle.com/Orion/Services/download?type=readme&aru=14125322

Go to suppor.oracle.com and then To download the software from My Oracle Support:

1.     Log on to My Oracle Support.

2.     Click Patches & Updates.

3.     In the Patch Search section, click the Search tab.

4.     Enter 10404530 in the patch number field.

5.     Select a platform to download.

6.     Click Search.

7.     In the Patch Search Results page, under Patch Name, click the patch number to display the patch details.

8.     Click Download.

9.     From the File Download window, click each file name to download the selected software.

Table 1 Installation Types and Associated Zip Files

Installation Type

Zip File

Oracle Database (includes Oracle Database and Oracle RAC)

Note: you must download both zip files to install Oracle Database.

p10404530_112030_platform_1of7.zip

p10404530_112030_platform_2of7.zip

Oracle Grid Infrastructure (includes Oracle ASM, Oracle Clusterware, and Oracle Restart)

p10404530_112030_platform_3of7.zip

Oracle Database Client

p10404530_112030_platform_4of7.zip

Oracle Gateways

p10404530_112030_platform_5of7.zip

Oracle Examples

p10404530_112030_platform_6of7.zip

Deinstall

p10404530_112030_platform_7of7.zip

 

Use the file p10404530_112030_platform_7of7.zip to uninstall your current version (if any)

If you unzip 7th zip file, you will find deinstaller script in it.

Below note will give you instructions on how to deinstall:

Note.883743.1 "How To Deinstall/Uninstall Oracle Home In 11gR2"

In summary:

1-     Download and unzip de-install utility in some folder outside Oracle Home.
unzip p10404530_112030_Linux-x86-64_7of7.zip

2-     Go to the deinstall folder.

3-     Invoke deinstall utility with the -home option specifying the full path of the Oracle Home you want to deinstall.

4-     Example:

5-     % ./deinstall -home /u01/app/oracle/product/11.2.0/dbhome_2

6-     Check if Oracle Home folder is deleted or not. If not then you have to remove it manually.

 

Now we are ready to install our New 11.2.0.3 Database:

Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/11.2.0/db_1

chown -R oracle:oinstall /u01

chmod -R 775 /u01

 

Move the Files to the Oracle Area and Unzip the files.

cd /home/oracle

 

#11.2.0.3

unzip p10404530_112030_Linux-x86-64_1of7.zip

unzip p10404530_112030_Linux-x86-64_2of7.zip

 

 


Post Installation

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

DB11G:/u01/app/oracle/product/11.2.0/db_1:Y


Auto Startup and Shutdown of Database and Listener

Login as root and modify /etc/oratab file and change last character to Y for apropriate database.
ORCL:/opt/oracle/111:Y

As root user create new file “oracle” (init script for startup and shutdown the database) in /etc/init.d/ directory with following content:

#!/bin/bash

#

# oracle Init file for starting and stopping

# Oracle Database. Script is valid for 10g and 11g versions.

#

# chkconfig: 35 80 30

# description: Oracle Database startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER=oracle

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1

case $1 in

start)

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"

echo -n $"Starting Oracle DB:"

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"

echo "OK"

;;

stop)

echo -n $"Stopping Oracle DB:"

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"

su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"

echo "OK"

;;

*)

echo $"Usage: $0 {start|stop}"

esac

 

OR

#!/bin/sh

# chkconfig: 345 99 10

# description: Oracle auto start-stop script.

#

# Set ORA_HOME to be equivalent to the $ORACLE_HOME

# from which you wish to execute dbstart and dbshut;

#

# Set ORA_OWNER to the user id of the owner of the

# Oracle database in ORA_HOME.

 

#ORA_HOME=/u01/app/oracle/product/10.2.0/db_1

#ORA_HOME=/u01/app/oracle/product/11.1.0/db_1

ORA_HOME=/u01/app/oracle/product/11.2.0/db_1

ORA_OWNER=oracle

 

if [ ! -f $ORA_HOME/bin/dbstart ]

then

    echo "Oracle startup: cannot start"

    exit

fi

 

case "$1" in

    'start')

        # Start the Oracle databases:

        # The following command assumes that the oracle login

        # will not prompt the user for any values

        su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"

        touch /var/lock/subsys/dbora

        ;;

    'stop')

        # Stop the Oracle databases:

        # The following command assumes that the oracle login

        # will not prompt the user for any values

        su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"

        rm -f /var/lock/subsys/dbora

        ;;

esac

 

Execute (as root) following commands (First script change the permissions, second script is configuring execution for specific runlevels):
chmod 750 /etc/init.d/oracle
chkconfig – -add oracle – -level 0356

Auto Startup and Shutdown of Enterprise Manager Database Control

As root user create new file “oraemctl” (init script for startup and shutdown EM DB Console) in /etc/init.d/ directory with following content:
#!/bin/bash
#
# oraemctl Starting and stopping Oracle Enterprise Manager Database Control.
# Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Enterprise Manager DB Control startup script

# Source function library.

. /etc/rc.d/init.d/functions

ORACLE_OWNER=”oracle”
ORACLE_HOME=”/opt/oracle/111″

case “$1″ in
start)
echo -n $”Starting Oracle EM DB Console:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/emctl start dbconsole”
echo “OK”
;;
stop)
echo -n $”Stopping Oracle EM DB Console:”
su – $ORACLE_OWNER -c “$ORACLE_HOME/bin/emctl stop dbconsole”
echo “OK”
;;
*)
echo $”Usage: $0 {start|stop}”
esac

Execute (as root) following commands (First script change the permissions, second script is configuring execution for specific runlevels):
chmod 750 /etc/init.d/oraemctl
chkconfig – -add oraemctl – -level 0356

Next, check the script by running “service oracle stop” or “service oracle start” from the command line:

$ service oracle stop
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
Stopping Oracle Enterprise Manager 11g Database Control …
… Stopped.
Processing Database instance “oratst”: log file /u01/app/oracle/product/11.2.0/db_1/shutdown.log
$ service oracle start
Processing Database instance “oratst”: log file /u01/app/oracle/product/11.2.0/db_1/startup.log
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
Starting Oracle Enterprise Manager 11g Database Control …… started.

After this, it’s time for the final test: reboot your server and check if your Oracle database is automatically started after the reboot.


Collected Resources:
http://www.oracle-base.com/articles/11g/oracle-db-11gr2-installation-on-oracle-linux-6.php
http://kamranagayev.com/2011/03/21/step-by-step-installing-oracle11g-on-linux/
http://easytosolve.wordpress.com/2011/10/26/oracle-database-11g-release-2-11-2-installation-on-oracle-linux-6/