Apply Oracle Database 18.5.0.0.0.190115 and OJVM 18.5.0.0.0.190115 Release Update( RU )

This exercise describes how you can install below three patches on 18c:

  • Patch 28822489 – Oracle Database Release Update(RU) 18.5.0.0.190115
  • Patch 28864593  – OCW Release Update 18.5.0.0.190115
  • Patch 28790647 – Oracle JavaVM Component Release Update (OJVM RU) 18.5.0.0.0.190115

Apply Patch 28822489 DB RU 18.5.0.0.190115

OPatch utility

Check and make sure opatch version 12.2.0.1.14 or later

[oracle@oemnode1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.19

OPatch succeeded.
[oracle@oemnode1 ~]$

Current Patches Applied onto ORACLE_HOME

[oracle@oemnode1 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
28090553;OCW RELEASE UPDATE 18.3.0.0.0 (28090553)
28090523;Database Release Update : 18.3.0.0.180717 (28090523)

OPatch succeeded.

Check interim patches conflicts

[oracle@oemnode1 ~]$ cd 28822489
[oracle@oemnode1 28822489]$ $ORACLE_HOME/OPatch/opatch  \
                    prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.19
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/Product/18.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/Product/18.0.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.19
OUI version       : 12.2.0.4.0
Log file location : /u01/app/oracle/Product/18.0.0/dbhome_1/
                cfgtoollogs/opatch/opatch2020-04-03_21-19-18PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@oemnode1 28822489]$

Patch Installation

[oracle@oemnode1 28822489]$  $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.19
Copyright (c) 2020, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/Product/18.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/Product/18.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.19
OUI version : 12.2.0.4.0
Log file location : /u01/app/oracle/Product/18.0.0/dbhome_1/cfgtoollogs/opatch/opatch2020-04-03_21-28-36PM_1.log

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

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/Product/18.0.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '28822489' to OH '/u01/app/oracle/Product/18.0.0/dbhome_1'
ApplySession: Optional component(s) [ oracle.assistants.asm, 18.0.0.0.0 ] , [ oracle.net.cman, 18.0.0.0.0 ] , [ oracle.ons.daemon, 18.0.0.0.0 ] , [ oracle.tfa, 18.0.0.0.0 ] , [ oracle.crs, 18.0.0.0.0 ] , [ oracle.network.cman, 18.0.0.0.0 ] , [ oracle.assistants.usm, 18.0.0.0.0 ] , [ oracle.assistants.server.oui, 18.0.0.0.0 ] , [ oracle.has.crs, 18.0.0.0.0 ] not present in the Oracle Home or a higher version is found.
Patching component oracle.oracore.rsf, 18.0.0.0.0...
Patching component oracle.rdbms, 18.0.0.0.0...
Patching component oracle.dbjava.jdbc, 18.0.0.0.0...
Patching component oracle.dbjava.ic, 18.0.0.0.0...
Patching component oracle.network.listener, 18.0.0.0.0...
Patching component oracle.assistants.acf, 18.0.0.0.0...
Patching component oracle.rdbms.rsf.ic, 18.0.0.0.0...
Patching component oracle.server, 18.0.0.0.0...
Patching component oracle.ctx, 18.0.0.0.0...
Patching component oracle.ons, 18.0.0.0.0...
Patching component oracle.rdbms.deconfig, 18.0.0.0.0...
Patching component oracle.rdbms.util, 18.0.0.0.0...
Patching component oracle.sdo.locator.jrf, 18.0.0.0.0...
Patching component oracle.xdk.parser.java, 18.0.0.0.0...
Patching component oracle.assistants.server, 18.0.0.0.0...
Patching component oracle.rdbms.crs, 18.0.0.0.0...
Patching component oracle.rdbms.rman, 18.0.0.0.0...
Patching component oracle.xdk, 18.0.0.0.0...
Patching component oracle.ctx.atg, 18.0.0.0.0...
Patching component oracle.dbjava.ucp, 18.0.0.0.0...
Patching component oracle.install.deinstalltool, 18.0.0.0.0...
Patching component oracle.rdbms.dbscripts, 18.0.0.0.0...
Patching component oracle.rdbms.rsf, 18.0.0.0.0...
Patching component oracle.xdk.rsf, 18.0.0.0.0...
Patching component oracle.network.client, 18.0.0.0.0...
Patching component oracle.rdbms.install.plugins, 18.0.0.0.0...
Patching component oracle.sdo, 18.0.0.0.0...
Patching component oracle.rdbms.oci, 18.0.0.0.0...
Patching component oracle.ctx.rsf, 18.0.0.0.0...
Patching component oracle.oraolap.dbscripts, 18.0.0.0.0...
Patching component oracle.assistants.deconfig, 18.0.0.0.0...
Patching component oracle.nlsrtl.rsf, 18.0.0.0.0...
Patching component oracle.precomp.rsf, 18.0.0.0.0...
Patching component oracle.network.rsf, 18.0.0.0.0...
Patching component oracle.sqlplus.ic, 18.0.0.0.0...
Patching component oracle.sdo.locator, 18.0.0.0.0...
Patching component oracle.nlsrtl.rsf.core, 18.0.0.0.0...
Patching component oracle.sqlplus, 18.0.0.0.0...
Patching component oracle.javavm.client, 18.0.0.0.0...
Patching component oracle.ldap.owm, 18.0.0.0.0...
Patching component oracle.ldap.security.osdt, 18.0.0.0.0...
Patching component oracle.rdbms.install.common, 18.0.0.0.0...
Patching component oracle.precomp.lang, 18.0.0.0.0...
Patching component oracle.precomp.common, 18.0.0.0.0...
Patch 28822489 successfully applied.
Sub-set patch [28090523] has become inactive due to the application of a super-set patch [28822489].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/Product/18.0.0/dbhome_1/cfgtoollogs/opatch/opatch2020-04-03_21-28-36PM_1.log

OPatch succeeded.

Apply Patch 28864593  – OCW Release Update 18.5.0.0.190115

Run prepatch.sh

[oracle@oemnode1 28864593]$ custom/scripts/prepatch.sh -dbhome $ORACLE_HOME
custom/scripts/prepatch.sh completed successfully.
[oracle@oemnode1 28864593]$

Apply OCW patch 28864593

[oracle@oemnode1 28864593]$ $ORACLE_HOME/OPatch/opatch napply -local -oh $ORACLE_HOME -id 28864593
Oracle Interim Patch Installer version 12.2.0.1.19
Copyright (c) 2020, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/Product/18.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/Product/18.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.19
OUI version : 12.2.0.4.0
Log file location : /u01/app/oracle/Product/18.0.0/dbhome_1/cfgtoollogs/opatch/opatch2020-04-04_13-11-10PM_1.log

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

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/Product/18.0.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '28864593' to OH '/u01/app/oracle/Product/18.0.0/dbhome_1'
ApplySession: Optional component(s) [ oracle.crs, 18.0.0.0.0 ] , [ oracle.has.crs, 18.0.0.0.0 ] , [ oracle.has.cvu, 18.0.0.0.0 ] , [ oracle.has.deconfig, 18.0.0.0.0 ] not present in the Oracle Home or a higher version is found.

Patching component oracle.server, 18.0.0.0.0...

Patching component oracle.rdbms, 18.0.0.0.0...

Patching component oracle.has.db, 18.0.0.0.0...

Patching component oracle.has.common, 18.0.0.0.0...

Patching component oracle.has.common.cvu, 18.0.0.0.0...

Patching component oracle.has.rsf, 18.0.0.0.0...
Patch 28864593 successfully applied.
Sub-set patch [28090553] has become inactive due to the application of a super-set patch [28864593].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/Product/18.0.0/dbhome_1/cfgtoollogs/opatch/opatch2020-04-04_13-11-10PM_1.log

OPatch succeeded.

Run postpatch.sh

[oracle@oemnode1 28864593]$ custom/scripts/postpatch.sh -dbhome $ORACLE_HOME
Reading /u01/app/oracle/Product/18.0.0/dbhome_1/install/params.ora..
Reading /u01/app/oracle/Product/18.0.0/dbhome_1/install/params.ora..
Found uninstantiated /u01/app/oracle/Product/18.0.0/dbhome_1/crs/sbs/srvctl.sbs file, copying to /u01/app/oracle/Product/18.0.0/dbhome_1/bin/srvctl
Parsing file /u01/app/oracle/Product/18.0.0/dbhome_1/bin/srvctl
Parsing file /u01/app/oracle/Product/18.0.0/dbhome_1/bin/srvconfig
Parsing file /u01/app/oracle/Product/18.0.0/dbhome_1/bin/cluvfy
Verifying file /u01/app/oracle/Product/18.0.0/dbhome_1/bin/srvctl
Verifying file /u01/app/oracle/Product/18.0.0/dbhome_1/bin/srvconfig
Verifying file /u01/app/oracle/Product/18.0.0/dbhome_1/bin/cluvfy
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/srvctl
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/srvconfig
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/cluvfy
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/diskmon.bin
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/lsnodes
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/osdbagrp
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/rawutl
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/srvm/admin/ractrans
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/srvm/admin/getcrshome
Reapplying file permissions on /u01/app/oracle/Product/18.0.0/dbhome_1/bin/crsdiag.pl
Postpatch completed successfully
[oracle@oemnode1 28864593]$

Patch Post-Installation Instructions

[oracle@oemnode1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Fri Apr 3 21:46:04 2020
Version 18.5.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 3221221872 bytes
Fixed Size 8901104 bytes
Variable Size 805306368 bytes
Database Buffers 2399141888 bytes
Redo Buffers 7872512 bytes
Database mounted.
Database opened.
SQL> quit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0

[oracle@oemnode1 ~]$ cd $ORACLE_HOME/OPatch
[oracle@oemnode1 OPatch]$ ./datapatch -verbose
SQL Patching tool version 18.0.0.0.0 Production on Fri Apr 3 21:46:48 2020
Copyright (c) 2012, 2018, Oracle. All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_11020_2020_04_03_21_46_48/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

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)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)):
Binary registry: Installed
PDB CDB$ROOT: Applied successfully on 26-MAR-20 05.51.52.699750 PM
PDB EMPDBREPOS: Applied successfully on 26-MAR-20 05.51.54.759763 PM
PDB PDB$SEED: Applied successfully on 26-MAR-20 05.51.53.740088 PM

