Wednesday, May 6, 2015

Patching in Rac with opatch auto and manual steps

*&^&*^&*^*&^*&^&*^*&^*^ test1:  *&^&*^&*^*&^*&^&*^*&^*^
--------------------------------------------------------
su - root
cd /opt/app/crs/11.2.0.3/
mv OPatch OPatch_bak
unzip latest OPatch as root
chown -R oracle:dba OPatch
exit
cd /export/home/oracle/patch/
unzip patch 19440385 to the above folder
cd /opt/app/oracle/product/11.2.0.3/
mv OPatch OPatch_bak
unzip latest OPatch
cd /opt/app/crs/11.2.0.3/OPatch/ocm/bin
./emocmrsp
--provide email id and password for metalink
--check for ocm.rsp file created

###################### GRID+DB Patching test1 Start #######################

***********(scenario-1)***********
su - root
cd /opt/app/crs/11.2.0.3/OPatch
opatch auto /export/home/oracle/patch/ -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local
exit
--verify logs for any failures

***********(scenario-2)***********
srvctl stop instance -d test -i test1

su - root
cd /opt/app/crs/11.2.0.3/bin
which crs
crsctl stop crs
exit root

-- grid patch to grid home - 17592127 is grid patch id
cd /export/home/oracle/patch/
export GRID=HOME=/opt/app/crs/11.2.0.3
export ORACLE_HOME=$GRID_HOME
/opt/app/crs/11.2.0.3/OPatch/opatch napply -id 17592127 -oh /opt/app/crs/11.2.0.3 -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local

--grid patch to db home - 17592127 is grid patch id
export ORACLE_HOME=/opt/app/oracle/product/11.2.0.3
cd /export/home/oracle/patch/17592127/custom/server/
/opt/app/crs/11.2.0.3/OPatch/opatch napply -id 17592127 -oh /opt/app/oracle/product/11.2.0.3 -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local

--database patch to database home - 19121548 is db PSU patch id
cd /export/home/oracle/patch/
/opt/app/oracle/product/11.2.0.3/OPatch/opatch napply -id 19121548 -oh /opt/app/oracle/product/11.2.0.3 -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local

cd /opt/app/oracle/product/11.2.0.3/OPatch

--check grid patch updates
export ORACLE_HOME=/opt/app/crs/11.2.0.3
./opatch lsinventory

--check Database patch updates
export ORACLE_HOME=/opt/app/oracle/product/11.2.0.3
./opatch lsinventory

su - root
cd /opt/app/crs/11.2.0.3/bin
which crs
crsctl start crs
--after 5 mins check crs status, all 4 services should be online
crsctl check crs
crsctl stat res -t
exit root

srvctl start instance -d test -i test1

######################## GRID+DB Patching test1 Stop ##########################




*&^&*^&*^*&^*&^&*^*&^*^ test2:  *&^&*^&*^*&^*&^&*^*&^*^
--------------------------------------------------------
cd /export/home/oracle/patch/
unzip patch 19440385 to the above folder
cd /opt/app/oracle/product/11.2.0.3/
mv OPatch OPatch_bak
unzip latest OPatch
cd /opt/app/crs/11.2.0.3/
mv OPatch OPatch_bak
unzip latest OPatch
cd /opt/app/crs/11.2.0.3/OPatch/ocm/bin
./emocmrsp
--provide email id and password for metalink
--check for ocm.rsp file created

###################### GRID+DB Patching test2 Start #######################

***********(schenario-1)***********
su - root
cd /opt/app/crs/11.2.0.3/OPatch
opatch auto /export/home/oracle/patch/ -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local
exit--verify logs for any failures

***********(schenario-2)***********
srvctl stop instance -d test -i test2
su - root
cd /opt/app/crs/11.2.0.3/bin
which crs
crsctl stop crs
exit root

-- grid patch to grid home - 17592127 is grid patch id
export GRID=HOME=/opt/app/crs/11.2.0.3
export ORACLE_HOME=$GRID_HOME
/opt/app/crs/11.2.0.3/OPatch/opatch napply -id 17592127 -oh /opt/app/crs/11.2.0.3 -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local

--grid patch to db home
export ORACLE_HOME=/opt/app/oracle/product/11.2.0.3
cd /export/home/oracle/patch/17592127/custom/server/
/opt/app/crs/11.2.0.3/OPatch/opatch napply -id 17592127 -oh /opt/app/oracle/product/11.2.0.3 -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local

