Sei sulla pagina 1di 23

APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

HOW TO APPLY PSU PATCH IN DATAGUARD ENVIRONMENT

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

 Disable LOG SHIPPING from Primary to Standby database.


 Shutdown Standby database and its Services.
 Download and apply PSU patch on Standby database.
 Mount the Standby database and start Listener.
 Shutdown Primary database and its Services.
 Apply PSU Patch on Primary database.
 Start Primary database.
 Run post Installation Scripts (catbundle.sql) at Primary database.
 Put Standby database in MRM Managed Recovery Mode.
 Re-enable Log Shipping on Primary database and monitor Redo Apply Process.
 Verify The PSU Patch Application.

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.

Why we need to stop Log Shipping from Primary to Standby database?

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.

Why Data Guard Standby-First Patch Apply?

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.

You might find some more information from below link


Oracle Patch Assurance - Data Guard Standby-First Patch Apply (Doc ID 1265700.1)

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

DISASTER RECOVERY ENVIRONMENT

Primary Database  crms  UAT  192.168.222.133  Primary Database Server


Standby Database  crms  DEV  192.168.222.134  Standby Database Server

Primary Database Unique name  crms


Standby Database Unique name  stbycrms

# On Primary database

SYS> select name, db_unique_name, database_role FROM v$database;

NAME DB_UNIQUE_NAME DATABASE_ROLE


--------- ------------------ ---------------
CRMS crms PRIMARY

SYS> select LOG_ARCHIVED-LOG_APPLIED "LOG_GAP" from


