Professional Documents
Culture Documents
In this article, I am demonstrating Step by Step to apply a PSU (Patch Set Update) in a
Data Guard environment. Here I wish to apply the latest PSU 11.2.0.4.170418 which released
recently (APR 2017).
CONSIDERATIONS
POINTS TO NOTE
Once you have broker setup there are some steps which we need to manage with Broker instead
of SQL. Which is highly recommended, if you start mixing SQL*Plus and BROKER commands you
risk having "INCONSISTENT PROPERTIES" and Data Guard issues in Broker configuration.
In Data Guard environment, Stop Log Shipping at Primary before the activity.
First apply the PSU patch on the Standby and then Primary.
If you are going to Shutdown the Standby database to apply the patch, Suppose you are
ignoring to set DEFER log shipping at Primary, you will get lot of errors in the log as
the Standby database is not available.
Moreover the Standby database will NOT be available during the patching to apply the logs
anyway. If there are any oracle related processes running in background and opatch utility
will throw error.
This is to minimize impact on the Primary database, once you apply patch on the Standby
database you will be sure that there are no conflicts and underlying issues by doing so.
# On Primary database
LOG_GAP
----------
0
MAX(SEQUENCE#)
--------------
229
# On Standby database
MAX(SEQUENCE#)
--------------
229
We need to disable the Log Shipping from Primary database to the Standby database by setting
the log_archive_dest_state_2 to "defer" on the Primary database.
# On Primary database
System altered.
POINTS TO NOTE
If Data Guard Broker in place it is mandatory to disable log shipping via DG broker utility.
If DG Broker not in place disable the log_archive_destination used to ship archives from
the Primary to the Standby site using SQL*Plus utility. I am NOT using broker configuration.
Database - crms
Role: PRIMARY
Intended state: TRANSPORT-OFF
Instance(s):
crms
..
...
As I said above, In order to apply PSU Patch on the standby database, Shutdown the Standby
database and also its services. It is recommended to Shutdown all Instances and listeners
associated with the $ORACLE_HOME that you are updating.
Database altered.
Database dismounted.
ORACLE instance shut down.
# Stop Listener
$ Which opatch
/usr/bin/which: no opatch in
(/home/oracle/goldengate:/u01/app/oracle/product/11.2.0/dbhome_1/bin:/usr/kerberos/bin
:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/bin:/usr/bin)
$ export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/OPatch:$PATH
$ Which opatch
/u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch
$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
$ ./OPatch/opatch lsinventory
Oracle Interim Patch IRF nstaller version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.
--------------------------------------------------------------------------------
Installed Top-level Products (1):
--------------------------------------------------------------------------------
OPatch succeeded.
NOTE: Make sure you backup $ORACLE_HOME and Oracle Inventory before making any modification.
Download the PSU and then copy it to the Standby Server and unzip it.
Here I consider to apply latest PSU 11.2.0.4.170718 which released recently.
Once you unzip the file you will get a new directory named as 24732075
$ cd /u01/patch/
$ ls
p24732075_112040_LINUX.zip
$ unzip p24732075_112040_LINUX.zip
..
...
[Trimmed]
$ cd /u01/patch/24732075
$ opatch prereq CheckConflictAgainstOHWithDetail –ph ./ or
PREREQ session
OPatch succeeded.
The OPatch being used has version 11.2.0.3.4 while the following patch(es) require
higher versions:
Patch 17478514 requires OPatch version 11.2.0.3.5.
Patch 18031668 requires OPatch version 11.2.0.3.5.
Patch 18522509 requires OPatch version 11.2.0.3.5.
Patch 19121551 requires OPatch version 11.2.0.3.5.
Patch 19769489 requires OPatch version 11.2.0.3.5.
Patch 20299013 requires OPatch version 11.2.0.3.5.
Patch 20760982 requires OPatch version 11.2.0.3.5.
Patch 21352635 requires OPatch version 11.2.0.3.5.
Patch 21948347 requires OPatch version 11.2.0.3.5.
Patch 22502456 requires OPatch version 11.2.0.3.5.
Patch 23054359 requires OPatch version 11.2.0.3.5.
Patch 24006111 requires OPatch version 11.2.0.3.5.
Patch 24732075 requires OPatch version 11.2.0.3.5.
Please download latest OPatch from My Oracle Support.
POINTS TO NOTE
We need to download latest OPatch and replace the existing one $ORACLE_HOME/OPatch/opatch
version. We must use the OPatch utility version 11.2.0.3.6 or later to apply this patch.
Opatch number is always 6880880. You go to this page and get the latest
opatch: https://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=6880880
After downloading OPatch, place it on the database Server and unzip it then you will get
latest OPatch utility. I copied the file under /u01/patch/ directory.
$ cd /u01/patch/
$ unzip p6880880_112000_LINUX.zip
..
...
$ cd $ORACLE_HOME/
$ mv OPatch OPatch_112034_bkp
$ cp -r /u01/patch/OPatch/ .
$ ./OPatch/opatch version
OPatch Version: 11.2.0.3.16
OPatch succeeded.
$ cd /u01/patch/24732075
$ export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/OPatch:$PATH
PREREQ session
OPatch succeeded.
OPatch continues with these patches: 17478514 18031668 18522509 19121551 19769489
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0/dbhome_1')
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-30-
58PM_1.log
OPatch succeeded.
# Startup Listener
Here no need to run any patching scripts on the standby database (catbundle.sql). We are
done with the patching on the Standby database. Now let’s move to the Primary database.
# Stop Listener
$ lsnrctl listener
...
Here also we need to follow same procedure, move existing Opatch utility to some other
location or rename it. Anyhow we have to use latest Opatch (11.2.0.3.16) here.
$ cd $ORACLE_HOME
$ mv OPatch OPatch_112034_bkp
$ cd /u01/patch/
$ unzip p6880880_112000_LINUX.zip
..
...
$ mv OPatch $ORACLE_HOME/OPatch
$ cd $ORACLE_HOME
$ ls OPatch
...
$ cd /u01/patch
$ unzip p24732075_112040_LINUX.zip
..
...
$ export path=/u01/app/oracle/product/11.2.0/dbhome_1/OPatch:$PATH
$ $ORACL_HOME/OPatch opatch version
OPatch Version: 11.2.0.3.16
OPatch succeeded.
PREREQ session
OPatch succeeded.
Basically once you extract the p6880880 zip file then the next step running opatch apply
command is for actually applying the PSU that’s it!
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: Y
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11.2.0/dbhome_1')
..
...
[Trimmed]
$. oraenv
ORACLE_SID = [oracle] ? crms
The Oracle base remains unchanged with value /u01/app/oracle
SYS> startup;
ORACLE instance started.
$ lsnrctl start
...
System altered.
STATUS
------------
MOUNTED
SYS> alter database recover managed standby database using current logfile disconnect;
...
You need to execute this script only on Primary database. This Script will generate archives
all these archives will be carried and applied to the Standby databases.
SYS>COMMIT;
Commit complete.
SYS>SPOOL off
SYS>SET echo off
Check the following log file for errors:
/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_CRMS_APPLY_2017Jul25_21_57_42.log
# On Primary database
MAX(SEQUENCE#)
--------------
234
# On Standby database
MAX(SEQUENCE#)
--------------
234
We can verify Standby database too but it is possible to open read only mode. When we
check the Standby database version we see that applied patch to Standby database also.
$ $ORACLE_HOME/OPatch/opatch lsinventory
...
POINTS TO NOTE
If you are using a Data Guard Broker configuration, you need start Log Shipping using Data
Guard broker instead of SQL *Plus. In our case we did NOT configure Data Guard Broker.
$ dgmgrl
DGMGRL for Linux: Version 11.2.0.4.0 - Production
REF_DOCS
Oracle Patch Assurance - Data Guard Standby-First Patch Apply (Doc ID 1265700.1)
How do you apply a Patchset, PSU or CPU in a Data Guard Physical Standby configuration
(Doc ID 278641.1)