Applying PSU patch in an Oracle 12c Dataguard Environment

Oracle Community

Applying PSU patch in an Oracle 12c Dataguard Environment

This article speaks of applying a GI PSU (GI+DB)patch in a standby environment on oracle 12c setup. Oracle 12c makes use of a new utility "opatchauto" to apply the patches unlike the "opatch" used in prior 12c versions. In this demo, I'm applying 12.1.0.2.2 GI PSU in a dataguard environment.


Environment:

Primary server: ora1-1
Primary database: TARGETDB

Standby server: ora1-4
Standby database: TARSTDB

PDB name plugged into the primary and standby: TARGETPDB


As a pre-requisite, before proceeding, make sure that the standby is in sync with the primary database.


Primary Database Details:

SYS@targetdb> select status,instance_name,database_role,open_mode from v$database,v$Instance;

STATUS   INSTANCE_NAME   DATABASE_ROLE    OPEN_MODE
-------- --------------- ---------------- --------------------
OPEN     targetdb        PRIMARY          READ WRITE

SYS@targetdb> show pdbs

CON_ID    CON_NAME     OPEN MODE      RESTRICTED
--------- ------------ -------------- ------------ 
2         PDB$SEED     READ ONLY      NO
3         TARGETPDB    READ WRITE     NO

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

