Wednesday 8 May 2019

APPLY PATCHES IN RAC GRID/ORACLE DB HOME

/*FOLLOWING STEPS TO APPLY PATCHES IN RAC GRID/ORACLE DB HOME ENVIRONMENT */

Grid Home: /orahps/12.2.0/grid

Oracle Home: /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome

>> Analyze patches from root user.

---- Using below command can analyze both home grid and DB Home in once
/orahps/12.2.0/grid/OPatch/opatchauto apply /rmanhps/software/patches/28828733 -analyze

-- Using below command can analyze grid patch only.

/orahps/12.2.0/grid/OPatch/opatchauto apply /rmanhps/software/patches/28828733 -analyze -oh /orahps/12.2.0/grid

-- Using below command can analyze Oracle DB Home only.

/orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome/OPatch/opatchauto apply /rmanhps/software/patches/28828733 -analyze -oh

/orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome

>> How to check rollingpatch method.

root@testdbn01:~# /orahps/12.2.0/grid/bin/crsctl query crs activeversion -f
Oracle Clusterware active version on the cluster is [12.2.0.1.0]. The cluster upgrade state is [NORMAL]. The cluster active patch level is [1819134257].

Step:1 Create ocm response file using grid user.

/orahps/12.2.0/grid/OPatch/ocm/bin/emocmrsp -output /orahps/software/ocm.rsp

>> Stop crs from root user

/orahps/12.2.0/grid/bin/crsctl stop crs

/orahps/12.2.0/grid/crs/install/rootcrs.sh -prepatch

>> Give grid owner ship to PSU patches.

chown -R grid:oinstall /rmanhps/software/patches
su - grid

>> Check Opatch version from grid user.

/orahps/12.2.0/grid/OPatch/opatch version

>> Check applied patches from grid user.

/orahps/12.2.0/grid/OPatch/opatch lspatches -oh /orahps/12.2.0/grid

>> Login with Grid user and apply these patches in Grid home.

$ /orahps/12.2.0/grid/OPatch/opatch apply -oh /orahps/12.2.0/grid -local -silent /rmanhps/software/patches/28828733/28822515
$ /orahps/12.2.0/grid/OPatch/opatch apply -oh /orahps/12.2.0/grid -local -silent /rmanhps/software/patches/28828733/28870605
$ /orahps/12.2.0/grid/OPatch/opatch apply -oh /orahps/12.2.0/grid -local -silent /rmanhps/software/patches/28828733/28864846
$ /orahps/12.2.0/grid/OPatch/opatch apply -oh /orahps/12.2.0/grid -local -silent /rmanhps/software/patches/28828733/26839277
$ /orahps/12.2.0/grid/OPatch/opatch apply -oh /orahps/12.2.0/grid -local -silent /rmanhps/software/patches/28828733/28566910

>> Check patches are applied and not using below query.

/orahps/12.2.0/grid/OPatch/opatch lspatches -oh /orahps/12.2.0/grid

******************************* Process How to apply Patches in Oracle RAC Database Home ******************************

>> Change owner ship oracle for patches.

#chown -R oracle:oinstall /rmanhps/software/patches
#su - oracle

>> Check opatch version.

/orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome/OPatch/opatch version

>> Check applied patches.

/orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome/OPatch/opatch lspatches -oh /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome

>> Execute pre-patch command from oracle user.

$ /rmanhps/software/patches/28828733/28870605/custom/scripts/prepatch.sh -dbhome /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome

>> Applied Patches in oracle home from oracle user.

$ /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome/OPatch/opatch apply -oh /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome -local -silent /rmanhps/software/patches/28828733/28822515

$ /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome/OPatch/opatch apply -oh /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome -local -silent /rmanhps/software/patches/28828733/28870605

>> Execute postpatch command after applying patches.

$ /rmanhps/software/patches/28828733/28870605/custom/scripts/postpatch.sh -dbhome /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome 

/orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome/OPatch/opatch lspatches -oh /orahps/12.2.0/db/app/product/12.2.0/hpsrac_dbhome

**********   Below steps are applicable only after grid patching.

/orahps/12.2.0/grid/rdbms/install/rootadd_rdbms.sh

/orahps/12.2.0/grid/crs/install/rootcrs.sh -postpatch

/orahps/12.2.0/grid/bin/crsctl check crs

>> This command will lock invertory if its unlock.

GRID_CHECK=$(stat -c %U /orahps/12.2.0/grid); if [[ $GRID_CHECK == root ]]; then echo -e \\nPASS: Grid Home is locked\\n; else  echo -e \\nFAIL: Grid Home is not locked. Locking Grid Home now . . .\\n;/orahps/12.2.0/grid/crs/install/rootcrs.sh -unlock; /orahps/12.2.0/grid/crs/install/rootcrs.sh -patch; fi


/rmanhps/software/patches/28828733/28822515
/rmanhps/software/patches/28828733/28870605
/rmanhps/software/patches/28828733/28864846
/rmanhps/software/patches/28828733/26839277
/rmanhps/software/patches/28828733/28566910


*****************************  Applying Patches in 11GR2 ************************
>> Execute following steps from root user.

/orahps/11.2.0/grid/bin/crsctl stop crs

/orahps/11.2.0/grid/crs/install/rootcrs.pl -unlock

>> Change ownership of patch.

chown -R grid:oinstall /orahps/software
su - grid

>> Create Grid response file from grid user.

/orahps/11.2.0/grid/OPatch/ocm/bin/emocmrsp -output /orahps/software/ocm.rsp

>> Check opatch version and inventory backed up.

/orahps/11.2.0/grid/OPatch/opatch version

/orahps/11.2.0/grid/OPatch/opatch lsinventory  -oh /orahps/11.2.0/grid > /tmp/grid.lsinventory.before

/orahps/11.2.0/grid/OPatch/opatch lspatches  -oh /orahps/11.2.0/grid

>> Apply following patches in Grid home from grid user.

/orahps/11.2.0/grid/OPatch/opatch napply -oh /orahps/11.2.0/grid -local -silent -ocmrf /orahps/software/ocm.rsp /orahps/software/24436338/24006111

/orahps/11.2.0/grid/OPatch/opatch napply -oh /orahps/11.2.0/grid -local -silent -ocmrf /orahps/software/ocm.rsp /orahps/software/24436338/23054319

/orahps/11.2.0/grid/OPatch/opatch napply -oh /orahps/11.2.0/grid -local -silent -ocmrf /orahps/software/ocm.rsp /orahps/software/24436338/22502505

/orahps/11.2.0/grid/OPatch/opatch lspatches  -oh /orahps/11.2.0/grid

********* Applicable following below steps duing patching of grid and oracle home *******************

>> Execute following steps from root user.

/orahps/11.2.0/grid/rdbms/install/rootadd_rdbms.sh

/orahps/11.2.0/grid/crs/install/rootcrs.pl -patch

/orahps/11.2.0/grid/bin/crsctl check crs

>> This command will lock inventory if it is unlock.

GRID_CHECK=$(stat -c %U /orahps/11.2.0/grid); if [[ $GRID_CHECK == root ]]; then echo -e \\nPASS: Grid Home is locked\\n; else  echo -e \\nFAIL: Grid Home is not locked. Locking Grid Home now . . .\\n;/orahps/11.2.0/grid/crs/install/rootcrs.pl -unlock; /orahps/11.2.0/grid/crs/install/rootcrs.pl -patch; fi

No comments:

Post a Comment

OS Watcher Installation in RAC

 Step:1 Download and untar the oswbb812.tar under the grid user in RAC on the both nodes. Follow the OS Watcher User's Guide (Doc ID 153...