Current state of release update SQL patches:
Binary registry:
18.5.0.0.0 Release_Update 1812161059: Installed
PDB CDB$ROOT:
Applied 18.3.0.0.0 Release_Update 1806280943 successfully on 26-MAR-20 05.51.52.694743 PM
PDB EMPDBREPOS:
Applied 18.3.0.0.0 Release_Update 1806280943 successfully on 26-MAR-20 05.51.54.754836 PM
PDB PDB$SEED:
Applied 18.3.0.0.0 Release_Update 1806280943 successfully on 26-MAR-20 05.51.53.734922 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED EMPDBREPOS
No interim patches need to be rolled back
Patch 28822489 (Database Release Update : 18.5.0.0.190115 (28822489)):
Apply from 18.3.0.0.0 Release_Update 1806280943 to 18.5.0.0.0 Release_Update 1812161059
No interim patches need to be applied

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

Validating logfiles...done
Patch 28822489 apply (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28822489/22669539/28822489_apply_OEMREP_CDBROOT_2020Apr03_21_47_05.log (no errors)
Patch 28822489 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28822489/22669539/28822489_apply_OEMREP_PDBSEED_2020Apr03_21_47_41.log (no errors)
Patch 28822489 apply (pdb EMPDBREPOS): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28822489/22669539/28822489_apply_OEMREP_EMPDBREPOS_2020Apr03_21_47_41.log (no errors)
SQL Patching tool complete on Fri Apr 3 21:48:03 2020
[oracle@oemnode1 OPatch]$
[oracle@oemnode1 OPatch]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Fri Apr 3 21:55:31 2020
Version 18.5.0.0.0

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


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

Session altered.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2020-04-03 21:56:10

DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2020-04-03 21:56:12

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC> logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.

SQL>

Patch 28790647 – OJVM RU 18.5.0.0.0.190115

Check interim patches conflict.

[oracle@oemnode1 28980105]$ cd 28790647
[oracle@oemnode1 28790647]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.19
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/Product/18.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/Product/18.0.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.19
OUI version       : 12.2.0.4.0
Log file location : /u01/app/oracle/Product/18.0.0/dbhome_1/cfgtoollogs/opatch/opatch2020-04-04_13-21-27PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@oemnode1 28790647]$

Apply OJVM patch

[oracle@oemnode1 28790647]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.19
Copyright (c) 2020, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/oracle/Product/18.0.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/Product/18.0.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.19
OUI version : 12.2.0.4.0
Log file location : /u01/app/oracle/Product/18.0.0/dbhome_1/cfgtoollogs/opatch/opatch2020-04-04_13-27-45PM_1.log

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

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/Product/18.0.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '28790647' to OH '/u01/app/oracle/Product/18.0.0/dbhome_1'

Patching component oracle.javavm.server, 18.0.0.0.0...

Patching component oracle.javavm.server.core, 18.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 18.0.0.0.0...

Patching component oracle.rdbms, 18.0.0.0.0...

Patching component oracle.javavm.client, 18.0.0.0.0...
Patch 28790647 successfully applied.
Sub-set patch [27923415] has become inactive due to the application of a super-set patch [28790647].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/Product/18.0.0/dbhome_1/cfgtoollogs/opatch/opatch2020-04-04_13-27-45PM_1.log

OPatch succeeded.
[oracle@oemnode1 28790647]$

Post-installation of OJVM patch

[oracle@oemnode1 28790647]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Sat Apr 4 13:30:47 2020
Version 18.5.0.0.0

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

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 3221221872 bytes
Fixed Size 8901104 bytes
Variable Size 805306368 bytes
Database Buffers 2399141888 bytes
Redo Buffers 7872512 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open upgrade;

Pluggable database altered.

SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0
[oracle@oemnode1 28790647]$ cd $ORACLE_HOME/OPatch
[oracle@oemnode1 OPatch]$ ./datapatch -verbose
SQL Patching tool version 18.0.0.0.0 Production on Sat Apr 4 13:32:08 2020
Copyright (c) 2012, 2018, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_8329_2020_04_04_13_32_08/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

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)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
Interim patch 27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)):
Binary registry: Not installed
PDB CDB$ROOT: Applied successfully on 26-MAR-20 05.51.52.699750 PM
PDB EMPDBREPOS: Applied successfully on 26-MAR-20 05.51.54.759763 PM
PDB PDB$SEED: Applied successfully on 26-MAR-20 05.51.53.740088 PM
Interim patch 28790647 (OJVM RELEASE UPDATE: 18.5.0.0.190115 (28790647)):
Binary registry: Installed
PDB CDB$ROOT: Not installed
PDB EMPDBREPOS: Not installed
PDB PDB$SEED: Not installed

Current state of release update SQL patches:
Binary registry:
18.5.0.0.0 Release_Update 1812161059: Installed
PDB CDB$ROOT:
Applied 18.5.0.0.0 Release_Update 1812161059 successfully on 03-APR-20 09.48.00.268791 PM
PDB EMPDBREPOS:
Applied 18.5.0.0.0 Release_Update 1812161059 successfully on 03-APR-20 09.48.01.866401 PM
PDB PDB$SEED:
Applied 18.5.0.0.0 Release_Update 1812161059 successfully on 03-APR-20 09.48.01.071569 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED EMPDBREPOS
The following interim patches will be rolled back:
27923415 (OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415))
No release update patches need to be installed
The following interim patches will be applied:
28790647 (OJVM RELEASE UPDATE: 18.5.0.0.190115 (28790647))

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

