After applied PSU and OJVM binary patches, and run “datapatch”, then get error “The pluggable databases that need to be patched must be in upgrade mode”.
$ ./datapatch -verbose
...
..
.
The following patches will be rolled back:
22139226 (Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016))
The following patches will be applied:
27001733 (Database PSU 12.1.0.2.180116, Oracle JavaVM Component (JAN2018))
26925311 (DATABASE PATCH SET UPDATE 12.1.0.2.180116)
Error: prereq checks failed!
patch 22139226: The pluggable databases that need to be patched must be in upgrade mode
Prereq check failed, exiting without installing any patches.
...
..
.
The workaround is to add “skip_upgrade_check” option for “datapatch” command:
$ ./datapatch -verbose -skip_upgrade_check SQL Patching tool version 12.1.0.2.0 Production on Fri Jan 19 17:33:18 2018 Copyright (c) 2012, 2016, Oracle. All rights reserved. Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_74462_2018_01_19_17_33_18/sqlpatch_invocation.log Connecting to database...OK Note: Datapatch will only apply or rollback SQL fixes for PDBs that are in an open state, no patches will be applied to closed PDBs. Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation (Doc ID 1585822.1) Bootstrapping registry and package to current versions...done Determining current state...done Current state of SQL patches: Patch 22139226 (Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016)): Installed in RACTESTPDB only Patch 27001733 (Database PSU 12.1.0.2.180116, Oracle JavaVM Component (JAN2018)): Installed in the binary registry and CDB$ROOT PDB$SEED Bundle series PSU: ID 180116 in the binary registry and ID 180116 in PDB CDB$ROOT, ID 180116 in PDB PDB$SEED, ID 160419 in PDB RACTESTPDB Adding patches to installation queue and performing prereq checks... Installation queue: For the following PDBs: CDB$ROOT PDB$SEED Nothing to roll back Nothing to apply For the following PDBs: RACTESTPDB The following patches will be rolled back: 22139226 (Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016)) The following patches will be applied: 27001733 (Database PSU 12.1.0.2.180116, Oracle JavaVM Component (JAN2018)) 26925311 (DATABASE PATCH SET UPDATE 12.1.0.2.180116) Installing patches... Patch installation complete. Total patches installed: 3 Validating logfiles... Patch 22139226 rollback (pdb RACTESTPDB): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/22139226/19729684/22139226_rollback Patch 27001733 apply (pdb RACTESTPDB): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/27001733/21728084/27001733_apply_LG Patch 26925311 apply (pdb RACTESTPDB): SUCCESS logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26925311/21850549/26925311_apply_LG SQL Patching tool complete on Fri Jan 19 17:37:33 2018 SQL> select PATCH_ID,VERSION,ACTION,STATUS,DESCRIPTION from dba_registry_sqlpatch order by ACTION_TIME; PATCH_ID VERSION ACTION STATUS DESCRIPTION ---------- -------------- ------- --------------- ---------------------------------------------------------------------------------------------------- 22139226 12.1.0.2 APPLY SUCCESS Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016) 22291127 12.1.0.2 APPLY SUCCESS Database Patch Set Update : 12.1.0.2.160419 (22291127) 22139226 12.1.0.2 ROLLBACK SUCCESS Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016) 27001733 12.1.0.2 APPLY SUCCESS Database PSU 12.1.0.2.180116, Oracle JavaVM Component (JAN2018) 26925311 12.1.0.2 APPLY SUCCESS DATABASE PATCH SET UPDATE 12.1.0.2.180116