I must thank my fellow DBA Franky Weber Faust for his publication in Portuguese OTN.

Apply the PSU in Standby with RAC database using the standby-first patch apply method.

In this article, I introduce how to apply the patch using the standby-first patch apply the method in a DataGuard environment with Oracle RAC 12c, where we apply with Rolling Patch. In short, we will first apply the patch to standby and because the database is a 2-node RAC, we apply it to one node first and then the other.

Scenario:

Primary:
Exadata Database Machine:
Srv-pmy1 → pmy1
Srv-pmy2 → pmy2
Standby:
Exadata Database Machine:
Srv-stb1 → stb1
Srv-stb2 → stb2

First of all, read the README of the patch that will be applied and make sure the patch can be applied the way I am doing here.

Initially, check the patches applied.

[Stb1.oracle@srv-stb1 patch] $ cd /u01/app/oracle/product/12.1.0.2/dbhome_1/OPatch/
[Stb1.oracle@srv-stb1 OPatch] $ ./opatch lspatches
23177536; Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016)
21923026;
23520664; OCW Interim patch for 23520664
23144544; DATABASE BUNDLE PATCH: 12.1.0.2.160719 (23144544)

OPatch succeeded.

In the scenario that I am, there is a patch 21923026 incompatibility with the patch 24448103 that I will apply, so it is necessary to roll back the patch 21923026 before applying the other.

Check the running instances.

[Stb1.oracle@srv-stb1 OPatch] $ ps -ef | grep pmon
Oracle 19819 1 0 2016? asm_pmon_+ASM1
Oracle 36065 1 0 2016? ora_pmon_stb1
Oracle 41740 2198 0 18:31 pts / 1 00:00:00 grep pmon

Connect to the Broker and check the current Standby configuration.

[Stb1.oracle@srv-stb1 u01] $ dgmgrl /
DGMGRL for Linux: Version 12.1.0.2.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
Connected as SYSDG.
DGMGRL> show configuration;

Configuration - dg

Protection Mode: MaxAvailability
Members:
Pmy - Primary database
Stb - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS (status updated 58 seconds ago)

DGMGRL> show database stb;

Database - stb

Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 626.00 KByte / s
Real Time Query: OFF
Instance (s):
Stb1
Stb2 (apply instance)

Database Status:
SUCCESS

Thus it was verified that redoapply is occurring in node 2, which allows us to apply the patch in node 1. 
Stop all Oracle Home services where the patch will be applied. In my case, there is only one instance in this OH.

[Stb1.oracle@srv-stb1 OPatch] $ srvctl stop instance -i stb1 -d stb

Do the patch rollback 21923026. The -verbose option brings more logs to the screen.

[Stb1.oracle@srv-stb1 OPatch] $ ./opatch rollback -id 21923026
-local -verbose

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

Environment:
OPatch.ORACLE_HOME = / u01 / app / oracle / product / 12.1.0.2 / dbhome_1

Oracle.installer.invPtrLoc = / u01 / app / oracle / product / 12.1.0.2 /
Dbhome_1 / oraInst.loc

Oracle.installer.oui_loc = / u01 / app / oracle / product / 12.1.0.2 /
Dbhome_1 / oui

Oracle.installer.library_loc = / u01 / app / oracle / product / 12.1.0.2 /
Dbhome_1 / oui / lib / linux64

Oracle.installer.startup_location = / u01 / app / oracle / product /
12.1.0.2/dbhome_1/oui

OPatch.PLATFORM_ID =
Os.name = Linux
OPatch.NO_FUSER =
OPatch.SKIP_VERIFY = null
OPatch.SKIP_VERIFY_SPACE = null
Oracle.installer.clusterEnabled = false
TRACING.ENABLED = null
TRACING.LEVEL = null
OPatch.DEBUG = false
OPATCH_VERSION = 12.1.0.1.12
Bundled OPatch Property File = properties
Minimum OUI version: 10.2

OPatch.PATH = / u01 / app / oracle / product / 12.1.0.2 / dbhome_1 / bin: /
Usr / local / bin: / bin: / usr / bin: / usr / local / sbin: / usr / sbin: /
Sbin:.: / Usr / java / bin :: / u01 / app / oracle / product / 12.1.0.2 /
Dbhome_1 / OPatch: /u01/app/12.1.0.2/grid/bin