--database patch to database home - 19121548 is db PSU patch id
/opt/app/oracle/product/11.2.0.3/OPatch/opatch napply -id 19121548 -oh /opt/app/oracle/product/11.2.0.3 -ocmrf /opt/app/crs/11.2.0.3/OPatch/ocm/bin/ocm.rsp -local

cd /opt/app/oracle/product/11.2.0.3/OPatch

--check grid patch updates
export ORACLE_HOME=/opt/app/crs/11.2.0.3
./opatch lsinventory

--check Database patch updates
export ORACLE_HOME=/opt/app/oracle/product/11.2.0.3
./opatch lsinventory

su - root
cd /opt/app/crs/11.2.0.3/bin
which crs
crsctl start crs
--after 5 mins check crs status, all 4 services should be online
crsctl check crs
crsctl stat res -t
exit root

srvctl start instance -d test -i test2

######################## GRID+DB Patching test2 Stop ##########################

-- After all nodes are done perform this post installation script in onely 1 instance
sqlplus "/ as sysdba"
@/opt/app/oracle/product/11.2.0.3/rdbms/admin/catbundle.sql psu apply
exit

-- After post installation of script is done perform the below steps for JVM patching

test1:
-------
cd /export/home/oracle/patch
unzip 19282015 patch
srvctl stop instance -d test -i test1
su - root
cd /opt/app/crs/11.2.0.3/bin
which crsctl
crsctl stop crs
exit

test2:
-------
cd /export/home/oracle/patch
unzip 19282015 patch
srvctl stop instance -d test -i test2
su - root
cd /opt/app/crs/11.2.0.3/bin
which crsctl
crsctl stop crs
exit

test1:
-------
export ORACLE_HOME=/opt/app/oracle/product/11.2.0.3
cd /export/home/oracle/patch/19282015
$ORACLE_HOME/OPatch/opatch apply -local
-- verify the patch installation in lsinventory
$ORACLE_HOME/OPatch/opatch lsinventory

test1:
-------
export ORACLE_HOME=/opt/app/oracle/product/11.2.0.3
cd /export/home/oracle/patch/19282015
$ORACLE_HOME/OPatch/opatch apply -local
-- verify the patch installation in lsinventory
$ORACLE_HOME/OPatch/opatch lsinventory

--After JVM apply on all nodes is done bring up both instances

test1:
-------
su - root
cd /opt/app/crs/11.2.0.3/bin
which crs
crsctl start crs
--after 5 mins check crs status, all 4 services should be online
crsctl check crs
crsctl stat res -t
exit root

srvctl start instance -d test -i test1


test2:
-------
su - root
cd /opt/app/crs/11.2.0.3/bin
which crs
crsctl start crs
--after 5 mins check crs status, all 4 services should be online
crsctl check crs
crsctl stat res -t
exit root

srvctl start instance -d test -i test2

--After bringing up all nodes, run the below sql scripts in only 1 node.

cd /export/home/oracle/patch/19282015
sqlplus "/ as sysdba"
spool postinstall_log.log
@postinstall.sql
spool off;
spool utlrp_log.log
@/opt/app/oracle/product/11.2.0.3/utlrp.sql
spool off;
exit


Note: Opatch may some times throw error if we say -local. If thats the case remove and run it


*******************************************************************************

Another easy way to patch using opatch auto for both grid and db homes

Opatch Grid home owned by oracle:dba

Opatch db home owned by oracle:dba

Patch folder unzipped by oracle

opatch auto to be run by root

ocm.rsp file to be generated by oracle user in both grid and db home

./opatch auto /export/home/oracle/oracle_software/25476126 -oh /opt/app/crs/11.2.0.4 -ocmrf /opt/app/crs/11.2.0.4/OPatch/ocm/bin/ocm.rsp

./opatch auto /export/home/oracle/oracle_software/25476126 -oh /opt/app/oracle/product/11.2.0/11.2.0.4/ -ocmrf /opt/app/oracle/product/11.2.0/11.2.0.4/OPatch/ocm/bin/ocm.rsp

************
if response file creation fails with motif error

please install below

pkg install pkg://solaris/library/motif


No comments:

Post a Comment

Featured Post

Apply Patch 22191577 latest GI PSU to RAC and DB homes using Opatch auto or manual steps

Patch 22191577: GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.160119 (JAN2016) Unzip the patch 22191577 Unzip latest Opatch Version in or...