Validating logfiles...done
Patch 27923415 rollback (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923415/22239273/27923415_rollback_OEMREP_CDBROOT_2020Apr04_13_32_21.log (no errors)
Patch 28790647 apply (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28790647/22592236/28790647_apply_OEMREP_CDBROOT_2020Apr04_13_32_39.log (no errors)
Patch 27923415 rollback (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923415/22239273/27923415_rollback_OEMREP_PDBSEED_2020Apr04_13_32_40.log (no errors)
Patch 28790647 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28790647/22592236/28790647_apply_OEMREP_PDBSEED_2020Apr04_13_32_45.log (no errors)
Patch 27923415 rollback (pdb EMPDBREPOS): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27923415/22239273/27923415_rollback_OEMREP_EMPDBREPOS_2020Apr04_13_32_40.log (no errors)
Patch 28790647 apply (pdb EMPDBREPOS): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/28790647/22592236/28790647_apply_OEMREP_EMPDBREPOS_2020Apr04_13_32_45.log (no errors)
SQL Patching tool complete on Sat Apr 4 13:32:46 2020
[oracle@oemnode1 OPatch]$ sqlplus / as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Sat Apr 4 13:33:09 2020
Version 18.5.0.0.0

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


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.5.0.0.0

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 3221221872 bytes
Fixed Size 8901104 bytes
Variable Size 805306368 bytes
Database Buffers 2399141888 bytes
Redo Buffers 7872512 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

Session altered.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2020-04-04 13:34:51

DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#

PL/SQL procedure successfully completed.


TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2020-04-04 13:34:52

DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#

OBJECTS WITH ERRORS
-------------------
0

DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC> logged into this table: they go into DBA_ERRORS instead.
DOC>#

ERRORS DURING RECOMPILATION
---------------------------
0


Function created.


PL/SQL procedure successfully completed.


Function dropped.


PL/SQL procedure successfully completed.

SQL>

Final checks

[oracle@oemnode1 OPatch]$ ./opatch lspatches
28790647;OJVM RELEASE UPDATE: 18.5.0.0.190115 (28790647)
28864593;OCW RELEASE UPDATE 18.5.0.0.0 (28864593)
28822489;Database Release Update : 18.5.0.0.190115 (28822489)
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171

OPatch succeeded.
[oracle@oemnode1 OPatch]$
SQL>select COMP_NAME, VERSION, STATUS from dba_registry order by 1;

COMP_NAME                                VERSION        STATUS
---------------------------------------- ------------- --------------
JServer JAVA Virtual Machine             18.0.0.0.0    VALID
OLAP Analytic Workspace                  18.0.0.0.0    VALID
Oracle Database Catalog Views            18.0.0.0.0    VALID
Oracle Database Java Packages            18.0.0.0.0    VALID
Oracle Database Packages and Types       18.0.0.0.0    VALID
Oracle Database Vault                    18.0.0.0.0    VALID
Oracle Label Security                    18.0.0.0.0    VALID
Oracle Multimedia                        18.0.0.0.0    VALID
Oracle OLAP API                          18.0.0.0.0    VALID
Oracle Real Application Clusters         18.0.0.0.0    OPTION OFF
Oracle Text                              18.0.0.0.0    VALID
Oracle Workspace Manager                 18.0.0.0.0    VALID
Oracle XDK                               18.0.0.0.0    VALID
Oracle XML Database                      18.0.0.0.0    VALID
Spatial                                  18.0.0.0.0    VALID
15 rows selected.
SQL> select PATCH_ID, PATCH_TYPE, ACTION, STATUS, DESCRIPTION 
      from dba_registry_sqlpatch order by 1;

 PATCH_ID  PATCH_TYPE ACTION     STATUS    DESCRIPTION
---------- ---------- ---------- --------- ------------------------
  27923415 INTERIM    APPLY      SUCCESS   OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
  27923415 INTERIM    ROLLBACK   SUCCESS   OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
  28090523 RU         APPLY      SUCCESS   Database Release Update : 18.3.0.0.180717 (28090523)
  28790647 INTERIM    APPLY      SUCCESS   OJVM RELEASE UPDATE: 18.5.0.0.190115 (28790647)
  28822489 RU         APPLY      SUCCESS   Database Release Update : 18.5.0.0.190115 (28822489)

Lists all the inactive patches

Those patches have been superseded by other superset patch(es)

[oracle@oemnode1 OPatch]$ $ORACLE_HOME/OPatch/opatch lsinv -inactive

...
..
.
Inactive patches (3) :

Patch 27923415 : applied on Mon Oct 08 10:19:18 AEDT 2018
Unique Patch ID: 22239273
Patch description: "OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)"
Created on 15 Jul 2018, 10:33:22 hrs PST8PDT
Bugs fixed:
27304131, 27539876, 27952586, 27642235, 27636900, 27461740

Patch 28090553 : applied on Mon Oct 08 10:17:51 AEDT 2018
Unique Patch ID: 22256940
Patch description: "OCW RELEASE UPDATE 18.3.0.0.0 (28090553)"
Created on 12 Aug 2018, 23:01:26 hrs PST8PDT
...
..
.
Patch 28090523 : applied on Mon Oct 08 10:17:15 AEDT 2018
Unique Patch ID: 22329768
Patch description: "Database Release Update : 18.3.0.0.180717 (28090523)"
Created on 14 Jul 2018, 00:03:50 hrs PST8PDT
...
..
.
OPatch succeeded.
Advertisement

Apply GI Jan 2020 Release Update 12.2.0.1.200114 ( RU) Patch

This exercise is to apply Patch 30501932 – GI Jan 2020 Release Update 12.2.0.1.200114

Here is the GI environment to be patched:

GI HOME:  12.2.0.1.190716
DB HOMES: 12.2.0.1.190716

Patches downloaded :

Patch 30501932 - GI Jan 2020 Release Update 12.2.0.1.200114
Patch NumberDescriptionApplicable Homes
30593149Database Jan 2020 Release Update 12.2.0.1.200114Only DB Home for non-Oracle RAC setup. Both DB Homes and Grid Home for Oracle RAC setup.
30585969OCW Jan 2020 Release Update 12.2.0.1.200114Both DB Homes and Grid Home
30586063ACFS Jan 2020 Release Update 12.2.0.1.200114Only Grid Home
26839277DBWLM Release Update 12.2.0.1.170913Only Grid Home
30591794Tomcat Release Update 12.2.0.1.0Only Grid Home
Patch 30501932

1) Check and install the latest OPatch utility , which should be greater than 12.2.0.1.17 on all RAC nodes for both GI and DB HOMES.

[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$

2) Run OPatch Conflict Check.

First run as GI owner grid user:

[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/30501932/30593149
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/30501932/30585969 
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/30501932/30586063 
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/30501932/26839277
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/30501932/30591794

Now run as DB owner grid user:

[oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/30501932/30593149
[oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/30501932/30585969

3)Run OPatch SystemSpace Check:

Check if enough free space is available on the ORACLE_HOME filesystem for the patches to be applied as given below:

  • For Grid Infrastructure Home, as home user grid:
    1. Create file /tmp/patch_list_gihome.txt with the following content:
      [grid@racnode1 ~]$ cat /tmp/patch_list_gihome.txt
      /media/sf_Software/12201-190115/29708822/29708478
      /media/sf_Software/12201-190115/29708822/29263382
      /media/sf_Software/12201-190115/29708822/28864846
      /media/sf_Software/12201-190115/29708822/26839277
      /media/sf_Software/12201-190115/29708822/28566910
    2. Run the opatch command to check if enough free space is available in the Grid Infrastructure Home:
      [grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
      Oracle Interim Patch Installer version 12.2.0.1.18
      Copyright (c) 2020, Oracle Corporation.  All rights reserved.
      
      PREREQ session
      
      Oracle Home       : /u01/app/12.2.0.1/grid
      Central Inventory : /u01/app/oraInventory
         from           : /u01/app/12.2.0.1/grid/oraInst.loc
      OPatch version    : 12.2.0.1.18
      OUI version       : 12.2.0.1.4
      Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-03-07_15-12-59PM_1.log
      
      Invoking prereq "checksystemspace"
      
      Prereq "checkSystemSpace" passed.
      
      OPatch succeeded.

      For Database home, as home user oracle:

      1. Create file /tmp/patch_list_dbhome.txt with the following content:
        [oracle@racnode1 ~]$ cat /tmp/patch_list_dbhome.txt
        /media/sf_Software/12201-190115/30501932/30593149
        /media/sf_Software/12201-190115/30501932/30585969
        [oracle@racnode1 ~]$
        
      2. Run opatch command to check if enough free space is available in the Database Home:
        [oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
        Oracle Interim Patch Installer version 12.2.0.1.18
        Copyright (c) 2020, Oracle Corporation.  All rights reserved.
        
        PREREQ session
        
        Oracle Home       : /u01/app/oracle/product/12.2.0/dbhome_1
        Central Inventory : /u01/app/oraInventory
           from           : /u01/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
        OPatch version    : 12.2.0.1.18
        OUI version       : 12.2.0.1.4
        Log file location : /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2020-03-07_15-16-25PM_1.log
        
        Invoking prereq "checksystemspace"
        
        Prereq "checkSystemSpace" passed.
        
        OPatch succeeded.
        [oracle@racnode1 ~]$

4) One-off patch conflict detection in both the 12.2.0.1 GI home and the 12.2.0.1 DB homes.

  • In case you are applying the patch, run this command:
    [root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto apply /media/sf_Software/12201-190115/30501932 -analyze 
    [root@racnode1 ~]#
  • In case you are rolling back the patch, run this command:
    #/u01/app/12.2.0.1/grid/OPatch/opatchauto rollback /media/sf_Software/12201-190115/30501932 -analyze
    #

5) Patch both 12.2.0.2 GI and 12.2.0.1 DB home by running “opatchauto” as root user.

[root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto  
                apply /media/sf_Software/12201-190115/30501932

6) Please repeat step 1 to 5 on node 2.

7)Run “datapatch” or post patch SQL as per instructions, if ‘opatchauto’ is not used. In this situation, this step is not required because we have used opatchauto to patch both GI and DB HOME.

On the node  last patched, check the log. Please note if a PDB is not OPEN,  the post patch SQL will not be applied onto this PDB, it has to be manually applied later.

[root@racnode2 ~]#  ls -ltr /u01/app/oracle/cfgtoollogs/sqlpatch/30593149/23299902
total 18556
-rw-r--r-- 1 oracle oinstall 6177501 Mar  7 17:31 30593149_apply_RACTESTB_CDBROOT_2020Mar07_17_29_24.log
-rw-r--r-- 1 oracle oinstall 6409294 Mar  7 17:34 30593149_apply_RACTESTB_PDBSEED_2020Mar07_17_32_40.log
-rw-r--r-- 1 oracle oinstall 6409298 Mar  7 17:35 30593149_apply_RACTESTB_RACTESTBPDB_2020Mar07_17_32_40.log
[root@racnode2 ~]#

8) Check the patches applied.

a) Run ‘opatch lsinventory’ against both GI and DB homes.

As GI Home owner grid user:

[grid@racnode1]$ opatch lsinventory
...
..
Oracle Grid Infrastructure 12c                                       12.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (5) :

Patch  30593149     : applied on Sat Mar 07 15:42:08 AEDT 2020
Unique Patch ID:  23299902
Patch description:  "Database Jan 2020 Release Update : 12.2.0.1.200114 (30593149)"
   Created on 28 Dec 2019, 10:44:46 hrs PST8PDT
   Bugs fixed:
...
..
.

As DB Home owner oracle user:

[oracle@racnode1]$ opatch lsinventory
..
..
Interim patches (2) :

Patch  30593149     : applied on Sat Mar 07 15:38:38 AEDT 2020
Unique Patch ID:  23299902
Patch description:  "Database Jan 2020 Release Update : 12.2.0.1.200114 (30593149)"
   Created on 28 Dec 2019, 10:44:46 hrs PST8PDT
   Bugs fixed:
     30125995, 8480838, 8932139, 12763598, 13554903, 14221306, 14690846
...
..

b) Query any DB database .

SQL>  select PATCH_ID, VERSION, ACTION, STATUS, DESCRIPTION 
      from dba_registry_sqlpatch;

  PATCH_ID VERSION              ACTION          STATUS                    DESCRIPTION
---------- -------------------- --------------- ------------------------- ----------------------------------------------------------------------------------------------------
  28822515 12.2.0.1             APPLY           SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  28822515 12.2.0.1             ROLLBACK        SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  29230950 12.2.0.1             APPLY           SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416
  29230950 12.2.0.1             ROLLBACK        SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416
  29708478 12.2.0.1             APPLY           SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190716
  29708478 12.2.0.1             ROLLBACK        WITH ERRORS               DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190716
  30593149 12.2.0.1             APPLY           SUCCESS                   DATABASE JAN 2020 RELEASE UPDATE 12.2.0.1.200114

7 rows selected.

c) Query -MGMTDB:

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> show parameter instance_name;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string -MGMTDB
SQL>