OPatch.MW_HOME =
OPatch.WL_HOME =
OPatch.COMMON_COMPONENTS_HOME =

Oracle Home: /u01/app/oracle/product/12.1.0.2/dbhome_1
Central Inventory: / u01 / app / oraInventory
From: /u01/app/oracle/product/12.1.0.2/dbhome_1/
OraInst.loc
OPatch version: 12.1.0.1.12
OUI version: 12.1.0.2.0
Log file location: /u01/app/oracle/product/12.1.0.2/dbhome_1/
Cfgtoollogs / opatch / opatch2017-01-11_18-39-53PM_1.log

Patch to roll back: 21923026
Lock the home to access inventory.
Running pre-requisite checks on patches to be rolled back.

All the specified patches are present in the Oracle Home.
Construct a list of patch objects to roll back ...
Loading patches from Oracle Home inventory.

Patches will be rolled back in the following order:
21923026
Create a merged patch using patch 21923026
Add component oracle.rdbms, 12.1.0.2.0
Add ArchiveAction for libserver12.a
Add ArchiveAction for libserver12.a
Add ArchiveAction for libserver12.a
Add MakeAction for ioracle

NRollback: backed-up files are under "/ u01 / app / oracle / product /
12.1.0.2/dbhome_1/.patch_storage/NRollback/2017-01-11_18-39-53PM "
Running prerequisite check "CheckForInputValues" ...
Input values are present for all the actions of the given patches.

Running prerequisite check "CheckSystemCommandAvailable" ...

Fuser command is needed

Archive command is needed

Make commands is needed

All the required commands are available.
All the required system commands are present.

Running prerequisite check "CheckActiveFilesAndExecutables" ...

Invoking fuser on the executable list ...
Invoking fuser on "/u01/app/oracle/product/12.1.0.2/dbhome_1/
Bin / oracle "

There are no active executables.
None of the executables are active.

Running prerequisite check "CheckRollbackSid" ...

Running prerequisite check "CheckRollbackable" ...
All the input rollback patches can be rolled back together.

Patch 21923026:
All the actions are rollbackable.

All the specified patches can be rolled back.
All the actions of the given patches are rollbackable.

Running prerequisite check "CheckPatchRollbackDependents" ...
All the required patch (s) are present in the Oracle Home.

Running prerequisite check "CheckMinimumOPatchVersion" ...

All patches can be applied using this OPatch.
Prerequisite check "CheckMinimumOPatchVersion" passed.
The following patch (s) will be rolled back: 21923026

Please shutdown Oracle instances running out of this ORACLE_HOME
On the local system.
(Oracle Home = '/u01/app/oracle/product/12.1.0.2/dbhome_1')
Is the local system ready for patching? [Y | n]
And
User Responded with: Y

Back up patch inventory from "/u01/app/oracle/product/12.1.0.2/
Dbhome_1 / inventory / oneoffs "to" / u01 / app / oracle /

Product / 12.1.0.2 / dbhome_1 / .patch_storage / NRollback /
2017-01-11_18-39-53PM / backup / inventory / oneoffs ".

Creating directory "/u01/app/oracle/product/12.1.0.2/dbhome_1/
.patch_storage / NRollback / 2017-01-11_18-39-53PM / backup /
Inventory / oneoffs "

Back up Oracle Home Inventory from "/ u01 / app / oracle / product /
12.1.0.2/dbhome_1/inventory/ContentsXML/comps.xml "to" / u01 /
App / oracle / product / 12.1.0.2 / dbhome_1 / .patch_storage / NRollback /
2017-01-11_18-39-53PM / backup / inventory / ContentsXML /
Comps.xml ".

Create restore file "/u01/app/oracle/product/12.1.0.2/dbhome_1/
.patch_storage / NRollback / 2017-01-11_18-39-53PM /
Restore.sh ".

Creating script "/u01/app/oracle/product/12.1.0.2/dbhome_1/
.patch_storage / NRollback / 2017-01-11_18-39-53PM / restore.sh "...

