Patching oracle RAC Using opatch

Oracle Database

patching a system most often meant downtime. But now, opatch supports rolling upgrades of the cluster, which minimizes the interruption to service availability. Before trying to apply any patch, it is important to verify that the Oracle Inventory containing the metadata about all nodes in the cluster and their patch levels is not corrupt. The global inventory is maintained during all patch operations and lists the available Oracle Homes on a RAC cluster, as well as the patches applied. You run the opatch utility with the lsinventory option to verify that the inventory is not corrupted, as in the following example:

[grid@london1 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory

Invoking OPatch 11.2.0.1.2

Oracle Interim Patch Installer version 11.2.0.1.2

Copyright (c) 2010, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/grid/product/11.2.0/crs

Central Inventory : /u01/app/oraInventory

from : /etc/oraInst.loc

OPatch version : 11.2.0.1.2

OUI version : 11.2.0.1.0

OUI location : /u01/app/grid/product/11.2.0/crs/oui

Log file location : /u01/app/.../opatch/opatch2010-06-14_16-00-57PM.log

Patch history file: /u01/app/.../opatch/opatch_history.txt

Lsinventory Output file location : /u01/app/...opatch/lsinv/lsinventory2010-06-14_16-00-57PM.txt

----------------------------------------------------------------------------

Installed Top-level Products (1):

Oracle Grid Infrastructure 11.2.0.1.0

There are 1 products installed in this Oracle Home.

Interim patches (2) :

Patch 9343627 : applied on Fri Apr 30 13:11:32 BST 2010

Unique Patch ID: 12381846

Created on 15 Apr 2010, 11:28:38 hrs PST8PDT

Bugs fixed:

9343627, 9262748, 9262722

Patch 9352237 : applied on Fri Apr 30 13:06:29 BST 2010

Unique Patch ID: 12381846

Created on 25 Mar 2010, 00:05:17 hrs PST8PDT

Bugs fixed:

8661168, 8769239, 8898852, 8801119, 9054253, 8706590, 8725286, 8974548

8778277, 8780372, 8769569, 9027691, 9454036, 9454037, 9454038, 8761974

7705591, 8496830, 8702892, 8639114, 8723477, 8729793, 8919682, 8818983

9001453, 8475069, 9328668, 8891929, 8798317, 8820324, 8733749, 8702535

8565708, 9036013, 8735201, 8684517, 8870559, 8773383, 8933870, 8812705

8405205, 8822365, 8813366, 8761260, 8790767, 8795418, 8913269, 8897784

8760714, 8717461, 8671349, 8775569, 8898589, 8861700, 8607693, 8642202

8780281, 9369797, 8780711, 8784929, 8834636, 9015983, 8891037, 8828328

8570322, 8832205, 8665189, 8717031, 8685253, 8718952, 8799099, 8633358

9032717, 9321701, 8588519, 8783738, 8796511, 8782971, 8756598, 9454385

8856497, 8703064, 9066116, 9007102, 8721315, 8818175, 8674263, 9352237

8753903, 8720447, 9057443, 8790561, 8733225, 9197917, 8928276, 8991997,

837736

Rac system comprising of multiple nodes

Local node = london1

Remote node = london2

Remote node = london3

Remote node = london4

-----------------------------------------------------------------------------

OPatch succeeded.

You can find the important lines here near the bottom of the output; the opatch utility discovered correctly that the system in question is a four-node RAC system. The utility also correctly detected that the command was run from the local node, london1. Do not proceed with a patch if the information reported by opatch is inaccurate because then opatch won’t be able to properly register the patch information in the global inventory.

Opatch Operation Modes

OPatch can operate in four different modes for Real Application Clusters:

• All node patch

• Rolling patch

• Minimum Downtime patch

• Local patch

All Node Patch Mode

Opatch treats the cluster exactly as a single instance and patches all nodes while the database is down in this mode. This patch mode has the heaviest impact on availability, and can only be applied during an agreed downtime window. Otherwise this patch mode is not really suitable for a RAC system.

Rolling Patch Mode

All nodes in the cluster are patched, but only one at a time to avoid downtime. Process-wise, the first node is brought down for patching. When patched, it’s started again. OPatch will ask you if you want to continue with the next node, and so on until all nodes are patched. There is no downtime because there is always at least one node up and servicing user requests.

Unfortunately not all patches are rolling patches. To find out if a patch is a rolling patch, you can use opatch’s query option, as in this example:

[grid@london1 PSU1]$ $ORACLE_HOME/OPatch/opatch query -is_rolling_patch 9343627/

Invoking OPatch 11.2.0.1.2

Oracle Interim Patch Installer version 11.2.0.1.2

Copyright (c) 2010, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/grid/product/11.2.0/crs

Central Inventory : /u01/app/oraInventory

from : /etc/oraInst.loc

OPatch version : 11.2.0.1.2

OUI version : 11.2.0.1.0

OUI location : /u01/app/grid/product/11.2.0/crs/oui

Log file location : /u01/.../opatch/opatch2010-06-14_16-41-58PM.log

Patch history file: /u01/.../cfgtoollogs/opatch/opatch_history.txt

---------------------------------------------------------------------------

Patch is a rolling patch: true

OPatch succeeded.

Minimum Downtime Patch Mode

Another patching mechanism is referred to as minimum downtime patching. With this patching strategy, you divide your cluster into two sets of nodes. When patching, the first set of nodes is shut down and patched. Once the patching is completed, the second set of nodes is shut down. Now the previously patched first set of nodes is started, followed by the patch application to the second set. Once the patch to the second set of nodes is completed, the second set of nodes is brought up again, resulting in a patched cluster.

Local Patch Mode

Finally, individual nodes in the cluster can be patched by specifying the -local flag with the opatch command. A strategy similar to the rolling patch can be employed with this approach. In the end, you should verify that the patch information is correctly recorded in the Oracle inventory of each node. Which patch you should use depends on the availability requirements and the preference of the user or the business. Minimum downtime patching and rolling patching are similar in the way they make the cluster partially unavailable. Some businesses have the luxury of a weekend downtime window, so they can use an all-node patch, which saves time and resources.

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.