ORACLE 12C ADG installs the latest RU patch
Reference document: How do you apply a Patchset,PSU or CPU in a Data Guard Physical Standby configuration (document ID 278641.1)
-
1. Disable REDO transport on Primary.
-
Sys@ora12c.primary > alter system set log_archive_dest_state_2=defer
-
2. Shutdown the standby site and apply interim patchsets to the RDBMS binaries as per the README.
-
2.1 stop database monitoring and instances
[oracle@oradb2 ~] $lsnrctl stop
Sys@ora12cdg.primary_instance > shudown immediate
2.2 Update OPatch to the latest version [You must use the OPatch utility version 12.2.0.1.14 or later to apply this patch.]
[oracle@oradb2 ~] $mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.20190426
[oracle@oradb2 ~] $mv / oradata/OPatch $ORACLE_HOME
[oracle@oradb2 ~] $$ORACLE_HOME/OPatch/opatch version
2.3 perform patch conflict check
[oracle@oradb2 ~] $cd / oradata/patch/29314339/
[oracle@oradb2 29314339] $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail-ph. /
2.4App 12.2 the latest Release Update 29314339
[oracle@oradb2 ~] $cd / oradata/patch/29314339/
[oracle@oradb2 29314339] $$ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2019, Oracle Corporation. All rights reserved.
2.5 check patch information
[oracle@oradb2 29314339] $$ORACLE_HOME/OPatch/opatch lspatches
Database Apr 2019 Release Update: 12.2.0.1.190416 (29314339)
28163190th OCW JUL 2018 RELEASE UPDATE 12.2.0.1.180717 (28163190)
-
3. Start the standby site to mount only, do not restart managed recovery.
-
[oracle@oradb2 29314339] $lsnrctl start
[oracle@oradb2 29314339] $export ORACLE_SID=ora12cdg
Idle > startup mount
-
4. Shutdown the primary site, apply the Patchset/PSU/CPU patch to the RDBMS binaries and patch the RDBMS itself using the instructions in the README
-
4.1 stop monitoring and main library
[oracle@oradb1 ~] $lsnrctl stop
Sys@ora12c.primary > shutdown immediate
4.2 Update OPatch to the latest version
[oracle@oradb1 ~] $mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.20190426
[oracle@oradb1 ~] $mv / oradata/OPatch $ORACLE_HOME
[oracle@oradb1 ~] $$ORACLE_HOME/OPatch/opatch version
4.3 perform patch conflict check
[oracle@oradb1 ~] $cd / oradata/patch/29314339/
[oracle@oradb1 29314339] $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail-ph. /
4.4App 12.2 latest Release Update 29314339
[oracle@oradb1 29314339] $$ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2019, Oracle Corporation. All rights reserved.
4.5 check patch information
[oracle@oradb1 29314339] $$ORACLE_HOME/OPatch/opatch lspatches
Database Apr 2019 Release Update: 12.2.0.1.190416 (29314339)
28163190th OCW JUL 2018 RELEASE UPDATE 12.2.0.1.180717 (28163190)
4.6 apply database patches
[oracle@oradb1 29314339] $sqlplus / nolog
Idle > conn / as sysdba
Idle > startup
Idle > show pdbs
-- if the pdb status is not READ WRITE, open pdb
Idle > alter pluggable database all open
Idle > exit
[oracle@oradb1 29314339] $cd $ORACLE_HOME/OPatch
[oracle@oradb1 OPatch] $. / datapatch-verbose
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)
SQL Patching tool complete on Fri Apr 26 13:55:24 2019
4.7 check the patch application log
[oracle@oradb1 OPatch] $cd $ORACLE_BASE/cfgtoollogs/sqlpatch/29314339/
Check the following log files in $ORACLE_BASE/cfgtoollogs/sqlpatch/29314339/ for errors:
29314339_apply___.log
4.8 compiling invalid objects
[oracle@oradb1 29314339] $cd $ORACLE_HOME/rdbms/admin
[oracle@oradb1 admin] $sqlplus / nolog
Idle > conn / as sysdba
Sys@ora12c.primary > set linesize 160
Sys@ora12c.primary > col owner for A15
Sys@ora12c.primary > select owner, count (1) from dba_objects where status = 'INVALID' group by owner
Sys@ora12c.primary > @ utlrp.sql
Sys@ora12c.primary > select owner, count (1) from dba_objects where status = 'INVALID' group by owner
-
5. Start the primary site, re-enable log shipping to the standby.
-
Sys@ora12c.primary > alter system set log_archive_dest_state_2=enable
-
6. At the standby site start the MRP (managed recovery).
-
Sys@ora12cdg.physical_standby > alter database open
Sys@ora12cdg.physical_standby > alter database recover managed standby database disconnect from session
-
7. Active / standby handover
-
Sys@ora12c.primary > alter database switchover to ora12cdg verify
Sys@ora12c.primary > alter database switchover to ora12cdg