Rolling back patch 21923026 ...

Patch Location in Inventory: / u01 / app / oracle / product /
12.1.0.2/dbhome_1/inventory/oneoffs/21923026

Patch Location in Storage area: / u01 / app / oracle / product /
12.1.0.2/dbhome_1/.patch_storage/21923026_Jun_7_2016_23_33_21
RollbackSession rolling back interim patch '21923026' from OH '/
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 '

Bugs fixed by this patch 21923026:
21923026: ORA-600 [OLTP COMPRESSION SANITY CHECK]

Creating mode file for rollback

Patching component oracle.rdbms, 12.1.0.2.0 ...
ArchiveAction: rollback () on "/ u01 / app / oracle / product /
12.1.0.2/dbhome_1/lib/libserver12.a "

Executing '/ usr / bin / ar -rc /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / lib / libserver12.a /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / .patch_storage / 21923026_Jun_7_2016_23_33_21 / files /
Lib / libserver12.a / kd9ir2c.o /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / .patch_storage / 21923026_Jun_7_2016_23_33_21 / files /
Lib / libserver12.a / kdblc.o /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / .patch_storage / 21923026_Jun_7_2016_23_33_21 / files /
Lib / libserver12.a / kdo.o '

Archive Action done

Re-link for the target oracle.rdbms, 12.1.0.2.0 is delayed.
It will be done in the end.

RollbackSession removing interim patch '21923026' from inventory

Deleting the directory "/u01/app/oracle/product/12.1.0.2/
Dbhome_1 / inventory / oneoffs / 21923026 "

Deleted the directory "/u01/app/oracle/product/12.1.0.2/
Dbhome_1 / inventory / oneoffs / 21923026 "

Verifying if inventory updating has gone fine ....

Inventory is updated with patch details.

Done with rolling back all patches.

MakeAction: makeFile = "/ u01 / app / oracle / product /
12.1.0.2/dbhome_1/rdbms/lib/ins_rdbms.mk ", target =
"Ioracle", directory = "/ u01 / app / oracle / product /
12.1.0.2/dbhome_1/rdbms/lib ", makeCmd =" / usr / bin /
Make -f ins_rdbms.mk

Ioracle ORACLE_HOME = / u01 / app / oracle / product /
12.1.0.2/dbhome_1 "
Make result:

Command: / usr / bin / make -f ins_rdbms.mk ioracle ORACLE_HOME =
/u01/app/oracle/product/12.1.0.2/dbhome_1

Returned code: 0
Stdout output:
Chmod 755 /u01/app/oracle/product/12.1.0.2/dbhome_1/bin

