Applying Oracle Interim Patches using opatch

When we need to apply a Oracle Interim Patchs for a specific bug fix, we can use opatch command line interface.

When we are applying the patch to a standalone database, we can use following command

$ /u01/app/oracle/product/10.2.0/OPatch/6145177> opatch apply

— This will apply patch # 6145177 to current $ORACLE_HOME

To apply a buldle of patches, we can use following

$ /u01/app/oracle/product/10.2.0/OPatch/ 7409356> opatch napply -skip_subset -skip_duplicate

— This will apply the patch bundle to current $ORACLE_HOME

Is their any difference applying the patches to RAC environment?
There are some considerations while applying or rolling back the patch to RAC database. We can specify an additional option to apply a patch only to local node. By default, it will for all the nodes in the cluster.

For example, if we do not specify -local option while applying or rolling back the patch, it will work as following

It will first apply / rollback the patch to local node, then it will ask for the confirmation to apply it on remaining nodes. It will also prompt to enter the name of the node, to be patched next

/u01/app/oracle/product/10.2.0/OPatch/6145177> opatch rollback -id 6145177
Invoking OPatch 10.2.0.4.3
++++++++ PATCH ROLLBACK FINISHED ON NODE3 ++++++++

Oracle Interim Patch Installer version 10.2.0.4.3
Copyright (c) 2007, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/10.2.0
Central Inventory : /u01/app/oracle/oraInventory
from : /var/opt/oracle/oraInst.loc
OPatch version : 10.2.0.4.3
OUI version : 10.2.0.4.0
OUI location : /u01/app/oracle/product/10.2.0/oui
Log file location : /u01/app/oracle/product/10.2.0/cfgtoollogs/opatch/opatch2008-09-21_23-00-00PM.log

RollbackSession rolling back interim patch ‘6145177’ from OH ‘/u01/app/oracle/product/10.2.0’

Running prerequisite checks…

OPatch detected the node list and the local node from the inventory. OPatch will patch the local system then propagate the patch to the remote nodes.

This node is part of an Oracle Real Application Cluster.
Remote nodes: ‘node1’ ‘node2’
Local node: ‘node3’
Please shut down Oracle instances running out of this ORACLE_HOME on all the nodes.
(Oracle Home = ‘/u01/app/oracle/product/10.2.0’)

Are all the nodes ready for patching? [yn]
y
User Responded with: Y
Backing up files affected by the patch ‘6145177’ for restore. This might take a while…

Patching component oracle.rdbms, 10.2.0.4.0…
Updating archive file “/u01/app/oracle/product/10.2.0/lib/libserver10.a” with “lib/libserver10.a/ktc.o”
Updating archive file “/u01/app/oracle/product/10.2.0/lib/libserver10.a” with “lib/libserver10.a/ksq.o”
Updating archive file “/u01/app/oracle/product/10.2.0/lib/libserver10.a” with “lib/libserver10.a/ksu.o”
Running make for target ioracle
RollbackSession removing interim patch ‘6145177’ from inventory

Patching in rolling mode.

Remaining nodes to be patched:
‘node1’ ‘node2’
What is the next node to be patched?
node2
You have selected ‘node2’ from ‘node1’ ‘node2’
++++++++ PATCH ROLLBACK FINISHED ON NODE2 ++++++++

The node ‘node2’ will be patched next.

Please shutdown Oracle instances running out of this ORACLE_HOME on ‘node2’.
(Oracle Home = ‘/u01/app/oracle/product/10.2.0’)

Is the node ready for patching? [yn]
y
User Responded with: Y
Updating nodes ‘node2’
Rollback-related files are:
FR = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remove_files.txt”
DR = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remove_dirs.txt”
FP = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/copy_files.txt”
MP = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/make_cmds.txt”
RC = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remote_cmds.txt”

Instantiating the file “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remove_dirs.txt.instantiated” by replacing $ORACLE_HOME in “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remove_dirs.txt” with actual path.
Removing directories on remote nodes…
Instantiating the file “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/copy_files.txt.instantiated” by replacing $ORACLE_HOME in “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/copy_files.txt” with actual path.
Propagating files to remote nodes…
Instantiating the file “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/copy_dirs.txt.instantiated” by replacing $ORACLE_HOME in “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/copy_dirs.txt” with actual path.
Propagating directories to remote nodes…
Instantiating the file “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/make_cmds.txt.instantiated” by replacing $ORACLE_HOME in “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/make_cmds.txt” with actual path.
Running command on remote node ‘node2’:
cd /u01/app/oracle/product/10.2.0/rdbms/lib; /usr/ccs/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/10.2.0 echo REMOTE_MAKE_FAILED::>&2

The node ‘node2’ has been patched. You can restart Oracle instances on it.

The node ‘node1’ will be patched next.++++++++ PATCH ROLLBACK FINISHED ON LAST NODE ++++++++
If we do not want to apply the patch on all nodes at a time & test on a specific node first, command line should be

Please shutdown Oracle instances running out of this ORACLE_HOME on ‘node1’.
(Oracle Home = ‘/u01/app/oracle/product/10.2.0’)

Is the node ready for patching? [yn]
y
User Responded with: Y
Updating nodes ‘node1’
Rollback-related files are:
FR = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remove_files.txt”
DR = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remove_dirs.txt”
FP = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/copy_files.txt”
MP = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/make_cmds.txt”
RC = “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/remote_cmds.txt”

Removing directories on remote nodes…
Propagating files to remote nodes…
Propagating directories to remote nodes…
Instantiating the file “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/make_cmds.txt.instantiated” by replacing $ORACLE_HOME in “/u01/app/oracle/product/10.2.0/.patch_storage/6145177_May_30_2008_11_56_34/rac/make_cmds.txt” with actual path.
Running command on remote node ‘node1’:
cd /u01/app/oracle/product/10.2.0/rdbms/lib; /usr/ccs/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/10.2.0 echo REMOTE_MAKE_FAILED::>&2

The node ‘node1’ has been patched. You can restart Oracle instances on it.

There were relinks on remote nodes. Remember to check the binary size and timestamp on the nodes ‘node1’ ‘node2’ .
The following make commands were invoked on remote nodes:
‘cd /u01/app/oracle/product/10.2.0/rdbms/lib; /usr/ccs/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/10.2.0

OPatch succeeded.

/u01/app/oracle/product/10.2.0/OPatch/6145177> opatch rollback -id 6145177 -local

Advertisements
This entry was posted in Oracle One-Off Patch and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s