SQL> select PATCH_ID, VERSION, ACTION, STATUS, DESCRIPTION 
     from dba_registry_sqlpatch;

 PATCH_ID VERSION              ACTION          STATUS                    ACTION_TIME                                                                 DESCRIPTION
---------- -------------------- --------------- ------------------------- --------------------------------------------------------------------------- ------------------------------------------------------------
  28822515 12.2.0.1             APPLY           SUCCESS                   27-FEB-20 10.03.25.304409 PM                                                DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  28822515 12.2.0.1             ROLLBACK        SUCCESS                   05-MAR-20 10.21.16.554049 PM                                                DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  29230950 12.2.0.1             APPLY           SUCCESS                   05-MAR-20 10.21.17.546585 PM                                                DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416
  29230950 12.2.0.1             ROLLBACK        SUCCESS                   07-MAR-20 11.40.37.212051 AM                                                DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416
  29708478 12.2.0.1             APPLY           SUCCESS                   07-MAR-20 11.40.39.815732 AM                                                DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190716
  29708478 12.2.0.1             ROLLBACK        WITH ERRORS               07-MAR-20 03.54.44.017473 PM                                                DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190716
  30593149 12.2.0.1             APPLY           SUCCESS                   07-MAR-20 03.54.45.345308 PM                                                DATABASE JAN 2020 RELEASE UPDATE 12.2.0.1.200114
  29708478 12.2.0.1             ROLLBACK        SUCCESS                   07-MAR-20 04.54.54.703065 PM                                                DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190716

8 rows selected.

9) Recompile invalid objects if any.

SQL> select owner, count(*) 
     from dba_objects 
     where status!='VALID' group by owner;

no rows selected

If the OJVM RU or RUR is also installed, you may see invalid objects after execution of datapatch in the previous step. If this is the case, run utlrp.sql to re-validate these objects.

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

10)  Upgrade Oracle Recovery Manager Catalog.

If you are using the Oracle Recovery Manager, the catalog needs to be upgraded. Enter the following command to upgrade it. The UPGRADE CATALOG command must be entered twice to confirm the upgrade.

$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
RMAN> UPGRADE CATALOG;
RMAN> EXIT;

Apply GI 12.2.0.1.190716 Release Update Revision 2 ( RUR) Patch

This exercise is to apply Patch 29708822 – GI Jan 2019 Release Update Revision 12.2.0.1.190716.

Here is the GI environment to be patched:

GI HOME:  12.2.0.1.190416
DB HOMES: 12.2.0.1.190416

Patches downloaded :

Patch 29708822 - GI Jan 2019 Release Update Revision 12.2.0.1.190716
Patch Number Description Applicable Homes
29708478 Database Jan 2019 Release Update Revision 12.2.0.1.190716 Only DB Home for non-Oracle RAC setup. Both DB Homes and Grid Home for Oracle RAC setup.
29263382 OCW Jan 2019 Release Update Revision 12.2.0.1.190416 Both DB Homes and Grid Home
28864846 ACFS Jan 2019 Release Update 12.2.0.1.190115 Only Grid Home
26839277 DBWLM Release Update 12.2.0.1.170913 Only Grid Home
28566910 Tomcat Release Update 12.2.0.1.0 Only Grid Home

1) Check and install the latest OPatch utility , which should be greater than 12.2.0.1.14 on all RAC nodes .

[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$

2) Run OPatch Conflict Check.

First run as GI owner grid user:

[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29708822/29708478
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29708822/29263382
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29708822/28864846
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29708822/26839277
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29708822/28566910

Now run as DB owner grid user:

[oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29708822/29708478
[oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29708822/29263382

3)Run OPatch SystemSpace Check:

Check if enough free space is available on the ORACLE_HOME filesystem for the patches to be applied as given below:

  • For Grid Infrastructure Home, as home user grid:
    1. Create file /tmp/patch_list_gihome.txt with the following content:
      [grid@racnode1 ~]$ cat /tmp/patch_list_gihome.txt
      /media/sf_Software/12201-190115/29708822/29708478
      /media/sf_Software/12201-190115/29708822/29263382
      /media/sf_Software/12201-190115/29708822/28864846
      /media/sf_Software/12201-190115/29708822/26839277
      /media/sf_Software/12201-190115/29708822/28566910
    2. Run the opatch command to check if enough free space is available in the Grid Infrastructure Home:
      [grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
      Oracle Interim Patch Installer version 12.2.0.1.18
      Copyright (c) 2020, Oracle Corporation.  All rights reserved.
      
      PREREQ session
      
      Oracle Home       : /u01/app/12.2.0.1/grid
      Central Inventory : /u01/app/oraInventory
         from           : /u01/app/12.2.0.1/grid/oraInst.loc
      OPatch version    : 12.2.0.1.18
      OUI version       : 12.2.0.1.4
      Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-03-07_11-08-09AM_1.log
      
      Invoking prereq "checksystemspace"
      
      Prereq "checkSystemSpace" passed.
      OPatch succeeded.

      For Database home, as home user oracle:

      1. Create file /tmp/patch_list_dbhome.txt with the following content:
        [oracle@racnode1 ~]$ cat /tmp/patch_list_dbhome.txt
        /media/sf_Software/12201-190115/29708822/29708478
        /media/sf_Software/12201-190115/29708822/29263382
        [oracle@racnode1 ~]$
        
      2. Run opatch command to check if enough free space is available in the Database Home:
        [oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
        Oracle Interim Patch Installer version 12.2.0.1.18
        Copyright (c) 2020, Oracle Corporation.  All rights reserved.
        
        PREREQ session
        
        Oracle Home       : /u01/app/oracle/product/12.2.0/dbhome_1
        Central Inventory : /u01/app/oraInventory
           from           : /u01/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
        OPatch version    : 12.2.0.1.18
        OUI version       : 12.2.0.1.4
        Log file location : /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2020-03-07_11-11-23AM_1.log
        
        Invoking prereq "checksystemspace"
        
        Prereq "checkSystemSpace" passed.
        
        OPatch succeeded.
        [oracle@racnode1 ~]$

4) Check for conflicts in both the 12.2.0.1 GI home and the 12.2.0.1 DB homes.

  • In case you are applying the patch, run this command:
    [root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto apply /media/sf_Software/12201-190115/29708822 -analyze 
    [root@racnode1 ~]#
  • In case you are rolling back the patch, run this command:
    #/u01/app/12.2.0.1/grid/OPatch/opatchauto rollback /media/sf_Software/12201-190115/29708822 -analyze
    
    

5) Patch both 12.2.0.2 GI and 12.2.0.1 DB home by running “opatchauto” as root user.

[root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto  
                apply /media/sf_Software/12201-190115/29708822

6) Please repeat step 1 to 5 on node 2.

7)Run “datapatch” or post patch SQL as per instructions, if ‘opatchauto’ is not used. In this situation, this step is not required because we have used opatchauto to patch both GI and DB HOME.

On the node was last patched, check the log. Please note if a PDB is not OPEN,  the post patch SQL will not be applied onto this PDB, it has to be manually applied later.

[root@racnode2 ~]# ls -ltr /u01/app/oracle/cfgtoollogs/sqlpatch/29708478/22988073
total 14120
-rw-r--r-- 1 oracle oinstall 4783857 Mar  7 12:08 29708478_apply_RACTESTB_CDBROOT_2020Mar07_12_07_58.log
-rw-r--r-- 1 oracle oinstall 4833929 Mar  7 12:11 29708478_apply_RACTESTB_RACTESTBPDB_2020Mar07_12_10_08.log
-rw-r--r-- 1 oracle oinstall 4833925 Mar  7 12:11 29708478_apply_RACTESTB_PDBSEED_2020Mar07_12_10_10.log
[root@racnode2 ~]#

8) Check the patches applied.

a) Run ‘opatch lsinventory’ against both GI and DB homes.