- Linking Oracle
Rm -f /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/lib/oracle
/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/orald -o / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1 / rdbms / lib / oracle -m64 -z
Noexecstack -Wl, - disable-new-dtags -L / u01 / app / oracle / product /
12.1.0.2/dbhome_1/rdbms/lib/ -L / u01 / app / oracle / product / 12.1.0.2 /
Dbhome_1 / lib / -L / u01 / app / oracle / product / 12.1.0.2 / dbhome_1 / lib /
Stubs / -Wl, -E /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/
Lib / opimai.o /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/
Lib / ssoraed.o /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/
Lib / ttcsoi.o -Wl, - whole-archive -lperfsrv12 -Wl, - non-whole-archive
/u01/app/oracle/product/12.1.0.2/dbhome_1/lib/nautab.o / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1 / lib / naeet.o / u01 / app / oracle /
Product / 12.1.0.2 / dbhome_1 / lib / naect.o / u01 / app / oracle / product /
12.1.0.2/dbhome_1/lib/naedhs.o / u01 / app / oracle / product /
12.1.0.2/dbhome_1/rdbms/lib/config.o -lserver12 -lodm12
-lcell12 -lnnet12 -lskgxp12 -lsnls12 -lnls12 -lcore12 -lsnls12
-lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12
-lsnls12 -lnls12 -lcore12 -lnls12 -lclient12 -lvsn12 -lcommon12
-lgeneric12 -lknlopt `if / usr / bin / air tv / u01 / app / oracle /
Product / 12.1.0.2 / dbhome_1 / rdbms / lib / libknlopt.a | Grep
Xsyeolap.o> / dev / null 2> & 1; Then echo "-loraolap12";
Fi` -lskjcx12 -lslax12 -lpls12 -lrt -lplp12 -lserver12
-lclient12 -lvsn12 -lcommon12 -lgeneric12 `if [-f / u01 /
App / oracle / product / 12.1.0.2 / dbhome_1 / lib / libavserver12.a];
Then echo "-lavserver12"; Else echo "-lavstub12"; Fi if
[-f /u01/app/oracle/product/12.1.0.2/dbhome_1/lib/
Libavclient12.a]; Then echo "-lavclient12"; Fi` -lknlopt
-lslax12 -lpls12 -lrt -lplp12 -ljavavm12 -lserver12
-lwwg `cat /u01/app/oracle/product/12.1.0.2/dbhome_1/lib/
Ldflags` -lncrypt12 -lnsgr12 -lnzjs12 -ln12 -lnl12 -lnro12
`Cat / u01 / app / oracle / product / 12.1.0.2 / dbhome_1 / lib / ldflags`
-lncrypt12-lnsgr12 -lnzjs12 -ln12 -lnl12 -lnnzst12 -lzt12
-lztkg12 -lmm -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12
-lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12 -lsnls12
-lnls12 -lcore12 -lnls12 -lztkg12 `cat / u01 / app / oracle / product
/ 12.1.0.2 / dbhome_1 / lib / ldflags` -lncrypt12 -lnsgr12
-lnzjs12 -ln12 -lnl12 -lnro12 `cat / u01 / app / oracle / product /
12.1.0.2 / dbhome_1 / lib / ldflags` -lncrypt12 -lnsgr12 -lnzjs12
-ln12 -lnl12 -lnnzst12 -lzt12 -lztkg12 -lsnls12 -lnls12
-lcore12 -lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12
-lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12 `if /
Usr / bin / ar tv /u01/app/oracle/product/12.1.0.2/dbhome_1/
Rdbms / lib / libknlopt.a | Grep "kxmnsd.o"> / dev / null 2> & 1;
Then echo ""; Else echo "-lordsdo12 -lserver12"; Fi `
-l / u01 / app / oracle / product / 12.1.0.2 / dbhome_1 / ctx / lib /
-lctxc12 -lctx12 -lzx12 -lgx12 -lctx12 -lzx12 -lxx12
-lordimt12 -lclsra12 -ldbcfg12 -lhasgen12 -lskgxn2 -lnnzst12
-lzt12 -lxml12 -locr12 -locrb12 -locrutl12 -lhasgen12
-lskgxn2 -lnnzst12 -lzt12 -lxml12 -lgeneric12 -chloraz
-llzopro -lorabz2 -lipp_z -lipp_bz2 -lippdcemerged
-lippsemerged -lippdcmerged -lippsmerged -lippcore
-lippcpemerged -lippcpmerged -lsnls12 -lnls12 -lcore12
-lsnls12 -lnls12 -lcore12 -lsnls12 -lnls12 -lxml12
-lcore12 -lunls12 -lsnls12 -lnls12 -lcore12 -lnls12
-lsnls12 -lunls12 -lsnls12 -lnls12 -lcore12 -lsnls12
-lnls12 -lcore12 -lsnls12 -lnls12 -lxml12 -lcore12 -lunls12
-lsnls12 -lnls12 -lcore12 -lnls12 -lasmclnt12 -lcommon12
-lcore12 -class -lons `cat / u01 / app / oracle / product /
12.1.0.2 / dbhome_1 / lib / sysliblist` -Wl, -rpath, / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1 / lib -lm `cat / u01 /
App / oracle / product / 12.1.0.2 / dbhome_1 / lib / sysliblist`
-ldl -lm -L / u01 / app / oracle / product / 12.1.0.2 / dbhome_1 / lib
Test -f /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/oracle || \
Mv -f /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/oracle
/u01/app/oracle/product/12.1.0.2/dbhome_1/bin/oracleO
Mv /u01/app/oracle/product/12.1.0.2/dbhome_1/rdbms/lib/oracle /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 / bin / oracle
Chmod 6751 /u01/app/oracle/product/12.1.0.2/dbhome_1/bin/oracle