MAX(SEQUENCE#)
--------------
95

Standby Database Details:

SYS@tarstdb> select status,instance_name,database_role,open_mode from v$database,v$Instance;

STATUS   INSTANCE_NAME    DATABASE_ROLE    OPEN_MODE
-------- ---------------- ---------------- --------------------
MOUNTED  tarstdb          PHYSICAL STANDBY MOUNTED

 

SYS@tarstdb> show pdbs

CON_ID CON_NAME    OPEN MODE   RESTRICTED
------ ----------- ----------- -----------
2      PDB$SEED    MOUNTED
3      TARGETPDB   MOUNTED

 

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

MAX(SEQUENCE#)
--------------
95

 

From the above query result, it's clear that the standby is in sync with the primary. Now, defer the log shipping on the primary to the standby database.

SYS@targetdb> alter system set log_archive_dest_state_2=defer;

System altered.


Look out for the OPATCH utility version and ensure that the minimum version is 12.1.0.1.5


On the primary database server:

[oracle@ora1-1 ~]$ /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch version
OPatch Version: 12.1.0.1.10

OPatch succeeded.

[oracle@ora1-1 ~]$ /u01/app/oracle/product/12.1.0.2/db_1/OPatch/opatch version
OPatch Version: 12.1.0.1.10

OPatch succeeded.

On the standby database server:


[oracle@ora1-4 ~]$ /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch version
OPatch Version: 12.1.0.1.10

OPatch succeeded.

[oracle@ora1-4 ~]$ /u01/app/oracle/product/12.1.0.2/db_1/OPatch/opatch version
OPatch Version: 12.1.0.1.10

OPatch succeeded.


Check if any patch conflicts exist on both primary and the standby server.


Primary :


[root@ora1-1 OPatch]# pwd
/u01/app/oracle/product/12.1.0.2/grid/OPatch
[root@ora1-1 OPatch]# ./opatchauto apply /u03/121022_gi_psu/19954978 -analyze
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /u01/app/oracle/product/12.1.0.2/grid

opatchauto log file: /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/opatch_gi_2016-03-27_13-23-31_analyze.log

NOTE: opatchauto is running in ANALYZE mode. There will be no change to your system.


OCM RSP file has been ignored in analyze mode.

Parameter Validation: Successful

Configuration Validation: Successful

Patch Location: /u03/121022_gi_psu/19954978
Grid Infrastructure Patch(es): 19769473 19769479 19769480 19872484
DB Patch(es): 19769479 19769480

Patch Validation: Successful
Grid Infrastructure home:
/u01/app/oracle/product/12.1.0.2/grid
DB home(s):
/u01/app/oracle/product/12.1.0.2/db_1


Analyzing patch(es) on "/u01/app/oracle/product/12.1.0.2/db_1" ...
Patch "/u03/121022_gi_psu/19954978/19769479" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/db_1" for apply.
Patch "/u03/121022_gi_psu/19954978/19769480" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/db_1" for apply.

Analyzing patch(es) on "/u01/app/oracle/product/12.1.0.2/grid" ...
Patch "/u03/121022_gi_psu/19954978/19769473" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.
Patch "/u03/121022_gi_psu/19954978/19769479" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.
Patch "/u03/121022_gi_psu/19954978/19769480" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.
Patch "/u03/121022_gi_psu/19954978/19872484" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.


SQL changes, if any, are analyzed successfully on the following database(s): targetdb

Apply Summary:
Following patch(es) are successfully analyzed:
GI Home: /u01/app/oracle/product/12.1.0.2/grid: 19769473,19769479,19769480,19872484
DB Home: /u01/app/oracle/product/12.1.0.2/db_1: 19769479,19769480

opatchauto succeeded.
[root@ora1-1 OPatch]#

Standby:


[root@ora1-4 ~]# cd /u01/app/oracle/product/12.1.0.2/grid/OPatch/
[root@ora1-4 OPatch]# ./opatchauto apply /u03/121022_gi_psu/19954978 -analyze
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /u01/app/oracle/product/12.1.0.2/grid

opatchauto log file: /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/opatch_gi_2016-06-11_09-28-07_analyze.log

NOTE: opatchauto is running in ANALYZE mode. There will be no change to your system.


OCM RSP file has been ignored in analyze mode.

Parameter Validation: Successful

Configuration Validation: Successful

Patch Location: /u03/121022_gi_psu/19954978/
Grid Infrastructure Patch(es): 19769473 19769479 19769480 19872484
DB Patch(es): 19769479 19769480

Patch Validation: Successful
Grid Infrastructure home:
/u01/app/oracle/product/12.1.0.2/grid
DB home(s):
/u01/app/oracle/product/12.1.0.2/db_1


Analyzing patch(es) on "/u01/app/oracle/product/12.1.0.2/db_1" ...
Patch "/u03/121022_gi_psu/19954978/19769479" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/db_1" for apply.
Patch "/u03/121022_gi_psu/19954978/19769480" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/db_1" for apply.

Analyzing patch(es) on "/u01/app/oracle/product/12.1.0.2/grid" ...
Patch "/u03/121022_gi_psu/19954978/19769473" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.
Patch "/u03/121022_gi_psu/19954978/19769479" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.
Patch "/u03/121022_gi_psu/19954978/19769480" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.
Patch "/u03/121022_gi_psu/19954978/19872484" successfully analyzed on "/u01/app/oracle/product/12.1.0.2/grid" for apply.

[WARNING] SQL changes, if any, could not be analyzed on the following database(s): tarstdb...Please refer to the log file for more details.

Apply Summary:
Following patch(es) are successfully analyzed:
GI Home: /u01/app/oracle/product/12.1.0.2/grid: 19769473,19769479,19769480,19872484
DB Home: /u01/app/oracle/product/12.1.0.2/db_1: 19769479,19769480

opatchauto succeeded.
[root@ora1-4 OPatch]#


Generate the OCM configuration response file which will be prompted while running the opatch.


On the primary database server:


[oracle@ora1-1 ~]$ cd /u01/app/oracle/product/12.1.0.2/grid/OPatch/ocm/bin/
[oracle@ora1-1 bin]$ ./emocmrsp
OCM Installation Response Generator 10.3.7.0.0 - Production
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.

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 (Yeses, Noo) No: Y
The OCM configuration response file (ocm.rsp) was successfully created.
[oracle@ora1-1 bin]$



In my case, the response file is created at "/u01/app/oracle/product/12.1.0.2/grid/OPatch/ocm/bin/" location in the primary server.


Similarly, generate the OCM configuration response file on the standby server.
Here too the file is created at "/u01/app/oracle/product/12.1.0.2/grid/OPatch/ocm/bin/" location in the standby server.


[oracle@ora1-4 ~]$ cd /u01/app/oracle/product/12.1.0.2/grid/OPatch/ocm/bin/
[oracle@ora1-4 bin]$ ./emocmrsp
OCM Installation Response Generator 10.3.7.0.0 - Production
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.

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 (Yeses, Noo) No: Y
The OCM configuration response file (ocm.rsp) was successfully created.
[oracle@ora1-4 bin]$


Just deviating from the topic, I was very much interested to know what are all the steps that OPATCHAUTO actually does. With 12c, we have an option called "-generateSteps" to get the steps of what opatchauto does internally. Let me get it here:

====================================================================================================================================================


[root@ora1-1 ~]# cd /u01/app/oracle/product/12.1.0.2/grid/OPatch/
[root@ora1-1 OPatch]# ./opatchauto apply /u03/121022_gi_psu/19954978 -generateSteps -oh /u01/app/oracle/product/12.1.0.2/grid,/u01/app/oracle/product/12.1.0.2/db_1 -ocmrf /u02/ocm.rsp
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /u01/app/oracle/product/12.1.0.2/grid

Invoking opatchauto utility "generateapplysteps"

Steps log file: /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/opatch_gi_2016-03-27_14-31-07_deploy.steps.log
Steps have been generated in the above log.

opatchauto succeeded.
[root@ora1-1 OPatch]#


Viewing the contents of the above log:


[root@ora1-1 OPatch]# cat /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/opatch_gi_2016-03-27_14-31-07_deploy.steps.log
===============LIST of COMMANDS================


To apply the patch, Please do the following manual actions:

Step 1 As the "oracle" user on the host "ora1-1", please run the following commands:
Action 1.1 [oracle@ora1-1]$
/u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch version -oh /u01/app/oracle/product/12.1.0.2/grid -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -v2c 12.1.0.1.5

Step 2 As the "oracle" user on the host "ora1-1", please run the following commands:
Action 2.1 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch lsinventory -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Step 3 As the "oracle" user on the host "ora1-1", please run the following commands:
Action 3.1 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckComponents -ph /u03/121022_gi_psu/19954978/19769473 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Action 3.2 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckComponents -ph /u03/121022_gi_psu/19954978/19769479 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Action 3.3 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckComponents -ph /u03/121022_gi_psu/19954978/19769480 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Action 3.4 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckComponents -ph /u03/121022_gi_psu/19954978/19872484 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Step 4 As the "oracle" user on the host "ora1-1", please run the following commands:
Action 4.1 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /u03/121022_gi_psu/19954978/19769473 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Action 4.2 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /u03/121022_gi_psu/19954978/19769479 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Action 4.3 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /u03/121022_gi_psu/19954978/19769480 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Action 4.4 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckConflictAgainstOH -ph /u03/121022_gi_psu/19954978/19872484 -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core

Step 5 As the "oracle" user on the host "ora1-1", please run the following commands:
Action 5.1 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19769473 > /tmp/oracle_19954978_phBaseFile_patchList

Action 5.2 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19769479 >> /tmp/oracle_19954978_phBaseFile_patchList

Action 5.3 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19769480 >> /tmp/oracle_19954978_phBaseFile_patchList

Action 5.4 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19872484 >> /tmp/oracle_19954978_phBaseFile_patchList

Action 5.5 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/oracle_19954978_phBaseFile_patchList -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc

Step 6 As the "root" user on the host "ora1-1", please run the following commands:
Action 6.1 [root@ora1-1]#
/u01/app/oracle/product/12.1.0.2/grid/perl/bin/perl -I/u01/app/oracle/product/12.1.0.2/grid/perl/lib -I/u01/app/oracle/product/12.1.0.2/grid/OPatch/opatchautotemp_ora1-1/patchwork/crs/install /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatchautotemp_ora1-1/patchwork/crs/install/roothas.pl -prepatch

Step 7 As the "oracle" user on the host "ora1-1", please run the following commands:
Action 7.1 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19769473 > /tmp/OraGI12Home1_oracle_patchList

Action 7.2 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19769479 >> /tmp/OraGI12Home1_oracle_patchList

Action 7.3 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19769480 >> /tmp/OraGI12Home1_oracle_patchList

Action 7.4 [oracle@ora1-1]$
echo /u03/121022_gi_psu/19954978/19872484 >> /tmp/OraGI12Home1_oracle_patchList

Action 7.5 [oracle@ora1-1]$
/u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch napply -phBaseFile /tmp/OraGI12Home1_oracle_patchList -local -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -silent

Step 8 As the "root" user on the host "ora1-1", please run the following commands:
Action 8.1 [root@ora1-1]#
/u01/app/oracle/product/12.1.0.2/grid/rdbms/install/rootadd_rdbms.sh

Step 9 As the "root" user on the host "ora1-1", please run the following commands:
Action 9.1 [root@ora1-1]#
/u01/app/oracle/product/12.1.0.2/grid/perl/bin/perl -I/u01/app/oracle/product/12.1.0.2/grid/perl/lib -I/u01/app/oracle/product/12.1.0.2/grid/OPatch/opatchautotemp_ora1-1/patchwork/crs/install /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatchautotemp_ora1-1/patchwork/crs/install/roothas.pl -postpatch

Step 10 As the "oracle" user on the host "ora1-1", please run the following commands:
Action 10.1 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch lsinventory -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core | grep 19769473

Action 10.2 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch lsinventory -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core | grep 19769479

Action 10.3 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch lsinventory -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core | grep 19769480

Action 10.4 [oracle@ora1-1]$
mkdir -p /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core ; /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch lsinventory -invPtrLoc /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc -oh /u01/app/oracle/product/12.1.0.2/grid -customLogDir /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/core | grep 19872484


[root@ora1-1 OPatch]#

======================================================================================================================================================

Moving on, shutdown the standby database and apply the patch on the standby server.


SYS@tarstdb> shut immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.


[oracle@ora1-4 bin]$ /sbin/fuser /u01/app/oracle/product/12.1.0.2/db_1/bin/oracle
[oracle@ora1-4 bin]$


As ROOT user, apply the patch using "opatchauto" utility. If no Oracle home paths are specified using the "-oh" option, then the patch would be applied on both GI and DB home.

By default, OPATCHAUTO looks for the OCM response file (ocm.rsp) under the "$ORACLE_HOME/OPatch/ocm/bin" location (ORACLE_HOME here refers to the home from where OPATCHAUTO is called - in our case it's GI home). If the file ocm.rsp is located under this location, then there is no need for you to explicitly specify the location using "-ocmrf" option while executing the "opatchauto" command. If the file ocm.rsp exists in a non-default location, then specify its path using the "-ocmrf" while executing "opatchauto". In my case, the file existed under the default location and hence skipping the usage of "-ocmrf" option.

Patching Standby Database:

[root@ora1-4 ~]# cd /u03/121022_gi_psu/19954978/
[root@ora1-4 19954978]# /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatchauto apply /u03/121022_gi_psu/19954978
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /u01/app/oracle/product/12.1.0.2/grid

opatchauto log file: /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/opatch_gi_2016-04-02_12-26-07_deploy.log

Parameter Validation: Successful

Configuration Validation: Successful

Patch Location: /u03/121022_gi_psu/19954978
Grid Infrastructure Patch(es): 19769473 19769479 19769480 19872484
DB Patch(es): 19769479 19769480

Patch Validation: Successful
Grid Infrastructure home:
/u01/app/oracle/product/12.1.0.2/grid
DB home(s):
/u01/app/oracle/product/12.1.0.2/db_1


Performing prepatch operations on SIDB Home (/u01/app/oracle/product/12.1.0.2/db_1) ... Successful

Applying patch(es) to "/u01/app/oracle/product/12.1.0.2/db_1" ...
Patch "/u03/121022_gi_psu/19954978/19769479" successfully applied to "/u01/app/oracle/product/12.1.0.2/db_1".
Patch "/u03/121022_gi_psu/19954978/19769480" successfully applied to "/u01/app/oracle/product/12.1.0.2/db_1".

Performing prepatch operations on SIHA Home... Successful

Applying patch(es) to "/u01/app/oracle/product/12.1.0.2/grid" ...
Patch "/u03/121022_gi_psu/19954978/19769473" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".
Patch "/u03/121022_gi_psu/19954978/19769479" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".
Patch "/u03/121022_gi_psu/19954978/19769480" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".
Patch "/u03/121022_gi_psu/19954978/19872484" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".

Performing postpatch operations on SIHA Home... Successful

Performing postpatch operations on SIDB Home (/u01/app/oracle/product/12.1.0.2/db_1) ... Successful


Apply Summary:
Following patch(es) are successfully installed:
GI Home: /u01/app/oracle/product/12.1.0.2/grid: 19769473,19769479,19769480,19872484
DB Home: /u01/app/oracle/product/12.1.0.2/db_1: 19769479,19769480

opatchauto succeeded.
[root@ora1-4 19954978]#


Now we see that the GI and DB patches have been applied on the Grid and DB home on the standby server.

 

Patching Primary Database:

Moving on to the primary server, the patch is applied in the same way as on the standby using the OPATCHAUTO utility. Here too, the OCM.RSP file is placed under the default location $ORACLE_HOME/OPatch/ocm/bin (ORACLE_HOME here refers to the home from where OPATCHAUTO is called - in our case it's GI home).:

OPATCHAUTO automatically brings down the database before patching and starts it up after the patch is applied.


[root@ora1-1 ~]# cd /u03/121022_gi_psu/19954978

[root@ora1-1 19954978]#
[root@ora1-1 19954978]#
[root@ora1-1 19954978]# /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatchauto apply /u03/121022_gi_psu/19954978
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /u01/app/oracle/product/12.1.0.2/grid

opatchauto log file: /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatchauto/19954978/opatch_gi_2016-04-02_12-58-54_deploy.log

Parameter Validation: Successful

Configuration Validation: Successful

Patch Location: /u03/121022_gi_psu/19954978
Grid Infrastructure Patch(es): 19769473 19769479 19769480 19872484
DB Patch(es): 19769479 19769480

Patch Validation: Successful
Grid Infrastructure home:
/u01/app/oracle/product/12.1.0.2/grid
DB home(s):
/u01/app/oracle/product/12.1.0.2/db_1


Performing prepatch operations on SIDB Home (/u01/app/oracle/product/12.1.0.2/db_1) ... Successful

Applying patch(es) to "/u01/app/oracle/product/12.1.0.2/db_1" ...
Patch "/u03/121022_gi_psu/19954978/19769479" successfully applied to "/u01/app/oracle/product/12.1.0.2/db_1".
Patch "/u03/121022_gi_psu/19954978/19769480" successfully applied to "/u01/app/oracle/product/12.1.0.2/db_1".

Performing prepatch operations on SIHA Home... Successful

Applying patch(es) to "/u01/app/oracle/product/12.1.0.2/grid" ...
Patch "/u03/121022_gi_psu/19954978/19769473" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".
Patch "/u03/121022_gi_psu/19954978/19769479" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".
Patch "/u03/121022_gi_psu/19954978/19769480" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".
Patch "/u03/121022_gi_psu/19954978/19872484" successfully applied to "/u01/app/oracle/product/12.1.0.2/grid".

Performing postpatch operations on SIHA Home... Successful

Apply Summary:
Following patch(es) are successfully installed:
GI Home: /u01/app/oracle/product/12.1.0.2/grid: 19769473,19769479,19769480,19872484
DB Home: /u01/app/oracle/product/12.1.0.2/db_1: 19769479,19769480

opatchauto succeeded.

View the list of patches applied on the primary server:

Patches applied on the GI Home of Primary server:


[oracle@ora1-1 bin]$ cd /u01/app/oracle/product/12.1.0.2/grid/OPatch/
[oracle@ora1-1 OPatch]$ ./opatch lsinventory -oh /u01/app/oracle/product/12.1.0.2/grid
Oracle Interim Patch Installer version 12.1.0.1.10
Copyright (c) 2016, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/12.1.0.2/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc
OPatch version : 12.1.0.1.10
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatch/opatch2016-04-02_13-34-41PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatch/lsinv/lsinventory2016-04-02_13-34-41PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora1-1
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Grid Infrastructure 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.


Interim patches (4) :

Patch 19872484 : applied on Sat Apr 02 13:15:54 IST 2016
Unique Patch ID: 18291456
Patch description: "WLM Patch Set Update: 12.1.0.2.2 (19872484)"
Created on 2 Dec 2014, 23:18:41 hrs PST8PDT
Bugs fixed:
19016964, 19582630

Patch 19769480 : applied on Sat Apr 02 13:15:53 IST 2016
Unique Patch ID: 18350083
Patch description: "Database Patch Set Update : 12.1.0.2.2 (19769480)"
Created on 15 Dec 2014, 06:54:52 hrs PST8PDT
Bugs fixed:
20284155, 19157754, 18885870, 19303936, 19708632, 19371175, 18618122
19329654, 19075256, 19074147, 19044962, 19289642, 19068610, 18988834
19028800, 19561643, 19058490, 19390567, 18967382, 19174942, 19174521
19176223, 19501299, 19178851, 18948177, 18674047, 19723336, 19189525
19001390, 19176326, 19280225, 19143550, 18250893, 19180770, 19155797
19016730, 19185876, 18354830, 19067244, 18845653, 18849537, 18964978
19065556, 19440586, 19439759, 19024808, 18952989, 18990693, 19052488
19189317, 19409212, 19124589, 19154375, 19279273, 19468347, 19054077
19048007, 19248799, 19018206, 18921743, 14643995, 18456643, 16870214
19434529, 19706965, 17835294, 20074391, 18791688, 19197175, 19134173
19174430, 19050649, 19769480, 19077215, 19577410, 18288842, 18436647
19520602, 19149990, 19076343, 19195895, 18610915, 19068970, 19518079
19304354, 19001359, 19676905, 19309466, 19382851, 18964939, 16359751
19022470, 19532017, 19597439, 18674024, 19430401

Patch 19769479 : applied on Sat Apr 02 13:15:09 IST 2016
Unique Patch ID: 18256426
Patch description: "OCW Patch Set Update : 12.1.0.2.2 (19769479)"
Created on 22 Dec 2014, 20:20:11 hrs PST8PDT
Bugs fixed:
19700294, 19164099, 19331454, 18589889, 19139608, 19280860, 18508710
18955644, 19061429, 19146822, 18798432, 19133945, 19341538, 18946768
19135521, 19537762, 19361757, 19187207, 19302350, 19130141, 16286734
19699720, 19168690, 19266658, 18762843, 18899171, 18945249, 19045143
19146980, 19244316, 19184799, 19471722, 18634372, 19027351, 19205086
18707416, 19184188, 19131709, 19281106, 19537547, 18862203, 19079087
19031737, 20006646, 18991776, 18439295, 19380733, 19150517, 19148367
18968981, 20231741, 18943696, 19217019, 18135723, 19163425, 19524857
18849021, 18730096, 18890943, 18975620, 19205617, 18861196, 19154753
17940721, 19150313, 18843054, 18708349, 19522313, 18748932, 18835283
18953639, 19184765, 19499021, 19067804, 19046190, 19371270, 19051385
19318983, 19209951, 19054979, 19050688, 19154673, 18752378, 19226141
19053891, 18871287, 19150088, 18998228, 18922918, 18980002, 19013444
19683886, 19234177, 18956780, 18998379, 20157569, 18777835, 19273577
19026993, 17338864, 19367276, 19075747, 19513650, 18990354, 19288396
19702758, 19427050, 18952577, 19414274, 19127078, 19147513, 18910443
20053557, 19473088, 19315567, 19148982, 18290252, 19178517, 18813323
19500293, 19529729, 18643483, 19455563, 19134098, 18523468, 19277814
19319904, 18703978, 19071526, 18536826, 18965694, 19703246, 19292605
19226858, 18850051, 19602208, 19192901, 18417590, 19370739, 18920408
18636884, 18776786, 18989446, 19148793, 19043795, 19585454, 18260170
18317489, 19479503, 19029647, 19179158, 18919682, 18901356, 19140712
19807548, 19124972, 18678829, 18910748, 18849896, 19147509, 19076165
18953878, 19273758, 19498411, 18964974, 18999195, 18759724, 18835366
19459023, 19184276, 19013789, 19207286, 18950232, 19680763, 19259765
19066844, 19148791, 19234907, 19538714, 19449737, 19649640, 18962892
19062675, 19187515, 19513969, 19513888, 19230771, 18859710, 19504641
19453778, 19341481, 19343245, 18304090, 19314048, 19473851, 19068333
18834934, 18843572, 19241655, 19470791, 19458082, 18242738, 18894342
19185148, 18945435, 18372060, 19232454, 18953889, 18541110, 19319192
19023430, 19204743, 19140711, 19259290, 19178629, 19045388, 19304104
19241857, 19522571, 19140891, 19076778, 18875012, 19270660, 19457575
19066699, 18861564, 19021575, 19069755, 19273760, 18715884, 19225265
19584688, 18798573, 19018001, 19325701, 19292272, 18819158, 19270956
19068003, 18937186, 19049721, 19368917, 19222693, 18700893, 18406774
18868829, 19010177, 19141785, 19163887, 18852058, 18715868, 19538241, 19804032

Patch 19769473 : applied on Sat Apr 02 13:11:53 IST 2016
Unique Patch ID: 18256364
Patch description: "ACFS Patch Set Update : 12.1.0.2.2 (19769473)"
Created on 2 Dec 2014, 23:02:26 hrs PST8PDT
Bugs fixed:
19452723, 19078259, 19919907, 18900953, 19127216, 18934139, 19844362
19335268, 18951113, 18899600, 18851012, 19149476, 19517835, 19428756
19183802, 19013966, 19051391, 19690653, 19195735, 19355146, 19001684
19509898, 19053182, 19644505, 19593769, 19610001, 19475588, 19353057
18957085, 19279106, 19270227, 19201087, 19184398, 19649858, 19450090
19502657, 19859183, 19557156, 18877486, 19528981, 18510745, 18915417
19134464, 19060056, 18955907

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

OPatch succeeded.


Patches applied on the DB Home of the primary server:


[oracle@ora1-1 OPatch]$ /u01/app/oracle/product/12.1.0.2/db_1/OPatch/opatch lsinventory -oh /u01/app/oracle/product/12.1.0.2/db_1
Oracle Interim Patch Installer version 12.1.0.1.10
Copyright (c) 2016, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/12.1.0.2/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0.2/db_1/oraInst.loc
OPatch version : 12.1.0.1.10
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2016-04-02_13-36-33PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-04-02_13-36-33PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora1-1
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :

Patch 19769480 : applied on Sat Apr 02 13:02:02 IST 2016
Unique Patch ID: 18350083
Patch description: "Database Patch Set Update : 12.1.0.2.2 (19769480)"
Created on 15 Dec 2014, 06:54:52 hrs PST8PDT
Bugs fixed:
20284155, 19157754, 18885870, 19303936, 19708632, 19371175, 18618122
19329654, 19075256, 19074147, 19044962, 19289642, 19068610, 18988834
19028800, 19561643, 19058490, 19390567, 18967382, 19174942, 19174521
19176223, 19501299, 19178851, 18948177, 18674047, 19723336, 19189525
19001390, 19176326, 19280225, 19143550, 18250893, 19180770, 19155797
19016730, 19185876, 18354830, 19067244, 18845653, 18849537, 18964978
19065556, 19440586, 19439759, 19024808, 18952989, 18990693, 19052488
19189317, 19409212, 19124589, 19154375, 19279273, 19468347, 19054077
19048007, 19248799, 19018206, 18921743, 14643995, 18456643, 16870214
19434529, 19706965, 17835294, 20074391, 18791688, 19197175, 19134173
19174430, 19050649, 19769480, 19077215, 19577410, 18288842, 18436647
19520602, 19149990, 19076343, 19195895, 18610915, 19068970, 19518079
19304354, 19001359, 19676905, 19309466, 19382851, 18964939, 16359751
19022470, 19532017, 19597439, 18674024, 19430401

Patch 19769479 : applied on Sat Apr 02 13:01:24 IST 2016
Unique Patch ID: 18256426
Patch description: "OCW Patch Set Update : 12.1.0.2.2 (19769479)"
Created on 22 Dec 2014, 20:20:11 hrs PST8PDT
Bugs fixed:
19700294, 19164099, 19331454, 18589889, 19139608, 19280860, 18508710
18955644, 19061429, 19146822, 18798432, 19133945, 19341538, 18946768
19135521, 19537762, 19361757, 19187207, 19302350, 19130141, 16286734
19699720, 19168690, 19266658, 18762843, 18899171, 18945249, 19045143
19146980, 19244316, 19184799, 19471722, 18634372, 19027351, 19205086
18707416, 19184188, 19131709, 19281106, 19537547, 18862203, 19079087
19031737, 20006646, 18991776, 18439295, 19380733, 19150517, 19148367
18968981, 20231741, 18943696, 19217019, 18135723, 19163425, 19524857
18849021, 18730096, 18890943, 18975620, 19205617, 18861196, 19154753
17940721, 19150313, 18843054, 18708349, 19522313, 18748932, 18835283
18953639, 19184765, 19499021, 19067804, 19046190, 19371270, 19051385
19318983, 19209951, 19054979, 19050688, 19154673, 18752378, 19226141
19053891, 18871287, 19150088, 18998228, 18922918, 18980002, 19013444
19683886, 19234177, 18956780, 18998379, 20157569, 18777835, 19273577
19026993, 17338864, 19367276, 19075747, 19513650, 18990354, 19288396
19702758, 19427050, 18952577, 19414274, 19127078, 19147513, 18910443
20053557, 19473088, 19315567, 19148982, 18290252, 19178517, 18813323
19500293, 19529729, 18643483, 19455563, 19134098, 18523468, 19277814
19319904, 18703978, 19071526, 18536826, 18965694, 19703246, 19292605
19226858, 18850051, 19602208, 19192901, 18417590, 19370739, 18920408
18636884, 18776786, 18989446, 19148793, 19043795, 19585454, 18260170
18317489, 19479503, 19029647, 19179158, 18919682, 18901356, 19140712
19807548, 19124972, 18678829, 18910748, 18849896, 19147509, 19076165
18953878, 19273758, 19498411, 18964974, 18999195, 18759724, 18835366
19459023, 19184276, 19013789, 19207286, 18950232, 19680763, 19259765
19066844, 19148791, 19234907, 19538714, 19449737, 19649640, 18962892
19062675, 19187515, 19513969, 19513888, 19230771, 18859710, 19504641
19453778, 19341481, 19343245, 18304090, 19314048, 19473851, 19068333
18834934, 18843572, 19241655, 19470791, 19458082, 18242738, 18894342
19185148, 18945435, 18372060, 19232454, 18953889, 18541110, 19319192
19023430, 19204743, 19140711, 19259290, 19178629, 19045388, 19304104
19241857, 19522571, 19140891, 19076778, 18875012, 19270660, 19457575
19066699, 18861564, 19021575, 19069755, 19273760, 18715884, 19225265
19584688, 18798573, 19018001, 19325701, 19292272, 18819158, 19270956
19068003, 18937186, 19049721, 19368917, 19222693, 18700893, 18406774
18868829, 19010177, 19141785, 19163887, 18852058, 18715868, 19538241, 19804032

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

OPatch succeeded.
[oracle@ora1-1 OPatch]$



View the list of patches applied on the standby server:

Patches applied on the GI Home of Standby server:


[oracle@ora1-4 ~]$ /u01/app/oracle/product/12.1.0.2/grid/OPatch/opatch lsinventory -oh /u01/app/oracle/product/12.1.0.2/grid
Oracle Interim Patch Installer version 12.1.0.1.10
Copyright (c) 2016, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/12.1.0.2/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0.2/grid/oraInst.loc
OPatch version : 12.1.0.1.10
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatch/opatch2016-04-02_13-37-28PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.1.0.2/grid/cfgtoollogs/opatch/lsinv/lsinventory2016-04-02_13-37-28PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora1-4
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Grid Infrastructure 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.


Interim patches (4) :

Patch 19872484 : applied on Sat Apr 02 12:41:56 IST 2016
Unique Patch ID: 18291456
Patch description: "WLM Patch Set Update: 12.1.0.2.2 (19872484)"
Created on 2 Dec 2014, 23:18:41 hrs PST8PDT
Bugs fixed:
19016964, 19582630

Patch 19769480 : applied on Sat Apr 02 12:41:52 IST 2016
Unique Patch ID: 18350083
Patch description: "Database Patch Set Update : 12.1.0.2.2 (19769480)"
Created on 15 Dec 2014, 06:54:52 hrs PST8PDT
Bugs fixed:
20284155, 19157754, 18885870, 19303936, 19708632, 19371175, 18618122
19329654, 19075256, 19074147, 19044962, 19289642, 19068610, 18988834
19028800, 19561643, 19058490, 19390567, 18967382, 19174942, 19174521
19176223, 19501299, 19178851, 18948177, 18674047, 19723336, 19189525
19001390, 19176326, 19280225, 19143550, 18250893, 19180770, 19155797
19016730, 19185876, 18354830, 19067244, 18845653, 18849537, 18964978
19065556, 19440586, 19439759, 19024808, 18952989, 18990693, 19052488
19189317, 19409212, 19124589, 19154375, 19279273, 19468347, 19054077
19048007, 19248799, 19018206, 18921743, 14643995, 18456643, 16870214
19434529, 19706965, 17835294, 20074391, 18791688, 19197175, 19134173
19174430, 19050649, 19769480, 19077215, 19577410, 18288842, 18436647
19520602, 19149990, 19076343, 19195895, 18610915, 19068970, 19518079
19304354, 19001359, 19676905, 19309466, 19382851, 18964939, 16359751
19022470, 19532017, 19597439, 18674024, 19430401

Patch 19769479 : applied on Sat Apr 02 12:40:43 IST 2016
Unique Patch ID: 18256426
Patch description: "OCW Patch Set Update : 12.1.0.2.2 (19769479)"
Created on 22 Dec 2014, 20:20:11 hrs PST8PDT
Bugs fixed:
19700294, 19164099, 19331454, 18589889, 19139608, 19280860, 18508710
18955644, 19061429, 19146822, 18798432, 19133945, 19341538, 18946768
19135521, 19537762, 19361757, 19187207, 19302350, 19130141, 16286734
19699720, 19168690, 19266658, 18762843, 18899171, 18945249, 19045143
19146980, 19244316, 19184799, 19471722, 18634372, 19027351, 19205086
18707416, 19184188, 19131709, 19281106, 19537547, 18862203, 19079087
19031737, 20006646, 18991776, 18439295, 19380733, 19150517, 19148367
18968981, 20231741, 18943696, 19217019, 18135723, 19163425, 19524857
18849021, 18730096, 18890943, 18975620, 19205617, 18861196, 19154753
17940721, 19150313, 18843054, 18708349, 19522313, 18748932, 18835283
18953639, 19184765, 19499021, 19067804, 19046190, 19371270, 19051385
19318983, 19209951, 19054979, 19050688, 19154673, 18752378, 19226141
19053891, 18871287, 19150088, 18998228, 18922918, 18980002, 19013444
19683886, 19234177, 18956780, 18998379, 20157569, 18777835, 19273577
19026993, 17338864, 19367276, 19075747, 19513650, 18990354, 19288396
19702758, 19427050, 18952577, 19414274, 19127078, 19147513, 18910443
20053557, 19473088, 19315567, 19148982, 18290252, 19178517, 18813323
19500293, 19529729, 18643483, 19455563, 19134098, 18523468, 19277814
19319904, 18703978, 19071526, 18536826, 18965694, 19703246, 19292605
19226858, 18850051, 19602208, 19192901, 18417590, 19370739, 18920408
18636884, 18776786, 18989446, 19148793, 19043795, 19585454, 18260170
18317489, 19479503, 19029647, 19179158, 18919682, 18901356, 19140712
19807548, 19124972, 18678829, 18910748, 18849896, 19147509, 19076165
18953878, 19273758, 19498411, 18964974, 18999195, 18759724, 18835366
19459023, 19184276, 19013789, 19207286, 18950232, 19680763, 19259765
19066844, 19148791, 19234907, 19538714, 19449737, 19649640, 18962892
19062675, 19187515, 19513969, 19513888, 19230771, 18859710, 19504641
19453778, 19341481, 19343245, 18304090, 19314048, 19473851, 19068333
18834934, 18843572, 19241655, 19470791, 19458082, 18242738, 18894342
19185148, 18945435, 18372060, 19232454, 18953889, 18541110, 19319192
19023430, 19204743, 19140711, 19259290, 19178629, 19045388, 19304104
19241857, 19522571, 19140891, 19076778, 18875012, 19270660, 19457575
19066699, 18861564, 19021575, 19069755, 19273760, 18715884, 19225265
19584688, 18798573, 19018001, 19325701, 19292272, 18819158, 19270956
19068003, 18937186, 19049721, 19368917, 19222693, 18700893, 18406774
18868829, 19010177, 19141785, 19163887, 18852058, 18715868, 19538241, 19804032

Patch 19769473 : applied on Sat Apr 02 12:38:22 IST 2016
Unique Patch ID: 18256364
Patch description: "ACFS Patch Set Update : 12.1.0.2.2 (19769473)"
Created on 2 Dec 2014, 23:02:26 hrs PST8PDT
Bugs fixed:
19452723, 19078259, 19919907, 18900953, 19127216, 18934139, 19844362
19335268, 18951113, 18899600, 18851012, 19149476, 19517835, 19428756
19183802, 19013966, 19051391, 19690653, 19195735, 19355146, 19001684
19509898, 19053182, 19644505, 19593769, 19610001, 19475588, 19353057
18957085, 19279106, 19270227, 19201087, 19184398, 19649858, 19450090
19502657, 19859183, 19557156, 18877486, 19528981, 18510745, 18915417
19134464, 19060056, 18955907

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

OPatch succeeded.
[oracle@ora1-4 ~]$

 

Patches applied on the DB Home of Standby server:

[oracle@ora1-4 ~]$
[oracle@ora1-4 ~]$ /u01/app/oracle/product/12.1.0.2/db_1/OPatch/opatch lsinventory -oh /u01/app/oracle/product/12.1.0.2/db_1
Oracle Interim Patch Installer version 12.1.0.1.10
Copyright (c) 2016, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/product/12.1.0.2/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0.2/db_1/oraInst.loc
OPatch version : 12.1.0.1.10
OUI version : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2016-04-02_13-37-54PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-04-02_13-37-54PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: ora1-4
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c 12.1.0.2.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :

Patch 19769480 : applied on Sat Apr 02 12:29:02 IST 2016
Unique Patch ID: 18350083
Patch description: "Database Patch Set Update : 12.1.0.2.2 (19769480)"
Created on 15 Dec 2014, 06:54:52 hrs PST8PDT
Bugs fixed:
20284155, 19157754, 18885870, 19303936, 19708632, 19371175, 18618122
19329654, 19075256, 19074147, 19044962, 19289642, 19068610, 18988834
19028800, 19561643, 19058490, 19390567, 18967382, 19174942, 19174521
19176223, 19501299, 19178851, 18948177, 18674047, 19723336, 19189525
19001390, 19176326, 19280225, 19143550, 18250893, 19180770, 19155797
19016730, 19185876, 18354830, 19067244, 18845653, 18849537, 18964978
19065556, 19440586, 19439759, 19024808, 18952989, 18990693, 19052488
19189317, 19409212, 19124589, 19154375, 19279273, 19468347, 19054077
19048007, 19248799, 19018206, 18921743, 14643995, 18456643, 16870214
19434529, 19706965, 17835294, 20074391, 18791688, 19197175, 19134173
19174430, 19050649, 19769480, 19077215, 19577410, 18288842, 18436647
19520602, 19149990, 19076343, 19195895, 18610915, 19068970, 19518079
19304354, 19001359, 19676905, 19309466, 19382851, 18964939, 16359751
19022470, 19532017, 19597439, 18674024, 19430401

Patch 19769479 : applied on Sat Apr 02 12:28:24 IST 2016
Unique Patch ID: 18256426
Patch description: "OCW Patch Set Update : 12.1.0.2.2 (19769479)"
Created on 22 Dec 2014, 20:20:11 hrs PST8PDT
Bugs fixed:
19700294, 19164099, 19331454, 18589889, 19139608, 19280860, 18508710
18955644, 19061429, 19146822, 18798432, 19133945, 19341538, 18946768
19135521, 19537762, 19361757, 19187207, 19302350, 19130141, 16286734
19699720, 19168690, 19266658, 18762843, 18899171, 18945249, 19045143
19146980, 19244316, 19184799, 19471722, 18634372, 19027351, 19205086
18707416, 19184188, 19131709, 19281106, 19537547, 18862203, 19079087
19031737, 20006646, 18991776, 18439295, 19380733, 19150517, 19148367
18968981, 20231741, 18943696, 19217019, 18135723, 19163425, 19524857
18849021, 18730096, 18890943, 18975620, 19205617, 18861196, 19154753
17940721, 19150313, 18843054, 18708349, 19522313, 18748932, 18835283
18953639, 19184765, 19499021, 19067804, 19046190, 19371270, 19051385
19318983, 19209951, 19054979, 19050688, 19154673, 18752378, 19226141
19053891, 18871287, 19150088, 18998228, 18922918, 18980002, 19013444
19683886, 19234177, 18956780, 18998379, 20157569, 18777835, 19273577
19026993, 17338864, 19367276, 19075747, 19513650, 18990354, 19288396
19702758, 19427050, 18952577, 19414274, 19127078, 19147513, 18910443
20053557, 19473088, 19315567, 19148982, 18290252, 19178517, 18813323
19500293, 19529729, 18643483, 19455563, 19134098, 18523468, 19277814
19319904, 18703978, 19071526, 18536826, 18965694, 19703246, 19292605
19226858, 18850051, 19602208, 19192901, 18417590, 19370739, 18920408
18636884, 18776786, 18989446, 19148793, 19043795, 19585454, 18260170
18317489, 19479503, 19029647, 19179158, 18919682, 18901356, 19140712
19807548, 19124972, 18678829, 18910748, 18849896, 19147509, 19076165
18953878, 19273758, 19498411, 18964974, 18999195, 18759724, 18835366
19459023, 19184276, 19013789, 19207286, 18950232, 19680763, 19259765
19066844, 19148791, 19234907, 19538714, 19449737, 19649640, 18962892
19062675, 19187515, 19513969, 19513888, 19230771, 18859710, 19504641
19453778, 19341481, 19343245, 18304090, 19314048, 19473851, 19068333
18834934, 18843572, 19241655, 19470791, 19458082, 18242738, 18894342
19185148, 18945435, 18372060, 19232454, 18953889, 18541110, 19319192
19023430, 19204743, 19140711, 19259290, 19178629, 19045388, 19304104
19241857, 19522571, 19140891, 19076778, 18875012, 19270660, 19457575
19066699, 18861564, 19021575, 19069755, 19273760, 18715884, 19225265
19584688, 18798573, 19018001, 19325701, 19292272, 18819158, 19270956
19068003, 18937186, 19049721, 19368917, 19222693, 18700893, 18406774
18868829, 19010177, 19141785, 19163887, 18852058, 18715868, 19538241, 19804032

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

OPatch succeeded.
[oracle@ora1-4 ~]$



Open the Pluggable database plugged in with the primary database.


SYS@targetdb> show pdbs

CON_ID     CON_NAME         OPEN MODE     RESTRICTED
---------- ---------------- ------------- --------------------
2          PDB$SEED         READ ONLY     NO
3          TARGETPDB        MOUNTED


SYS@targetdb> alter pluggable database targetpdb open;

Pluggable database altered.


Enable the log shippment on the primary to the standby database.


SYS@targetdb> alter system set log_archive_Dest_state_2=enable;

System altered.


On the other hand, mount the standby database and start the recovery.


[oracle@ora1-4 bin]$ sqlplus sys/oracle@tarstdb as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sat Apr 2 12:49:10 2016

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

Connected to an idle instance.

SYS@tarstdb> startup mount
ORACLE instance started.

Total System Global Area 1291845632 bytes
Fixed Size 2924016 bytes
Variable Size 469762576 bytes
Database Buffers 805306368 bytes
Redo Buffers 13852672 bytes
Database mounted.


SYS@tarstdb> alter database recover managed standby database disconnect;

Database altered.

 

SYS@tarstdb> select process,status,sequence# from v$managed_standby;

PROCESS   STATUS         SEQUENCE#
--------- -------------- ---------
ARCH      CONNECTED              0
ARCH      CONNECTED              0
ARCH      CONNECTED              0
ARCH      CONNECTED              0
RFS       IDLE                   0
RFS       IDLE                 107
RFS       IDLE                   0
RFS       IDLE                   0
MRP0      WAIT_FOR_LOG         107

9 rows selected.


Do not run any patching scripts on the standby database. Invoke the "datapatch" tool to complete the post patch SQL actions on the primary database.
Datapatch in a multitenant environment applies the SQL changes only to the ROOT (CDB$ROOT), PDB$SEED and any open PDBs.

On the primary, datapatch applies the changes on the CDB$ROOT, PDB$SEED and the PDB TARGETPDB (as this PDB is OPEN):


[oracle@ora1-1 OPatch]$ cd $ORACLE_HOME/OPatch
[oracle@ora1-1 OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.2.0.0.0 on Sat Apr 2 13:47:34 2016
Copyright (c) 2014, Oracle. All rights reserved.

Connecting to database...OK
Note: Datapatch will only apply or rollback SQL fixes for PDBs
that are in an open state, no patches will be applied to closed PDBs.
Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
(Doc ID 1585822.1)
catcon: ALL catcon-related output will be written to /tmp/sqlpatch_catcon__catcon_28634.lst
catcon: See /tmp/sqlpatch_catcon_*.log files for output generated by scripts
catcon: See /tmp/sqlpatch_catcon__*.lst files for spool files, if any
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Bundle series PSU:
ID 2 in the binary registry and not installed in any PDB

Adding patches to installation queue and performing prereq checks...
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED TARGETPDB
Nothing to roll back
The following patches will be applied:
19769480 (Database Patch Set Update : 12.1.0.2.2 (19769480))

Installing patches...
Patch installation complete. Total patches installed: 3

Validating logfiles...
Patch 19769480 apply (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_TARGETDB_CDBROOT_2016Apr02_13_48_43.log (no errors)
Patch 19769480 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_TARGETDB_PDBSEED_2016Apr02_13_48_56.log (no errors)
Patch 19769480 apply (pdb TARGETPDB): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/19769480/18350083/19769480_apply_TARGETDB_TARGETPDB_2016Apr02_13_48_56.log (no errors)
SQL Patching tool complete on Sat Apr 2 13:49:01 2016
[oracle@ora1-1 OPatch]$


Verify the applied changes using dba_registry_sqlpatch on the primary database.

SYS@targetdb> select patch_id,version,action,status,bundle_series,description from dba_registry_sqlpatch;

PATCH_ID   VERSION   ACTION   STATUS     BUNDLE_SERIES    DESCRIPTION
---------- --------- -------- ---------- ---------------  ---------------------------------------------------------
19769480   12.1.0.2  APPLY    SUCCESS    PSU              Database Patch Set Update : 12.1.0.2.2 (19769480)



SYS@targetdb> select action,action_time,description,status,bundle_series,version from registry$sqlpatch;

ACTION          ACTION_TIME                    DESCRIPTION                                             STATUS          BUNDLE_SERIES        VERSION
--------------- ------------------------------ ------------------------------------------------------- --------------- -------------------- ---------------
APPLY           02-APR-16 01.49.01.638130 PM   Database Patch Set Update : 12.1.0.2.2 (19769480)       SUCCESS         PSU                  12.1.0.2

The SQL changes in terms of redo will be applied on to the standby database as it is received from the primary.

You can have the SQL changes tested on the standby database by having it converted into a READ WRITE on mode and this is possible by converting the physical standby database into a SNAPSHOT standby database.

Let me have the patch tested on the physical standby database by converting it into SNAPSHOT standby.

SYS@tarstdb> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY


Converting physical standby database into snapshot standby to test the patch:


SYS@tarstdb> alter database convert to snapshot standby;

Database altered.

SYS@tarstdb>


Open the snapshot standby database:

 

SYS@tarstdb> select database_role from v$database;

DATABASE_ROLE
----------------
SNAPSHOT STANDBY

SYS@tarstdb> alter database open;

Database altered.

Snippet from the alert log file of the standby database showing it's conversion to snapshot standby and also the patch information dumped.


CONVERT TO SNAPSHOT STANDBY: Complete - Database mounted as snapshot standby
Completed: alter database convert to snapshot standby
alter database open
Sat Apr 02 14:33:30 2016


Sat Apr 02 14:34:09 2016
Re-creating tempfile +DATA_NEW as +DATA_NEW/TARSTDB/2DBEA8AC28E81AACE0536538A8C0F5B7/TEMPFILE/temp.263.908116449
ALTER SYSTEM: Flushing buffer cache inst=0 container=3 local
Starting background process CJQ0
Completed: alter database open
Sat Apr 02 14:34:12 2016
CJQ0 started with pid=51, OS id=23288
Sat Apr 02 14:34:15 2016
Shared IO Pool defaulting to 48MB. Trying to get it from Buffer Cache for process 20985.
Sat Apr 02 14:34:18 2016
Setting Resource Manager plan SCHEDULER[0x4448]:DEFAULT_MAINTENANCE_PLAN via scheduler window
Setting Resource Manager CDB plan DEFAULT_MAINTENANCE_PLAN via parameter
Sat Apr 02 14:34:19 2016
===========================================================
Dumping current patch information
===========================================================
Patch Id: 19769479
Patch Description: OCW Patch Set Update : 12.1.0.2.2 (19769479)
Patch Apply Time: 2016-04-02 12:28:24 GMT+05:30


Patch Id: 19769480
Patch Description: Database Patch Set Update : 12.1.0.2.2 (19769480)
Patch Apply Time: 2016-04-02 12:29:02 GMT+05:30


Query the registry$sqlpatch or the dba_registry_sqlpatch on the snapshot standby database to get the details of the patch that was applied.


SYS@tarstdb> select action,action_time,description,status,bundle_series,version from registry$sqlpatch;

ACTION          ACTION_TIME                    DESCRIPTION                                             STATUS          BUNDLE_SERIES        VERSION
--------------- ------------------------------ ------------------------------------------------------- --------------- -------------------- ---------------
APPLY           02-APR-16 01.49.01.638130 PM   Database Patch Set Update : 12.1.0.2.2 (19769480)       SUCCESS         PSU                  12.1.0.2


SYS@tarstdb>
SYS@tarstdb> select patch_id,version,action,status,bundle_series,description from dba_registry_sqlpatch;

PATCH_ID   VERSION              ACTION          STATUS          BUNDLE_SERIES        DESCRIPTION
---------- -------------------- --------------- --------------- -------------------- -------------------------------------------------------
19769480   12.1.0.2             APPLY           SUCCESS         PSU                  Database Patch Set Update : 12.1.0.2.2 (19769480)

SYS@tarstdb>

I would now convert the snapshot standby back to physical standby.

SYS@tarstdb> alter database convert to physical standby;
Database altered.


Once done, bounce the physical standby database and start the Managed Recovery Process (MRP) on it.


SQL> shut immediate
ORA-01507: database not mounted

ORACLE instance shut down.

SYS@tarstdb> startup mount
ORACLE instance started.

Total System Global Area 1291845632 bytes
Fixed Size 2924016 bytes
Variable Size 469762576 bytes
Database Buffers 805306368 bytes
Redo Buffers 13852672 bytes
Database mounted.

SYS@tarstdb> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

SYS@tarstdb> alter database recover managed standby database disconnect;

Database altered.


Conclusion:

PSU patch is applied on both primary and standby database Oracle Home. In addition, the SQL changes have been successfully applied on the primary database and the corresponding redo on to the standby database. We can now be confident enough that the bug for which the patch was applied would not be seen on the standby database when a role transition occurs.

8144 1 /
Follow / 29 Apr 2017 at 11:48am

With opatchauto in Oracle 12c, datapatch is automatically invoked. So would it be right to use opatchauto in Standby? Should we not be using opatch instead of opatchauto and let redo logs do the rest