(SELECT MAX(SEQUENCE#) LOG_ARCHIVED
FROM V$ARCHIVED_LOG WHERE DEST_ID=1 AND ARCHIVED='YES'),
(SELECT MAX(SEQUENCE#) LOG_APPLIED
FROM V$ARCHIVED_LOG WHERE DEST_ID=2 AND APPLIED='YES');

LOG_GAP
----------
0

SYS> select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
229

# On Standby database

SYS> select name, db_unique_name, database_role FROM v$database, v$instance;

NAME DB_UNIQUE_NAME DATABASE_ROLE


--------- ---------------- ----------------
CRMS stbycrms PHYSICAL STANDBY

SYS> select max(sequence#) from v$archived_log where applied='YES';

MAX(SEQUENCE#)
--------------
229

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

SET LOG_ARCHIVE_DEST_STATE_2=DEFER AT PRIMARY

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

SYS> alter system set log_archive_dest_state_2=defer scope=both;

System altered.

SYS> show parameter log_archive_dest_2;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
log_archive_dest_2 string service="stby_crmsdb", LGWR ASYNC
NOAFFIRM delay=0 optional
compression=disable max_failure=0
max_connections=1 reopen=300
db_unique_name="stbycrms"
net_timeout=30,
valid_for=(all_logfiles,primary_role)

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.

# Disable Log Shipping using DGMGRL

DGMGRL> edit database <primary_name> set state='TRANSPORT-OFF'

DGMGRL> edit database crms set state='TRANSPORT-OFF'


...

DGMGRL> show database verbose crms;

Database - crms

Role: PRIMARY
Intended state: TRANSPORT-OFF
Instance(s):
crms
..
...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

SHUTDOWN STANDBY DATABASE AND ITS SERVICES

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.

# Cancel the MRP at Standby database

SYS> alter database recover managed standby database cancel;

Database altered.

# Shutdown the Standby database

SYS> shutdown immediate;


ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

# Stop Listener

$ lsnrctl stop <listener_name>


...

$ ps –ef | grep pmon


oracle 5384 5325 0 21:15 pts/3 00:00:00 grep pmon

$ ps –ef | grep tns


oracle 5388 5325 0 21:20 pts/3 00:00:00 grep tns

CHECKING OPATCH DETAILS

$ 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.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

$ ./OPatch/opatch lsinventory
Oracle Interim Patch IRF nstaller version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1


Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.4.0
Log file location :
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-22-
43PM_1.log

Lsinventory Output file location :


/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2017-07-
25_21-22-43PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g 11.2.0.4.0


There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

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

OPatch succeeded.

NOTE: Make sure you backup $ORACLE_HOME and Oracle Inventory before making any modification.

DOWNLOAD PSU PATCHSET

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.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

UNZIP THE PATCH AT STANDBY

Once you unzip the file you will get a new directory named as 24732075

# Patch is copied /u01/patch/ directory

$ cd /u01/patch/

$ ls
p24732075_112040_LINUX.zip

$ unzip p24732075_112040_LINUX.zip
..
...
[Trimmed]

CHECK FOR ONE –OFF PATCH CONFLICTS

Check Patch conflicts by executing following command.


$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./ from the unzipped
Patch directory. You must follow the instructions given in the readme file to apply patch.

$ cd /u01/patch/24732075
$ opatch prereq CheckConflictAgainstOHWithDetail –ph ./ or

$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/patch/24732075

Oracle Interim Patch Installer version 11.2.0.3.4


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

PREREQ session

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1


Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.4.0
Log file location :
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-22-
08PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

APPLY THE PSU PATCH AT THE STANDBY SITE

$ $ORACLE_HOME/OPatch/opatch apply /u01/patch/24732075/

Oracle Interim Patch Installer version 11.2.0.3.4


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

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1


Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.4.0
Log file location :
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-25-
40PM_1.log

Verifying environment and performing prerequisite checks...


Prerequisite check "CheckMinimumOPatchVersion" failed.
The details are:

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.

UtilSession failed: Prerequisite check "CheckMinimumOPatchVersion" failed.


Log file location:
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-25-
40PM_1.log

OPatch failed with error code 73

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

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.

DOWNLOAD LATEST OPATCH

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.

1. Backup your existing OPatch by copying $ORACLE_HOME/OPatch to any location.


2. Copy the new unzipped the OPatch directory to $ORACLE_HOME

# UNZIP the downloaded file in Standby Server

$ cd /u01/patch/
$ unzip p6880880_112000_LINUX.zip
..
...

# Renaming existing OPatch

$ 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.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

CHECK FOR ONE-OFF PATCH CONFLICTS

$ cd /u01/patch/24732075

$ export PATH=/u01/app/oracle/product/11.2.0/dbhome_1/OPatch:$PATH

[oracle@CATALOG 24732075]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

Oracle Interim Patch Installer version 11.2.0.3.16


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

PREREQ session

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1


Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.16
OUI version : 11.2.0.4.0
Log file location :
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-27-
22AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

APPLY PSU PATCH AT STANDBY DATABASE

$ $ORACLE_HOME/OPatch/opatch apply /u01/patch/24732075/

Oracle Interim Patch Installer version 11.2.0.3.16


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

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1


Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.16
OUI version : 11.2.0.4.0
Log file location :
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-30-
58PM_1.log

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Verifying environment and performing prerequisite checks...

OPatch continues with these patches: 17478514 18031668 18522509 19121551 19769489

20299013 20760982 21352635 21948347 22502456 23054359 24006111 24732075

Do you want to proceed? [y|n]


y

User Responded with: Y


All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

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')

Is the local system ready for patching? [y|n]


y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.sdo, 11.2.0.4.0...

Patching component oracle.sysman.agent, 10.2.0.4.5...

Patching component oracle.xdk, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.sdo.locator, 11.2.0.4.0...

Patching component oracle.nlsrtl.rsf, 11.2.0.4.0...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Patching component oracle.xdk.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.rman, 11.2.0.4.0...

Applying sub-patch '18031668' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.ldap.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.crs, 11.2.0.4.0...

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.ldap.rsf.ic, 11.2.0.4.0...

Patching component oracle.rdbms.deconfig, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.rdbms.rman, 11.2.0.4.0...


Applying sub-patch '18522509' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.rdbms.rman, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.rdbms.deconfig, 11.2.0.4.0...


Applying sub-patch '19121551' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.sysman.console.db, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Patching component oracle.rdbms.rman, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.ordim.client, 11.2.0.4.0...

Patching component oracle.ordim.jai, 11.2.0.4.0...

Applying sub-patch '19769489' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

ApplySession: Optional component(s) [ oracle.sysman.agent, 11.2.0.4.0 ] not present in

the Oracle Home or a higher version is found.

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.ovm, 11.2.0.4.0...

Patching component oracle.xdk, 11.2.0.4.0...

Patching component oracle.rdbms.util, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.xdk.parser.java, 11.2.0.4.0...

Patching component oracle.oraolap, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.xdk.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.rman, 11.2.0.4.0...

Patching component oracle.rdbms.deconfig, 11.2.0.4.0...


Applying sub-patch '20299013' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms.dv, 11.2.0.4.0...

Patching component oracle.rdbms.oci, 11.2.0.4.0...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.sysman.agent, 10.2.0.4.5...

Patching component oracle.xdk, 11.2.0.4.0...

Patching component oracle.sysman.common, 10.2.0.4.5...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.xdk.parser.java, 11.2.0.4.0...

Patching component oracle.sysman.console.db, 11.2.0.4.0...

Patching component oracle.xdk.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.sysman.common.core, 10.2.0.4.5...

Patching component oracle.rdbms.rman, 11.2.0.4.0...

Patching component oracle.rdbms.deconfig, 11.2.0.4.0...


Applying sub-patch '20760982' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.console.db, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...


Applying sub-patch '21352635' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sysman.agent, 10.2.0.4.5...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.rman, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Applying sub-patch '21948347' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

ApplySession: Optional component(s) [ oracle.tfa, 11.2.0.4.0 ] not present in the

Oracle Home or a higher version is found.

Patching component oracle.sysman.agent, 10.2.0.4.5...

Patching component oracle.ovm, 11.2.0.4.0...

Patching component oracle.xdk, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.nlsrtl.rsf, 11.2.0.4.0...

Patching component oracle.xdk.parser.java, 11.2.0.4.0...

Patching component oracle.sysman.console.db, 11.2.0.4.0...

Patching component oracle.xdk.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.sysman.oms.core, 10.2.0.4.5...

Applying sub-patch '22502456' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

ApplySession: Optional component(s) [ oracle.tfa, 11.2.0.4.0 ] not present in the

Oracle Home or a higher version is found.

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.oraolap.dbscripts, 11.2.0.4.0...

Patching component oracle.rdbms.olap, 11.2.0.4.0...

Patching component oracle.oraolap, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.rdbms.rman, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Applying sub-patch '23054359' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms.dv, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Applying sub-patch '24006111' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.sqlplus.ic, 11.2.0.4.0...

Patching component oracle.sqlplus, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.dbscripts, 11.2.0.4.0...

Applying sub-patch '24732075' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.precomp.common, 11.2.0.4.0...

Patching component oracle.sysman.plugin.db.main.agent, 11.2.0.4.0...

Patching component oracle.sqlplus.ic, 11.2.0.4.0...

Patching component oracle.sqlplus, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.util, 11.2.0.4.0...

Patching component oracle.ordim.client, 11.2.0.4.0...

Patching component oracle.ordim.jai, 11.2.0.4.0...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Patching component oracle.ordim.server, 11.2.0.4.0...

Composite patch 24732075 successfully applied.

Log file location:

/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-30-

58PM_1.log

OPatch succeeded.

# Startup Listener

$ lsnrctl start listener


...

# Startup Standby database

SYS> startup mount;

ORACLE instance started.


..
...
Database mounted.

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.

$ $ORACLE_HOME/OPatch/opatch lsinventory | grep 24732075


Patch 24732075 : applied on Tue Jul 25 21:40:21 EST 2017
Patch description: "Database Patch Set Update : 11.2.0.4.170418 (24732075)"

SHUTDOWN PRIMARY DATABASE AND LISTENER

# Stop Listener

$ lsnrctl listener
...

# Shutdown Primary database

SYS> shut immediate;


Database closed.
Database dismounted.
ORACLE instance shut down.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

CHECKING CORRESPONDING DATABASE SERVICES

$ ps –ef | grep pmon


oracle 15137 11088 0 04:40 pts/2 00:00:00 grep pmon

$ ps –ef |grep tns


oracle 15139 11088 0 04:40 pts/2 00:00:00 grep tns

NOW APPLY PSU PATCH ON PRIMARY

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.

# Rename OLD OPatch utility

$ cd $ORACLE_HOME
$ mv OPatch OPatch_112034_bkp

# UNZIP the file to get latest OPatch utility

$ cd /u01/patch/
$ unzip p6880880_112000_LINUX.zip
..
...

# Move the latest OPatch utility to $ORACLE_HOME

$ mv OPatch $ORACLE_HOME/OPatch
$ cd $ORACLE_HOME
$ ls OPatch
...

# UNZIP PSU Patch file in Primary Server

$ 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.

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

CHECK FOR ONE-OFF PATCH CONFLICTS

[oracle@CATALOG 24732075]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./


Oracle Interim Patch Installer version 11.2.0.3.16
Copyright (c) 2017, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1


Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.16
OUI version : 11.2.0.4.0
Log file location :
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-42-
33PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

APPLY PSU PATCH AT PRIMARY

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!

$ $ORACLE_HOME/OPatch/opatch apply /u01/patch/24732075/

Oracle Interim Patch Installer version 11.2.0.3.16


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

Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1


Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.16
OUI version : 11.2.0.4.0
Log file location :
/u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-07-25_21-44-
19PM_1.log

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

Verifying environment and performing prerequisite checks...


...
OPatch continues with these patches: 17478514 18031668 18522509 19121551 19769489
20299013 2076098
21352635 21948347 22502456 23054359 24006111 24732075

Do you want to proceed? [y|n]


y

User Responded with: Y


All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

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')

Is the local system ready for patching? [y|n]


Y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms, 11.2.0.4.0...

Patching component oracle.rdbms.rsf, 11.2.0.4.0...

Patching component oracle.sdo, 11.2.0.4.0...

Patching component oracle.sysman.agent, 10.2.0.4.5...

Patching component oracle.xdk, 11.2.0.4.0...

..
...
[Trimmed]

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

START PRIMARY DATABASE AND CORRESPONDING SERVICES

# STARTUP PRIMARY DATABASE

$. oraenv
ORACLE_SID = [oracle] ? crms
The Oracle base remains unchanged with value /u01/app/oracle

$ sqlplus sys/crms@CRMSDB as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sat Jul 25 21:52:52 2017

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Connected to an idle instance.

SYS> startup;
ORACLE instance started.

Total System Global Area 996003840 bytes


Fixed Size 1368912 bytes
Variable Size 587205808 bytes
Database Buffers 402653184 bytes
Redo Buffers 4775936 bytes
Database mounted.
Database opened.

# Starting Listener on Primary

$ lsnrctl start
...

# Re enable Log Shipping On Primary

SYS> alter system set log_archive_dest_state_2 = enable scope=both;

System altered.

# Connect Standby database and start MRP

SYS> select status from v$instance;

STATUS
------------
MOUNTED

SYS> alter database recover managed standby database using current logfile disconnect;
...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

RUN THE CATBUNDLE.SQL FROM PRIMARY DATABASE

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> @?/rdbms/admin/catbundle.sql psu apply;


..
...
[Trimmed]

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

SYS> select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
234

# On Standby database

SYS> select max(sequence#) from v$archived_log where applied='YES';

MAX(SEQUENCE#)
--------------
234

CHECK PATCH REGISTRY ON PRIMARY DATABASE

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

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.

GREP ON THE PATCH DESCRIPTION

$ $ORACLE_HOME/OPatch/opatch lsinventory | grep 24732075


Patch 24732075 : applied on Tue Jul 25 17:25:21 EST 2017
Patch description: "Database Patch Set Update : 11.2.0.4.170418 (24732075)"

$ $ORACLE_HOME/OPatch/opatch lsinventory -local | grep "Database Patch Set Update"


Patch description: "Database Patch Set Update : 11.2.0.4.170418 (24732075)"
Sub-patch 24006111; "Database Patch Set Update : 11.2.0.4.161018 (24006111)"
Sub-patch 23054359; "Database Patch Set Update : 11.2.0.4.160719 (23054359)"
Sub-patch 22502456; "Database Patch Set Update : 11.2.0.4.160419 (22502456)"
Sub-patch 21948347; "Database Patch Set Update : 11.2.0.4.160119 (21948347)"
Sub-patch 21352635; "Databa Patch Set Update : 11.2.0.4.8 (21352635)"
Sub-patch 20760982; "Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch 20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch 19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch 19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch 18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch 18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"

LIST OF INSTALLED PATCHES

$ $ORACLE_HOME/OPatch/opatch lsinventory
...

A MORE VERBOSE LIST ON THE INSTALLED PATCHES

$ $ORACLE_HOME/OPatch/opatch lsinventory –details


...

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu


APPLYING PSU PATCH IN A DATAGUARD CONFIGURATION | PHYSICAL STANDBY

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

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information

DGMGRL> connect sys/crms@CRMSDB


Connected.

DGMGRL> edit database <primary_name> set state='ONLINE';


DGMGRL> edit database crms set state='ONLINE';
...

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)

Exploring the Oracle DBA Technology by Gunasekaran , Thiyagu

Potrebbero piacerti anche