Stderr output:
Make Action done
Log file location: /u01/app/oracle/product/12.1.0.2/dbhome_1/
Cfgtoollogs / opatch / opatch2017-01-11_18-39-53PM_1.log

OPatch succeeded.

With the root user set the environment variables for Grid Infrastructure Home.

[Stb1.root@srv-stb1 24448103] $. /home/oracle/.profile_infra

Run the opatchauto analyze to check the prerequisites.

[+ASM1.root@srv-stb1 ~] $ $ ORACLE_HOME / OPatch / opatchauto
Apply / u01 / patch / 24448103 -analyze

System initialization log file is /u01/app/12.1.0.2/grid/
Cfgtoollogs / opatchautodb / systemconfig2017-01-11_07-17-30PM.log.
Session log file is /u01/app/12.1.0.2/grid/cfgtoollogs/
Opatchauto / opatchauto2017-01-11_07-17-54PM.log
The id for this session is G5TU
[Init: init] Executing OPatchAutoBinaryAction action on home
/u01/app/oracle/product/12.1.0.2/dbhome_1
[Init: init] Executing OPatchAutoBinaryAction action on home
/u01/app/12.1.0.2/grid

Executing OPatch prereq operations to verify patch applicability
On RAC Home ........
Executing OPatch prereq operations to verify patch applicability
On CRS Home ........

[Init: init] OPatchAutoBinaryAction action completed on home /
U01 / app / 12.1.0.2 / grid successfully

[Init: init] OPatchAutoBinaryAction action completed on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 successfully
[Init: init] Executing GIRACPrereqAction action on home / u01 /
App / oracle / product / 12.1.0.2 / dbhome_1
[Init: init] Executing GIRACPrereqAction action on home / u01 /
App / 12.1.0.2 / grid

Executing prereq operations before applying on CRS Home ........
Executing prereq operations before applying on RAC Home ........

[Init: init] GIRACPrereqAction action completed on home / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1 successfully
[Init: init] GIRACPrereqAction action completed on home / u01 / app /
12.1.0.2/grid successfully
[Init: init] Executing RACDBPrereqAction action on home / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1

Executing prereq operations before applying on RAC Home ........

[Init: init] RACDBPrereqAction action completed on home / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1 successfully

------------------------- Summary ------------------------ -

Analysis for applying patches has completed successfully:

Host: srv-stb1
CRS Home: /u01/app/12.1.0.2/grid
== Following patches were SKIPPED:

Patch: / u01 / patch / 24448103/21436941
Reason: This patch is already applied, so not going
Apply again.
== Following patches were SUCCESSFULLY analyzed to be applied:

Patch: / u01 / patch / 24448103/24007012
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/
Opatch2017-01-11_19-18-00PM_1.log

Patch: / u01 / patch / 24448103/24340679
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/
Opatch2017-01-11_19-18-00PM_1.log

Patch: / u01 / patch / 24448103/24846605
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/opatch/
Opatch2017-01-11_19-18-00PM_1.log
Host: srv-stb1
RAC Home: /u01/app/oracle/product/12.1.0.2/dbhome_1
== Following patches were SKIPPED:

Patch: / u01 / patch / 24448103/21436941
Reason: This patch is not applicable to this specified target
Type - "rac_database"

Patch: / u01 / patch / 24448103/24007012
Reason: This patch is not applicable to this specified target
Type - "rac_database"
== Following patches were SUCCESSFULLY analyzed to be applied:

Patch: / u01 / patch / 24448103/24340679
Log: /u01/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/
Opatchauto / core / opatch / opatch2017-01-11_19-18-01PM_1.log

Patch: / u01 / patch / 24448103/24846605
Log: /u01/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/
Opatchauto / core / opatch / opatch2017-01-11_19-18-01PM_1.log
OPatchAutosuccessful.

Passing all the prerequisites, follow the 24448103 patch application.

[+ASM1.root@srv-stb1 ~] $ $ ORACLE_HOME / OPatch / opatchauto apply
/ U01 / patch / 24448103

