Document 278641.1
Document 278641.1
1
Copyright (c) 2023, Oracle. All rights reserved. Oracle Confidential.
How do you apply a Patchset,PSU or CPU in a Data Guard Physical Standby configuration (Doc
ID 278641.1)
In this Document
Goal
To apply an Interim Patchset for example the 10.2.0.4 Patchset or January 2010 10.2.0.4 RDBMS PSU, to both the
Primary and Standby Sites.
Solution
OVERALL STEPS
The Interim Patchset application in detail - in this case 10.2.0.4 PSU 3 or Patch 9119284
References
APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.1.0.2 to 19.6.0.0.0 [Release 10.1 to 19]
Oracle Database Cloud Schema Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.
GOAL
******* ********
Would you like to explore this Topic further with other Oracle Customers, Oracle Employees and
Industry Experts ??
You can discuss this Note, show your Experiences or ask Questions about it directly right at the Bottom of this Note in
the Discussion Thread about this Document.
If you want to discover Discussions about other Articles und Subjects or even post new Discussions you can access the
My Oracle Support Community Page for High Availability Data Guard
To apply an Interim Patchset for example the 10.2.0.4 Patchset or January 2010 10.2.0.4 RDBMS PSU, to both the
Primary and Standby Sites.
For Dg configuration with Logical Standby Refer, "Upgrading Oracle Database with a Logical Standby Database In Place
(Doc ID 437276.1)".
The process of applying the Patchset/PSU/CPU to a Primary and Standby site are same, however post upgrade/patch
changes are not applied directly on standby due to the nature of Physical standby(mount/open read only).
SOLUTION
NOTE: In the images and/or the document content below, the user information and environment data
used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 1/12
9/5/23, 17:28 Document 278641.1
an Oracle database product or other training material. Any similarity to actual environments, actual
persons, living or dead, is purely coincidental and not intended in any manner.
For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:
Primary Database:
DB_NAME: plb_prm
Standby Database:
DB_UNIQUE_NAME: plb_std
*************
OVERALL STEPS
2. Shutdown the standby site and apply interim patchsets to the RDBMS binaries as per the README. This includes
Patchset/Patchset Update(PSU)/Critical Patch Update (CPU). Post upgrade changes must come via REDO
transport(catpatch.sql etc) against the standby rdbms itself. Start the standby site to mount only, do not restart managed
recovery.
3. Shutdown the primary site, apply the Patchset/PSU/CPU patch to the RDBMS binaries and patch the RDBMS itself using
the instructions in the README (run catpatch/catbundle/catcpu etc).
NOTE: The latest Patchsets for Oracle 11gR2 (11.2.0) require to be installed into a new ORACLE_HOME. So mind to reset
your Environment and copy corresponding Files (like SPFILE, Network Files,..) to the new ORACLE_HOME, too. Follow the
Database Upgrade Guide for further Details.
5. At the standby site start the MRP(managed recovery). RDBMS changes implemented in the Primary Site through
catpatch/catbundle/catcpu will also be applied to the standby.
NOTE: Step 5. should be done immediately after upgrading the Database Binaries on the Standby Database. It is to
ensure the Data Dictionary (CATPROC)-Version matches the Version of the Database Binaries. If this does not match (eg.
when you upgrade the Standby Database Binaries first and perform a Role Change on the Standby before you upgrade the
Primary) you may run into severe Problems. Having different Patchlevels in a Data Guard Physical Standby Database
Environment is not supported anyway, see
Mixed Oracle Version support with Data Guard Redo Transport Services (Doc ID 785347.1)
for further Details and Reference.
6. Checks to perform to ensure the patch has been applied successfully at the primary and standby sites.
The Interim Patchset application in detail - in this case 10.2.0.4 PSU 3 or Patch 9119284
NOTE: If you are using Oracle Restart (starting from 11.2.0.x) you have to use the SRVCTL-Commands like shown for RAC
Databases to stop/start the Database and Services.
DGMGRL> connect /
Connected.
DGMGRL> show database verbose plb_prm
Database
Name: plb_prm
Role: PRIMARY
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 2/12
9/5/23, 17:28 Document 278641.1
Enabled: YES
Intended State: ONLINE
Instance(s):
plb
Properties:
InitialConnectIdentifier = 'plb_prm_dgmgrl'
..
.
Current status for "plb_prm":
SUCCESS
Disable the log_archive_destination used to ship archives from the primary to the standby site using sqlplus.
From 11.2 onwards by default SID=* to disable REDO transport in all the nodes. But in 10G explicitly mention SID=*
2.1 If the standby is a RAC environment, then the patch application would occur across all nodes.
Shutdown ALL processes running from Standby ORACLE_HOME. This will include all listeners, database instances, ASM
instances etc running from the home to patched.
$ sqlplus / as sysdba
2.1.2 RAC Environment, all the RAC services that are running from the ORACLE_HOME to be patched.
In this case the RAC database is called plb and the listener name for the listener running from the ORACLE_HOME to
patched is lsnrplb.
2.2 The release of OPatch that is supplied with 10.2.0.4 will not be able to apply a PSU as seen through the errors below.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 3/12
9/5/23, 17:28 Document 278641.1
$ pwd
/home/oracle/patches/9119284
$ which opatch
/<path>/db_plb/OPatch/opatch
$ opatch apply
2.2.1 To overcome the patch issue apply the latest copy of OPatch to the home via Patch 6880880.
If you already have a later release of OPatch then it is not necessary to perform this step.
Download Patch 6880880 and following the install instructions in the README
$ mv /u01/oracle/product/10.2.0/db_plb/OPatch /u01/oracle/product/10.2.0/db_plb/OPatch_10204
$ pwd
/home/oracle/patches
$ ls
9119284 OPatch
2.3 Once the new release of OPatch is in place apply the patch to the Standby Site
Please Note: In the Standby Site only the patching of the binaries is performed, there is no need to run the
catupgrade/catcpu/catbundle.sql script as this will be performed through redo apply at the Standby Site.
The example below is applying the patch to a Single Instance Standby Site and its applying PSU Patch 9119284.
$ opatch apply
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 4/12
9/5/23, 17:28 Document 278641.1
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system
only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/oracle/product/10.2.0/db_plb')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9119284' for restore. This might take a while...
Backing up files affected by the patch '9119284' for rollback. This might take a while...
Execution of 'sh /home/oracle/patches/9119284/custom/scripts/pre -apply 9119284 ':
Return Code = 0
Patching component oracle.rdbms.rsf, 10.2.0.4.0...
Updating archive file "/u01/oracle/product/10.2.0/db_plb/lib/libgeneric10.a" with
"lib/libgeneric10.a/qcodfdef.o"
..
.
Updating jar file "/u01/oracle/product/10.2.0/db_plb/rdbms/jlib/qsma.jar" with
"/rdbms/jlib/qsma.jar/oracle/qsma/QsmaFileManager.class"
Copying file to "/u01/oracle/product/10.2.0/db_plb/rdbms/lib/env_rdbms.mk"
..
.
Running make for target idgmgrl
Running make for target ioracle
Running make for target client_sharedlib
Running make for target itnslsnr
Running make for target iwrap
Running make for target genplusso
ApplySession adding interim patch '9119284' to inventory
********************************************************************************
********************************************************************************
** ATTENTION **
** **
** Please note that the Patch Set Update Installation (PSU Deinstallation) **
** is not complete until all the Post Installation (Post Deinstallation) **
** instructions noted in the Readme accompanying this PSU, have been **
** successfully completed. **
** **
********************************************************************************
********************************************************************************
--------------------------------------------------------------------------------
Return Code = 0
The local system has been patched and can be restarted.
OPatch succeeded.
2.4 Start the Standby Site database to mount and restart the listener(s).
$ sqlplus / as sysdba
If DG Broker in place, then change the state=APPLY-OFF via DG broker to avoid DG broker starting the MRP automatically.
Please Note: the primary site may also require that Opatch be upgraded in the same way as it was in the Standby Site via
Patch 6880880.
Change to the patch directory at the Primary Site and apply the PSU here
$ cd 9119284/
$ pwd
/home/oracle/patches/9119284
3.1 Stop all processes running from the home being patched.
$ sqlplus / as sysdba
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
As per the standby site this example is applying Patchset Update 9119284 to a single instance Primary Site.
$ opatch apply
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system
only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/oracle/product/10.2.0/db_plb')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9119284' for restore. This might take a while...
Backing up files affected by the patch '9119284' for rollback. This might take a while...
Execution of 'sh /home/oracle/patches/9119284/custom/scripts/pre -apply 9119284 ':
Return Code = 0
Patching component oracle.rdbms.rsf, 10.2.0.4.0...
Updating archive file "/u01/oracle/product/10.2.0/db_plb/lib/libgeneric10.a" with
"lib/libgeneric10.a/qcodfdef.o"
..
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 7/12
9/5/23, 17:28 Document 278641.1
.
Updating jar file "/u01/oracle/product/10.2.0/db_plb/rdbms/jlib/qsma.jar" with
"/rdbms/jlib/qsma.jar/oracle/qsma/QsmaFileManager.class"
..
.
Running make for target client_sharedlib
Running make for target idgmgrl
Running make for target ioracle
Running make for target client_sharedlib
Running make for target itnslsnr
Running make for target iwrap
Running make for target genplusso
ApplySession adding interim patch '9119284' to inventory
Verifying the update...
Inventory check OK: Patch ID 9119284 is registered in Oracle Home inventory with proper meta-
data.
Files check OK: Files from Patch ID 9119284 are present in Oracle Home.
--------------------------------------------------------------------------------
********************************************************************************
********************************************************************************
** ATTENTION **
** **
** Please note that the Patch Set Update Installation (PSU Deinstallation) **
** is not complete until all the Post Installation (Post Deinstallation) **
** instructions noted in the Readme accompanying this PSU, have been **
** successfully completed. **
** **
********************************************************************************
********************************************************************************
--------------------------------------------------------------------------------
OPatch succeeded.
In a RAC environment this is performed from once instance only with the remaining cluster instances down and not
running. The example below once again shows patch application to a single instance (non-RAC) Primary Site and is
applying PSU 9119284.
Change to the $ORACLE_HOME/rdbms/admin directory where the patch has been applied and perform the following.
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus / as sysdba
SQL> startup restrict ===========> Follow the README to know the mode that the database has
to be opened.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 8/12
9/5/23, 17:28 Document 278641.1
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/catbundle/catbundle_PSU_PLB_APPLY_2010Feb04_09_25_2
SQL>@catupgrade
SQL>@catcpu
4.1.1 In a Single Instance Primary restart processes running from the patched ORACLE_HOME.
This will include the listener, database instances, ASM instance and any other processes that were previously running from
this ORACLE_HOME.
4.1.2 If this were a RAC environment restart the listeners on each node running from the ORACLE_HOME being patched
using srvctl.
4.1.3. Force the Primary to register its services with the listener.
$ sqlplus / as sysdba
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 9/12
9/5/23, 17:28 Document 278641.1
System altered.
4.2.1 In a single instance (non-RAC) disable restricted session to allow end user connectivity.
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
4.2.2 In a RAC Primary Site restart the primary site and all its instances
If there are additional RAC services used to connect to this database these will need to be restarted using srvctl
This will allow the RDBMS changes made through running catupgrade/catbundle/catcpu can be applied to the standby.
$ dgmgrl
DGMGRL> connect /
Connected.
4.3.2 If you are using sqlplus re-enable the archive destination used to ship archives from the Primary Site to the Standby
Site
Where X is the number of the destination used for shipping redo to the standby site.
5. The Primary will then resume shipping and media recovery will continue at the Standby site and apply
the changes made through the patch application at the Primary Site.
From the alert log at the Standby you will see logs generated during the running of the cat scripts shipped and applied to
the standby:
6. To check the patch has been applied successfully at the primary and standby sites perform.
Please Note: Currently (10.2.0.4 PSU's) do not update the header information for tools like sqlplus nor the versioning
information for the database. These will remain at 10.2.0.4.0 and NOT updated to 10.2.0.4.3 for example after the
application of the PSU. You will only be able to see the PSU's application through the inventory or looking at the version
$ opatch lsinventory
OPatch succeeded.
Community Discussion
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 11/12
9/5/23, 17:28 Document 278641.1
Still have questions? Consider posting a discussion in the High Availability Data Guard, Sharding and Global Data Services
(MOSC) Community
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=180jd8df56_4&id=278641.1 12/12