As GI Home owner grid user:

[grid@racnode1]$ opatch lsinventory
...
..
Oracle Grid Infrastructure 12c                                       12.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (5) :

Patch  29708478     : applied on Sat Mar 07 11:28:36 AEDT 2020
Unique Patch ID:  22988073
Patch description:  "Database Jan 2019 Release Update Revision : 12.2.0.1.190716 (29708478)"
   Created on 26 Jun 2019, 03:34:53 hrs PST8PDT
   Bugs fixed:
     8480838, 8932139, 13554903, 14221306, 14690846, 15931756, 16002385

As DB Home owner oracle user:

[oracle@racnode1]$ opatch lsinventory
..
..
Oracle Database 12c 12.2.0.1.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :

Patch 29708478 : applied on Sat Mar 07 11:27:44 AEDT 2020
Unique Patch ID: 22988073
Patch description: "Database Jan 2019 Release Update Revision : 12.2.0.1.190716 (29708478)"
Created on 26 Jun 2019, 03:34:53 hrs PST8PDT
Bugs fixed:
...
..

b) Query database .

SQL>  select PATCH_ID, VERSION, ACTION, STATUS, DESCRIPTION 
      from dba_registry_sqlpatch;

  PATCH_ID VERSION              ACTION          STATUS                    DESCRIPTION
---------- -------------------- --------------- ------------------------- ----------------------------------------------------------------------------------------------------
  28822515 12.2.0.1             APPLY           SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  28822515 12.2.0.1             ROLLBACK        SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  29230950 12.2.0.1             APPLY           SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416
  29230950 12.2.0.1             ROLLBACK        SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416
  29708478 12.2.0.1             APPLY           SUCCESS                   DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190716

9) Recompile invalid objects if any.

SQL> select owner, count(*) 
     from dba_objects 
     where status!='VALID' group by owner;

no rows selected

If the OJVM RU or RUR is also installed, you may see invalid objects after execution of datapatch in the previous step. If this is the case, run utlrp.sql to re-validate these objects.

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

Apply GI 12.2.0.1.190416 Release Update Revision 1 ( RUR) Patch

This exercise is to apply patch 29231084 – GI Jan 2019 Release Update Revision 12.2.0.1.190416

Here is the GI environment to be patched:

GI HOME:  12.2.0.1.190115
DB HOMES: 12.2.0.1.190115

Patches downloaded :

Patch 29231084 - GI Jan 2019 Release Update Revision 12.2.0.1.190416
29230950 Database Jan 2019 Release Update Revision 12.2.0.1.190416 Only DB Home for non-Oracle RAC setup. Both DB Homes and Grid Home for Oracle RAC setup.
29263382 OCW Jan 2019 Release Update Revision 12.2.0.1.190416 Both DB Homes and Grid Home
28864846 ACFS Jan 2019 Release Update 12.2.0.1.190115 Only Grid Home
26839277 DBWLM Release Update 12.2.0.1.170913 Only Grid Home
28566910 Tomcat Release Update 12.2.0.1.0 Only Grid Home

1) Check and install the latest OPatch utility , which should be greater than 12.2.0.1.14 on all RAC nodes .

[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$

2) Run OPatch Conflict Check.

First run as GI owner grid user:

[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29231084/29230950
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29231084/29263382
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29231084/28864846
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29231084/26839277
[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29231084/28566910

Now run as DB owner grid user:

[oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29231084/29230950 
[oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/29231084/29263382

3)Run OPatch SystemSpace Check:

Check if enough free space is available on the ORACLE_HOME filesystem for the patches to be applied as given below:

  • For Grid Infrastructure Home, as home user grid:
    1. Create file /tmp/patch_list_gihome.txt with the following content:
      % cat /tmp/patch_list_gihome.txt
      
      [grid@racnode1 ~]$ cat /tmp/patch_list_gihome.txt
      /media/sf_Software/12201-190115/29231084/29230950
      /media/sf_Software/12201-190115/29231084/29263382
      /media/sf_Software/12201-190115/29231084/28864846
      /media/sf_Software/12201-190115/29231084/26839277
      /media/sf_Software/12201-190115/29231084/28566910
    2. Run the opatch command to check if enough free space is available in the Grid Infrastructure Home:
      [grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
      ...
      ..
      .
      Invoking prereq "checksystemspace"
      
      Prereq "checkSystemSpace" passed.
      
      OPatch succeeded.
      [grid@racnode1 ~]$

      For Database home, as home user oracle:

      1. Create file /tmp/patch_list_dbhome.txt with the following content:
        [oracle@racnode1 ~]$ cat /tmp/patch_list_dbhome.txt
        /media/sf_Software/12201-190115/29231084/29230950
        /media/sf_Software/12201-190115/29231084/29263382
        [oracle@racnode1 ~]$
        
      2. Run opatch command to check if enough free space is available in the Database Home:
        [oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
        ...
        ..
        .
        Invoking prereq "checksystemspace"
        
        Prereq "checkSystemSpace" passed.
        
        OPatch succeeded.
        [oracle@racnode1 ~]$

4) Check for conflicts in both the 12.2.0.1 GI home and the 12.2.0.1 DB homes.

  • In case you are applying the patch, run this command:
    [root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto apply /media/sf_Software/12201-190115/29231084 -analyze
    
    [root@racnode1 ~]#
  • In case you are rolling back the patch, run this command:
    #/u01/app/12.2.0.1/grid/OPatch/opatchauto rollback /media/sf_Software/12201-190115/29231084 -analyze
    
    

5) Patch both 12.2.0.2 GI and 12.2.0.1 DB home by running “opatchauto” as root user.

[root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto  
                apply /media/sf_Software/12201-190115/29231084

6) Please repeat step 1 to 5 on node 2.

7)Run “datapatch” or post patch SQL as per instructions, if ‘opatchauto’ is not used. In this situation, this step is not required because we have used opatchauto to patch.

On the node was last patched, check the log :

[root@racnode2 ~]# [oracle@racnode2 OPatch]$  ls -ltr /u01/app/oracle/cfgtoollogs/sqlpatch/29230950/22819305/
total 9720
-rw-r--r-- 1 oracle oinstall 4587177 Mar  5 22:36 29230950_apply_RACTESTB_CDBROOT_2020Mar05_22_36_00.log
-rw-r--r-- 1 oracle oinstall 4833931 Mar  5 22:38 29230950_apply_RACTESTB_PDBSEED_2020Mar05_22_37_21.log
-rw-r--r-- 1 oracle oinstall  527239 Mar  5 23:01 29230950_apply_RACTESTB_RACTESTBPDB_2020Mar05_23_00_55.log

8) Check the patches applied.

a) Run ‘opatch lsinventory’ against both GI and DB homes.

As GI Home owner grid user:

[grid@racnode1]$ opatch lsinventory
...
..
Interim patches (5) :
Patch  29263382     : applied on Thu Mar 05 22:12:49 AEDT 2020
Unique Patch ID:  22704686
Patch description:  "OCW JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416 (29263382)"
   Created on 18 Mar 2019, 04:41:32 hrs PST8PDT
   Bugs fixed:
     12816839, 13250991, 18701017, 20559126, 21477269, 21679331, 22322021
     22734786, 22986384, 22999793, 23170674, 23297046, 23301767, 23340259

As DB Home owner oracle user:

[oracle@racnode1]$ opatch lsinventory
..
..
Interim patches (2) :

Patch  29263382     : applied on Thu Mar 05 22:11:30 AEDT 2020
Unique Patch ID:  22704686
Patch description:  "OCW JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416 (29263382)"
   Created on 18 Mar 2019, 04:41:32 hrs PST8PDT
   Bugs fixed:
     12816839, 13250991, 18701017, 20559126, 21477269, 21679331, 22322021
     22734786, 22986384, 22999793, 23170674, 23297046, 23301767, 23340259

...
..
Patch  29230950     : applied on Thu Mar 05 22:11:00 AEDT 2020
Unique Patch ID:  22819305
Patch description:  "Database Jan 2019 Release Update Revision : 12.2.0.1.190416 (29230950)"
   Created on 22 Mar 2019, 04:35:49 hrs PST8PDT
   Bugs fixed:

b) Query database .