System initialization log file is /u01/app/12.1.0.2/grid/
Cfgtoollogs / opatchautodb / systemconfig2017-01-11_07-24-29PM.log.

Session log file is /u01/app/12.1.0.2/grid/cfgtoollogs/
Opatchauto / opatchauto2017-01-11_07-24-46PM.log
The id for this session is WM33
[Init: init] Executing OPatchAutoBinaryAction action on home /
U01 / app / 12.1.0.2 / grid
[Init: init] Executing OPatchAutoBinaryAction action on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1

Executing OPatch prereq operations to verify patch
Applicability on CRS Home ........
Executing OPatch prereq operations to verify patch
Applicability on RAC Home ........

[Init: init] OPatchAutoBinaryAction action completed on home /
U01 / app / 12.1.0.2 / grid successfully

[Init: init] OPatchAutoBinaryAction action completed on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 successfully
[Init: init] Executing GIRACPrereqAction action on home / u01 /
App / oracle / product / 12.1.0.2 / dbhome_1
[Init: init] Executing GIRACPrereqAction action on home / u01 /
App / 12.1.0.2 / grid

Executing prereq operations before applying on CRS Home ........
Executing prereq operations before applying on RAC Home ........

[Init: init] GIRACPrereqAction action completed on home / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1 successfully
[Init: init] GIRACPrereqAction action completed on home / u01 / app /
12.1.0.2/grid successfully
[Init: init] Executing RACDBPrereqAction action on home / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1

Executing prereq operations before applying on RAC Home ........

[Init: init] RACDBPrereqAction action completed on home / u01 / app /
Oracle / product / 12.1.0.2 / dbhome_1 successfully
[Shutdown: prepare-shutdown] Executing RACPrepareShutDownAction
Action on home /u01/app/oracle/product/12.1.0.2/dbhome_1

Preparing RAC Home to bring down database service ........

[Shutdown: prepare-shutdown] RACPrepareShutDownAction action
Completed on home /u01/app/oracle/product/12.1.0.2/dbhome_1
Successfully

[Shutdown: shutdown] Executing RACOneAction action on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1

/u01/app/oracle/product/12.1.0.2/dbhome_1 is not a RACOne
data base. No step execution required ........

[Shutdown: shutdown] RACOneAction action completed on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 successfully
[Shutdown: shutdown] Executing GIShutDownAction action on
Home /u01/app/12.1.0.2/grid

Performing prepatch operations on CRS Home ........

Prepatch operation log file location: /u01/app/12.1.0.2/
Grid / cfgtoollogs / crsconfig /
Crspatch_srv-stb1_2017-01-11_07-27-40PM.log

[Shutdown: shutdown] GIShutDownAction action completed on
Home /u01/app/12.1.0.2/grid successfully
[Offline: prepare] Executing RACPatchingAction action on
Home /u01/app/oracle/product/12.1.0.2/dbhome_1

Performing prepatch operation on RAC Home ........

[Offline: prepare] RACPatchingAction action completed on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 successfully
[Offline: binary-patching] Executing OPatchAutoBinaryAction
Action on home /u01/app/oracle/product/12.1.0.2/dbhome_1

Start applying binary patches on RAC Home ........
[Offline: binary-patching] OPatchAutoBinaryAction action
Completed on home /u01/app/oracle/product/12.1.0.2/dbhome_1
Successfully

[Offline: finalize] Executing RACPatchingAction action on
Home /u01/app/oracle/product/12.1.0.2/dbhome_1

Performing postpatch operation on RAC Home ........

[Offline: finalize] RACPatchingAction action completed on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 successfully
[Offline: binary-patching] Executing OPatchAutoBinaryAction
Action on home /u01/app/12.1.0.2/grid

Start applying binary patches on CRS Home ........
[Offline: binary-patching] OPatchAutoBinaryAction action
Completed on home /u01/app/12.1.0.2/grid successfully
[Startup: startup] Executing GIStartupAction action on home /
U01 / app / 12.1.0.2 / grid

Performing postpatch operations on CRS Home ........
Postpatch operation log file location: /u01/app/12.1.0.2/
Grid / cfgtoollogs / crsconfig /
Crspatch_srv-stb1_2017-01-11_07-34-12PM.log

