Saturday 20 January 2018

Step by Step manually Apply Rolling PSU Patch and rollback in Oracle Database 11g RAC Environment


PSU patch Apply on ORACLE RAC 11g Home

OPatch is an Oracle-supplied utility that assists you with the process of applying interim patches to Oracle's software and rolling back interim patches from Oracle's software.


1.  For Binaries backup

Login with Grid Owner and stop clusterware/Grid

with root access(Use sudo if sudo access available for this command)

sudo /grid_home/11.2.0/grid/bin/crsctl stop crs

go to Backup location  
cd /backup

tar -cvf OraHome_CBAFPACSDBOP03_230715.tar /oracle_home/app/orahome
tar -cvf - /grid_home/11.2.0/grid | ssh oradb@172.23.3.227 "cd  /med/appl; cat > grid_172.23.1.82_230715.tar"

with root access(Use sudo for if sudo available)


start Clusterwaare/Grid after Backup

sudo /grid_home/11.2.0/grid/bin/crsctl start crs

 2.Stop the CRS managed resources running from DB homes.

      Database Home Owner Execute:

      $ srvctl stop home -o /oracle_home/app/orahome -s /backup/patch/grid_patch.log -n CBAFPACSDBOP03

  3.Run the pre root script.

      with root access(Use sudo if sudo access available for this command)

Patching Oracle Clusterware has special considerations: Part of the software is owned by root and part is owned by the account used to install the product. Before you can apply a
patch or make other modifications to the software files in the Grid home, you must first unlock the Grid home. 

To unlock the Grid home, perform the following steps:

 # /grid_home/11.2.0/grid/crs/install/rootcrs.pl -unlock

When you run the rootcrs.pl script with the -unlock flag, it stops the Oracle Clusterware stack and unlocks the files in the Grid home so they can be modified.

    # /usr/sbin/slibclean

   4.Apply the CRS patch using.

      As the GI home owner execute:

      $  /grid_home/11.2.0/grid/OPatch/opatch napply -oh /grid_home/11.2.0/grid -local /backup/patch/17592127 OPatch.SKIP_VERIFY_SPACE=true

      As the GI home owner execute:

      $  /grid_home/11.2.0/grid/OPatch/opatch apply -oh  /grid_home/11.2.0/grid -local /backup/patch/20299017 OPatch.SKIP_VERIFY_SPACE=true

   5.Run the pre-script for DB component of the patch.

Save important configuration settings to prevent them from being overwritten by the patch by using the following command:

      As the database Home Owner execute:

      $ /backup/patch/17592127/custom/server/17592127/custom/scripts/prepatch.sh -dbhome /oracle_home/app/orahome

   6.Apply the DB patch.

      As the database home owner execute:

      $ /oracle_home/app/orahome/OPatch/opatch napply -oh /oracle_home/app/orahome -local /backup/patch/17592127/custom/server/17592127
      $ /oracle_home/app/orahome/OPatch/opatch apply -oh /oracle_home/app/orahome -local /backup/patch/20299017

   7. Run the post script for DB component of the patch.

Apply the configuration settings that were saved in step 5 to the files that have been overwritten by the patch with the following command:

postpatch.sh –crshome

 As the database home owner execute:

      $ /backup/patch/17592127/custom/server/17592127/custom/scripts/postpatch.sh -dbhome /oracle_home/app/orahome

  8.Run the post script.

       with root access(Use sudo if sudo access available for this command)

      # /grid_home/11.2.0/grid/rdbms/install/rootadd_rdbms.sh

      with root access(Use sudo if sudo access available for this command)

After you have finished modifying the Grid home, lock it again as the root user using commands similar to the following:
The rootcrs.pl script with the -patch flag locks the Grid home again and restarts the Oracle Clusterware stack.

      # /grid_home/11.2.0/grid/crs/install/rootcrs.pl -patch


   9. Start the CRS managed resources that were earlier running from DB homes.

      If this is a GI Home environment, as the database home owner execute:

      $ srvctl start home -o /oracle_home/app/orahome -s /backup/patch/grid_patch.log -n CBAFPACSDBOP03

10. Follow 1 - 9 step for second Node.

11. Login with DB owner

sql>@?/rdbms/admin/catbundle.sql psu apply



======================######################=========================

Manually rollback a PSU Patch


DB HOME:

opatch nrollback -local -id 24006101 -oh $ORACLE_HOME

cd /u01/software/psuoct2016/12cGI/24412235/23854735/custom/scripts

./prepatch.sh

opatch nrollback -local -id 23854735 -oh $ORACLE_HOME

./postpatch.sh

GRID HOME:

$GRID_HOME/crs/install/rootcrs.pl -prepatch -nonrolling

opatch nrollback -local -id 24006101 -oh $GRID_HOME

opatch nrollback -local -id 23854735 -oh $GRID_HOME

$GRID_HOME/crs/install/rootcrs.pl -postpatch -nonrolling

After the final step, your GI will start all cluster services and the database instances. Please do perform your usual checks for each instance.



No comments:

Post a Comment