SQL> select PATCH_ID, VERSION, ACTION, STATUS, DESCRIPTION 
     from dba_registry_sqlpatch;
SQL> select PATCH_ID, VERSION, ACTION, STATUS, DESCRIPTION 
     from dba_registry_sqlpatch;

  PATCH_ID VERSION              ACTION          STATUS    DESCRIPTION
---------- -------------------- --------------- --------- ------------------------------------------------------------
  28822515 12.2.0.1             APPLY           SUCCESS   DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  28822515 12.2.0.1             ROLLBACK        SUCCESS   DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115
  29230950 12.2.0.1             APPLY           SUCCESS   DATABASE JAN 2019 RELEASE UPDATE REVISION 12.2.0.1.190416


9) Recompile invalid objects if any.

SQL> select owner, count(*) 
     from dba_objects 
     where status!='VALID' group by owner;

no rows selected

If the OJVM RU or RUR is also installed, you may see invalid objects after execution of datapatch in the previous step. If this is the case, run utlrp.sql to re-validate these objects.

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

Apply Patch 28828733 – GI Jan 2019 Release Update 12.2.0.1.190115

Here is the GI environment to be patched:

GI HOME:  12.2.0.1
DB HOMES: 12.2.0.1

Patches downloaded :

GI HOME: 12.2.0.1 : GI Jan 2019 Release Update 12.2.0.1.190115
Patch NumberDescriptionApplicable Homes
28822515Database Jan 2019 Release Update 12.2.0.1.190115Only DB Home for non-Oracle RAC setup. Both DB Homes and Grid Home for Oracle RAC setup.
28870605OCW Jan 2019 Release Update 12.2.0.1.190115Both DB Homes and Grid Home
28864846ACFS Jan 2019 Release Update 12.2.0.1.190115Only Grid Home
26839277DBWLM Release Update 12.2.0.1.170913Only Grid Home
28566910Tomcat Release Update 12.2.0.1.0Only Grid Home

1) Check and install the latest OPatch utility , which should be greater than 12.2.0.1.12 on all RAC nodes .

[grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.18

OPatch succeeded.
[grid@racnode2 ~]$

2) Run OPatch Conflict Check.

First run as GI owner grid user:

[grid@racnode1 trace]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/28828733/28822515
Oracle Interim Patch Installer version 12.2.0.1.18
Copyright (c) 2020, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/12.2.0.1/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/12.2.0.1/grid/oraInst.loc
OPatch version : 12.2.0.1.18
OUI version : 12.2.0.1.4
Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-02-27_21-01-36PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[grid@racnode1 trace]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/28828733/28870605
Oracle Interim Patch Installer version 12.2.0.1.18
Copyright (c) 2020, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/12.2.0.1/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/12.2.0.1/grid/oraInst.loc
OPatch version : 12.2.0.1.18
OUI version : 12.2.0.1.4
Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-02-27_21-01-37PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[grid@racnode1 trace]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/28828733/28864846
Oracle Interim Patch Installer version 12.2.0.1.18
Copyright (c) 2020, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/12.2.0.1/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/12.2.0.1/grid/oraInst.loc
OPatch version : 12.2.0.1.18
OUI version : 12.2.0.1.4
Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-02-27_21-01-38PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[grid@racnode1 trace]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/28828733/26839277
Oracle Interim Patch Installer version 12.2.0.1.18
Copyright (c) 2020, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/12.2.0.1/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/12.2.0.1/grid/oraInst.loc
OPatch version : 12.2.0.1.18
OUI version : 12.2.0.1.4
Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-02-27_21-01-40PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[grid@racnode1 trace]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/28828733/28566910
Oracle Interim Patch Installer version 12.2.0.1.18
Copyright (c) 2020, Oracle Corporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/12.2.0.1/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/12.2.0.1/grid/oraInst.loc
OPatch version : 12.2.0.1.18
OUI version : 12.2.0.1.4
Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-02-27_21-01-44PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[grid@racnode1 trace]$

Second run as Database Home owner user oracle:

[oracle@racnode2 dbhome_1]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/28828733/28822515
Oracle Interim Patch Installer version 12.2.0.1.18
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/12.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.18
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2020-02-27_21-20-54PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@racnode2 dbhome_1]$  $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /media/sf_Software/12201-190115/28828733/28870605
Oracle Interim Patch Installer version 12.2.0.1.18
Copyright (c) 2020, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/12.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.18
OUI version       : 12.2.0.1.4
Log file location : /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2020-02-27_21-21-07PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[oracle@racnode2 dbhome_1]$

3)Run OPatch SystemSpace Check:

Check if enough free space is available on the ORACLE_HOME filesystem for the patches to be applied as given below:

  • For Grid Infrastructure Home, as home user grid:
    1. Create file /tmp/patch_list_gihome.txt with the following content:
      % cat /tmp/patch_list_gihome.txt
      
      /media/sf_Software/12201-190115/28828733/28822515
      /media/sf_Software/12201-190115/28828733/28870605
      /media/sf_Software/12201-190115/28828733/28864846
      /media/sf_Software/12201-190115/28828733/26839277
      /media/sf_Software/12201-190115/28828733/28566910
    2. Run the opatch command to check if enough free space is available in the Grid Infrastructure Home:
      [grid@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.txt
      Oracle Interim Patch Installer version 12.2.0.1.18
      Copyright (c) 2020, Oracle Corporation.  All rights reserved.
      
      PREREQ session
      
      Oracle Home       : /u01/app/12.2.0.1/grid
      Central Inventory : /u01/app/oraInventory
         from           : /u01/app/12.2.0.1/grid/oraInst.loc
      OPatch version    : 12.2.0.1.18
      OUI version       : 12.2.0.1.4
      Log file location : /u01/app/12.2.0.1/grid/cfgtoollogs/opatch/opatch2020-02-27_21-26-51PM_1.log
      
      Invoking prereq "checksystemspace"
      
      Prereq "checkSystemSpace" passed.
      
      OPatch succeeded.
      [grid@racnode1 ~]$

      For Database home, as home user oracle:

      1. Create file /tmp/patch_list_dbhome.txt with the following content:
        $ cat /tmp/patch_list_dbhome.txt
        /media/sf_Software/12201-190115/28828733/28822515
        /media/sf_Software/12201-190115/28828733/28870605
        
      2. Run opatch command to check if enough free space is available in the Database Home:
        [oracle@racnode1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
        Oracle Interim Patch Installer version 12.2.0.1.18
        Copyright (c) 2020, Oracle Corporation.  All rights reserved.
        
        PREREQ session
        
        Oracle Home       : /u01/app/oracle/product/12.2.0/dbhome_1
        Central Inventory : /u01/app/oraInventory
           from           : /u01/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
        OPatch version    : 12.2.0.1.18
        OUI version       : 12.2.0.1.4
        Log file location : /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2020-02-27_21-37-53PM_1.log
        
        Invoking prereq "checksystemspace"
        
        Prereq "checkSystemSpace" passed.
        
        OPatch succeeded.
        [oracle@racnode1 ~]$

4) Check for conflicts in both the 12.2.0.1 GI home and the 12.2.0.1 DB homes.

  • In case you are applying the patch, run this command:
    [root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto apply /media/sf_Software/12201-190115/28828733 -analyze
    
    OPatchauto session is initiated at Thu Feb 27 21:41:27 2020
    
    System initialization log file is /u01/app/12.2.0.1/grid/cfgtoollogs/opatchautodb/systemconfig2020-02-27_09-41-30PM.log.
    
    Session log file is /u01/app/12.2.0.1/grid/cfgtoollogs/opatchauto/opatchauto2020-02-27_09-42-17PM.log
    The id for this session is GKR6
    
    Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.2.0.1/grid
    
    Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/12.2.0/dbhome_1
    Patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/dbhome_1
    
    Patch applicability verified successfully on home /u01/app/12.2.0.1/grid
    
    
    Verifying SQL patch applicability on home /u01/app/oracle/product/12.2.0/dbhome_1
    
    Following step failed during analysis:
     /bin/sh -c 'cd /u01/app/oracle/product/12.2.0/dbhome_1; ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1 ORACLE_SID=RACTESTB1 /u01/app/oracle/product/12.2.0/dbhome_1/OPatch/datapatch -prereq -verbose'
    
    SQL patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/dbhome_1
    
    OPatchAuto successful.
    
    --------------------------------Summary--------------------------------
    
    Analysis for applying patches has completed successfully:
    
    Host:racnode1
    RAC Home:/u01/app/oracle/product/12.2.0/dbhome_1
    Version:12.2.0.1.0
    
    
    ==Following patches were SKIPPED:
    
    Patch: /media/sf_Software/12201-190115/28828733/28864846
    Reason: This patch is not applicable to this specified target type - "rac_database"
    
    Patch: /media/sf_Software/12201-190115/28828733/26839277
    Reason: This patch is not applicable to this specified target type - "rac_database"
    
    Patch: /media/sf_Software/12201-190115/28828733/28566910
    Reason: This patch is not applicable to this specified target type - "rac_database"
    
    
    ==Following patches were SUCCESSFULLY analyzed to be applied:
    
    Patch: /media/sf_Software/12201-190115/28828733/28870605
    Log: /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-02-27_21-42-30PM_1.log
    
    Patch: /media/sf_Software/12201-190115/28828733/28822515
    Log: /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatchauto/core/opatch/opatch2020-02-27_21-42-30PM_1.log
    
    
    Host:racnode1
    CRS Home:/u01/app/12.2.0.1/grid
    Version:12.2.0.1.0
    
    
    ==Following patches were SUCCESSFULLY analyzed to be applied:
    
    Patch: /media/sf_Software/12201-190115/28828733/28870605
    Log: /u01/app/12.2.0.1/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-02-27_21-42-30PM_1.log
    
    Patch: /media/sf_Software/12201-190115/28828733/28864846
    Log: /u01/app/12.2.0.1/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-02-27_21-42-30PM_1.log
    
    Patch: /media/sf_Software/12201-190115/28828733/26839277
    Log: /u01/app/12.2.0.1/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-02-27_21-42-30PM_1.log
    
    Patch: /media/sf_Software/12201-190115/28828733/28566910
    Log: /u01/app/12.2.0.1/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-02-27_21-42-30PM_1.log
    
    Patch: /media/sf_Software/12201-190115/28828733/28822515
    Log: /u01/app/12.2.0.1/grid/cfgtoollogs/opatchauto/core/opatch/opatch2020-02-27_21-42-30PM_1.log
    
    Following homes are skipped during patching as patches are not applicable:
    
    /u01/app/oracle/product/12.1.0/dbhome_1
    
    OPatchauto session completed at Thu Feb 27 21:42:41 2020
    Time taken to complete the session 1 minute, 14 seconds
    [root@racnode1 ~]#
  • In case you are rolling back the patch, run this command:
    #GRID_HOME/OPatch/opatchauto rollback <UNZIPPED_PATCH_LOCATION>/28828733 -analyze

5) Patch both 12.2.0.2 GI and 12.2.0.1 DB home by running “opatchauto” as root user.

[root@racnode1 ~]# /u01/app/12.2.0.1/grid/OPatch/opatchauto  \
                apply /media/sf_Software/12201-190115/28828733

6) Please repeat step 1 to 5 on node 2.

opatchauto_log

7)Run “datapatch” or post patch SQL as per instructions, if ‘opatchauto’ is not used.

Check the log :

[oracle@racnode2 22636216]$ pwd
/u01/app/oracle/cfgtoollogs/sqlpatch/28822515/22636216
[oracle@racnode2 22636216]$ ls -ltr
total 4772
-rw-r--r-- 1 oracle oinstall 520670 Feb 27 22:42 28822515_apply_RACTESTB_CDBROOT_2020Feb27_22_40_48.log
-rw-r--r-- 1 oracle oinstall 4358895 Feb 27 22:43 28822515_apply_RACTESTB_PDBSEED_2020Feb27_22_42_13.log
[oracle@racnode2 22636216]$

8) Check the patches applied.

a) Run ‘opatch lsinventory’ against both GI and DB homes.

As GI Home owner grid user:

[grid@racnode1]$ opatch lsinventory

As DB Home owner oracle user:

[oracle@racnode1]$ opatch lsinventory

b) Query database .

SQL> select PATCH_ID, VERSION, ACTION, STATUS, DESCRIPTION 
     from dba_registry_sqlpatch;

PATCH_ID   VERSION  ACTION  STATUS DESCRIPTION
---------- -------- ------ ------- -------------------------------------
28822515   12.2.0.1 APPLY  SUCCESS DATABASE JAN 2019 RELEASE UPDATE 12.2.0.1.190115