[Startup: startup] GIStartupAction action completed on home /
U01 / app / 12.1.0.2 / grid successfully
[Startup: startup] Executing RACOneAction action on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1

/u01/app/oracle/product/12.1.0.2/dbhome_1 is not a RACOne
data base. No step execution required ........

[Startup: startup] RACOneAction action completed on home /
U01 / app / oracle / product / 12.1.0.2 / dbhome_1 successfully
[Startup: finalize] Executing RACFinalizeStartAction action
On home /u01/app/oracle/product/12.1.0.2/dbhome_1

No step execution required .........

[Startup: finalize] RACFinalizeStartAction action completed
On home /u01/app/oracle/product/12.1.0.2/dbhome_1 successfully

[Online: product-patching] Executing RACOnlineAction action
On home /u01/app/oracle/product/12.1.0.2/dbhome_1

Trying to apply SQL patches on RAC Home.

[WARNING] The database instance 'stb1' from '/ u01 / app / oracle /
Product / 12.1.0.2 / dbhome_1 ', in host'srv-stb1' is not running.
SQL changes, if any, will not be applied.

To apply. The SQL changes, bring up the database instance
And run the command manually from any one node (run as oracle).

Refer to the readme to get the correct steps for applying
The sql changes.

[Online: product-patching] RACOnlineAction action completed
On home /u01/app/oracle/product/12.1.0.2/dbhome_1
Successfully

[Finalize: finalize] Executing OracleHomeLSInventoryGrepAction
Action on home /u01/app/12.1.0.2/grid

Verifying patches applied on CRS Home.

[Finalize: finalize] OracleHomeLSInventoryGrepAction action
Completed on home /u01/app/12.1.0.2/grid successfully
[Finalize: finalize] Executing OracleHomeLSInventoryGrepAction
Action on home /u01/app/oracle/product/12.1.0.2/dbhome_1

Verifying patches applied on RAC Home.

[Finalize: finalize] OracleHomeLSInventoryGrepAction action
Completed on home /u01/app/oracle/product/12.1.0.2/dbhome_1
Successfully

--------------------- Summary ---------------------------- ----

Patching is completed successfully. Please find the summary
as follows:

Host: srv-stb1
RAC Home: /u01/app/oracle/product/12.1.0.2/dbhome_1
Summary:

== Following patches were SKIPPED:

Patch: / u01 / patch / 24448103/21436941
Reason: This patch is not applicable to this specified
Target type - "rac_database"

Patch: / u01 / patch / 24448103/24007012
Reason: This patch is not applicable to this specified
Target type - "rac_database"
== Following patches were SUCCESSFULLY applied:

Patch: / u01 / patch / 24448103/24340679
Log: /u01/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/
Opatchauto / core / opatch / opatch2017-01-11_19-28-50PM_1.log

Patch: / u01 / patch / 24448103/24846605
Log: /u01/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/
Opatchauto / core / opatch / opatch2017-01-11_19-28-50PM_1.log
Host: srv-stb1
CRS Home: /u01/app/12.1.0.2/grid
Summary:

== Following patches were SKIPPED:

Patch: / u01 / patch / 24448103/21436941
Reason: This patch is already applied, so not going
To apply again.
== Following patches were SUCCESSFULLY applied:

Patch: / u01 / patch / 24448103/24007012
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/
Opatch / opatch2017-01-11_19-30-22PM_1.log

Patch: / u01 / patch / 24448103/24340679
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/
Opatch / opatch2017-01-11_19-30-22PM_1.log

Patch: / u01 / patch / 24448103/24846605
Log: /u01/app/12.1.0.2/grid/cfgtoollogs/opatchauto/core/
Opatch / opatch2017-01-11_19-30-22PM_1.log
OPatchAutosuccessful.

Re-apply patch 21923026 that we had rolled back.

