Step by Step Apply Rolling PSU Patch In Oracle Database 12c RAC Environment

Rolling upgrade patch :-

  • The rolling upgrade refers to upgrading different databases or different instances of the same database (in a Real Application Clusters environment) one at a time, without stopping the database.
  • The advantage of a RAC rolling upgrade is that it enables at least some instances of the RAC installation to be available during the scheduled outage required for patch upgrades. Only the RAC instance that is currently being patched needs to be brought down. The other instances can continue to remain available. This means that the impact on the application downtime required for such scheduled outages is further minimized. Oracle’s opatch utility enables the user to apply the patch successively to the different instances of the RAC installation.
  • Rolling upgrade of patches is currently available for one-off patches and PSU patches.
  • Rolling patch upgrades are not available for deployments where the Oracle Database software is shared across the different nodes.
  • Before Opatchauto utility, we need to manually down the instance and cluster related services(prepatch.sh) before applying rolling patch.
  • The GI System patch includes updates for both the Clusterware home and Database home that can be applied in a rolling fashion.
  • This patch is Oracle RAC Rolling Installable has to be mentioned in README.html.

Step by step apply Rolling PSU Patch in Oracle Database 12c RAC environment :-

Description:- 

In this article we are going to see Step by step Apply Rolling PSU Patch in Oracle Database 12c RAC environment

Let start the Demo:-

Download the latest the PSU patch for GRID and ORACLE_HOME :-

Patch 28349311 –  GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.2.181016

The patch 28349311 was the super seeded patch of database PSU patch.

The above PSU patch is rolling applicable and so involves minimal downtime.

 

 

 

 

 

Database Env :-

For Node 1,

prod()
{
ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1
export ORACLE_HOME
ORACLE_BASE=/oracle/app/oracle
export ORACLE_BASE
ORACLE_SID=prod1
export ORACLE_SID
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:.
export LD_LIBRARY_PATH
LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:/usr/lib:/lib
export LIBPATH
TNS_ADMIN=${ORACLE_HOME}/network/admin
export TNS_ADMIN
PATH=$ORACLE_HOME/bin:$PATH:.
export PATH
}

For Node 2,

prod()
{
ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1
export ORACLE_HOME
ORACLE_BASE=/oracle/app/oracle
export ORACLE_BASE
ORACLE_SID=prod2
export ORACLE_SID
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:.
export LD_LIBRARY_PATH
LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:/usr/lib:/lib
export LIBPATH
TNS_ADMIN=${ORACLE_HOME}/network/admin
export TNS_ADMIN
PATH=$ORACLE_HOME/bin:$PATH:.
export PATH
}

Grid Env :-

For Node 1,

grid()
{
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/app/12.1.0.2/grid; export ORACLE_HOME
export ORACLE_SID=+ASM1
ORACLE_TERM=xterm; export ORACLE_TERM
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
SQLPATH=/u01/app/oracle/scripts/sql:/u01/app/12.1.0.2/grid/rdbms/admin:/u01/app/oracle/product/12.1.0.2/db_1/rdbms/admin; export SQLPATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
}

For Node 2,

grid()
{
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/app/12.1.0.2/grid; export ORACLE_HOME
export ORACLE_SID=+ASM2
ORACLE_TERM=xterm; export ORACLE_TERM
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
SQLPATH=/u01/app/oracle/scripts/sql:/u01/app/12.1.0.2/grid/rdbms/admin:/u01/app/oracle/product/12.1.0.2/db_1/rdbms/admin; export SQLPATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
}

Steps to Upgrade the OPATCH UTILITY:-

Step 1:- Check the opatch version and inventory for ORACLE_HOME on both nodes

For Node 1,

opatch version

 

 

 

 

 

opatch lsinventory

 

 

 

  

For Node 2,

opatch version

 

 

 

 

opatch lsinventory

 

 

 

 

Step 2:-Check the opatch version and inventory for GRID HOME on both nodes

For Node 1,

opatch version

 

 

 

 

opatch lsinventory

 

 

 

 

For Node 2,

opatch version

 

 

 

 

opatch lsinventory

 

 

 

 

 

 

 

 

Step 3:- Update the opatch utility

Take the backup of OPatch directory from GRID and ORACLE_HOME on both nodes

Unzip the OPatch downloaded zip into GRID and ORACLE_HOME directory

For Grid home:

 

 

 

 

 

 

 

 

 

 

 

 

 

For Database home:

For Node 1,

 

 

 

 

 

 

 

 

Copy patch p6880880_122010_Linux-x86-64.zip to the node 2(racpb2) or Copy the unzipped OPatch folder to the node 2(racpb2).

 

 

 

 

For Node 2,

After copying to Node 2,check the new OPatch version in both GRID and ORACLE_HOME,

 

 

 

 

After upgrade the OPatch utility on both nodes apply the GRID and ORACLE_HOME PSU patches.

Step 4:- Validation of Oracle Inventory 

To check the GRID HOME inventory :-

opatch lsinventory -detail -oh /u01/app/12.1.0.2/grid

Before beginning patch application, check the consistency of inventory information for GI home and each database home to be patched

 

 

 

 

To check the ORACLE_HOME inventory :-

opatch lsinventory -detail -oh $ORACLE_HOME

 

 

 

  

Step 5:- Download and Unzip the Oct 18 PSU Rolling Patch

 

 

 

 

 

 

 

Step 6:- Check Patch Conflict Detection and Resolution 

For GRID HOME,

When using OPatch 12.2.0.1.5 or later, the following Opatch Option -ocmrf <ocm response file> does not need to be provided.

Now our current OPatch version for GRID and ORACLE_HOME  is 12.2.0.1.16.

As root user,

/u01/app/12.1.0.2/grid/OPatch/opatchauto apply /mnt/hgfs/E/roll_patch/28349311 -analyze -oh /u01/app/12.1.0.2/grid

 

 

 

For ORACLE HOME,

 

 

 

 

Step 7:- Apply the patch using Opatchauto

OPatchauto automatically patch the typical Grid Infrastructure (GI) and RAC home directories with minimal intervention.

In general, when we invoke opatchauto will patch both the GI stack and the database software stack. Since we have mentioned the -oh it will apply the PSU to the specified home.

The main advantage of opatchauto utility was automatically down the CRS and database services and restart the services after apply patching.

To apply a patch using opatchauto,we need to run as a root user.

To patch the GI home and all Oracle RAC database homes of the same version:

# opatchauto apply /u01/28349311

Here,we are going to apply a patch separately for both GRID and ORACLE_HOME in both nodes.

opatchauto for GRID HOME on Node1 :-

/u01/app/12.1.0.2/grid/OPatch/opatchauto apply /mnt/hgfs/E/roll_patch/28349311 -oh /u01/app/12.1.0.2/grid

 

 

 

 

 

 

 

opatchauto for ORACLE_HOME on Node 1 :-

/u01/app/oracle/product/12.1.0.2/db_1/OPatch/opatchauto apply /mnt/hgfs/E/roll_patch/27468957 -oh/u01/app/oracle/product/12.1.0.2/db_1

 引用:

https://oracledbwr.com/step-by-step-apply-rolling-psu-patch-in-oracle-database-12c-rac-environment/

posted @ 2021-06-25 15:29  雪竹子  阅读(997)  评论(0编辑  收藏  举报