[Stb1.oracle@srv-stb1 patch] $ unzip
P21923026_12102161018ProactiveBP_Linux-x86-64.zip
Archive: p21923026_12102161018ProactiveBP_Linux-x86-64.zip
Creating: 21923026 /
Inflating: 21923026 / README.txt
Creating: 21923026 / files /
Creating: 21923026 / files / lib /
Creating: 21923026 / files / lib / libserver12.a /
Inflating: 21923026 / files / lib / libserver12.a / kdo.o
Inflating: 21923026 / files / lib / libserver12.a / kdblc.o
Inflating: 21923026 / files / lib / libserver12.a / kd9ir2c.o
Creating: 21923026 / etc /
Creating: 21923026 / etc / config /
Inflating: 21923026 / etc / config / actions.xml
Inflating: 21923026 / etc / config / inventory.xml
Replace PatchSearch.xml? [Y] is, [n] o, [A] ll, [N] one, [r] ename: A
Inflating: PatchSearch.xml

Before applying first check to see if there is any conflict.

[Stb1.oracle@srv-stb1 21923026] $ opatch prereq
CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.1.0.1.12
Copyright (c) 2017, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home: /u01/app/oracle/product/12.1.0.2/
Dbhome_1
Central Inventory: / u01 / app / oraInventory
From: /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / oraInst.loc
OPatch version: 12.1.0.1.12
OUI version: 12.1.0.2.0
Log file location: /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / cfgtoollogs / opatch / opatch2017-01-11_21-01-27PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

Since we are not going to use the opatchauto for this patch, apply the patch in question only to the local node and when we finish this node do the same procedure on the other node.
Apply the patch with the -local option.

[Stb1.oracle@srv-stb1 21923026] $ opatch apply -local
Oracle Interim Patch Installer version 12.1.0.1.12
Copyright (c) 2017, Oracle Corporation. All rights
Reserved.
Oracle Home: /u01/app/oracle/product/12.1.0.2/
Dbhome_1
Central Inventory: / u01 / app / oraInventory
From: /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / oraInst.loc
OPatch version: 12.1.0.1.12
OUI version: 12.1.0.2.0
Log file location: /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / cfgtoollogs / opatch / opatch2017-01-11_21-06-57PM_1.log

Verifying environment and performing prerequisite checks ...
OPatch continues with these patches: 21923026

Do you want to proceed? [Y | n]
And
User Responded with: Y
All checks passed.
Is the local system ready for patching? [Y | n]
And
User Responded with: Y
Backing up files ...
Applying interim patch '21923026' to OH '/ u01 / app / oracle /
Product / 12.1.0.2 / dbhome_1 '

Patching component oracle.rdbms, 12.1.0.2.0 ...
Patch 21923026 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0.2/
Dbhome_1 / cfgtoollogs / opatch /
Opatch2017-01-11_21-06-57PM_1.log

OPatch succeeded.

Now check the applied patches again. Note that the patch we apply is a Bundle Patch that is composed of 4 patches. The patch applied was BP 12.1.0.2.161018 which has the number 24340679.

[Stb1.oracle@srv-stb1 21923026] $ opatch lspatches
21923026;
24846605; OCW Interim patch for 24846605
24340679; DATABASE BUNDLE PATCH: 12.1.0.2.161018 (24340679)
23177536; Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016)
23520664; OCW Interim patch for 23520664

OPatch succeeded.

Now go up the instance again.

[Stb1.oracle@srv-stb1 OPatch] $ srvctl start instance -i stb1 -d stb

Log in to the Broker and change the instance that is running redoapply.

[Stb1.oracle@srv-stb1 u01] $ dgmgrl /

DGMGRL> show database stb;

Database - stb

Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 1.23 MByte / s
Real Time Query: OFF
Instance (s):
Stb1
Stb2 (apply instance)

Database Status:
SUCCESS

DGMGRL> edit database stb set state = apply-off;
Succeeded.
DGMGRL> edit database stb set state = apply-on with apply
Instance = stb1;

Succeeded.
DGMGRL> show database stb;

Database - stb

Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 8.51 MByte / s
Real Time Query: OFF
Instance (s):
Stb1 (apply instance)
Stb2

Database Status:
SUCCESS

Done that is just to repeat the whole procedure in node 2. I will not present here to not be repeated, but the step by step is the same.

References:

https://docs.oracle.com/database/121/HABPT/schedule_outage.htm#HABPT5321

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.