From 12c onwards, after applying patch, as part of post patching activity, we need to run datapatch utility.

If you have applied javam patch in the ORACLE_HOME, then while running datapatch you will face below error.

READ ALSO : Apply javam patch in oracle

Adding patches to installation queue and performing prereq checks…
Installation queue:
Nothing to roll back
The following patches will be applied:
23177536 (Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016))
23054246 (Database Patch Set Update : 12.1.0.2.160719 (23054246))

Error: prereq checks failed!
patch 23177536: The database must be in upgrade mode
Prereq check failed, exiting without installing any patches.

 

SOLUTION:

We need to start the database in upgrade mode, if JAVAM patch is applied to ORACLE_HOME .

 

SQL> startup upgrade
ORACLE instance started.

Total System Global Area 2.2280E+10 bytes
Fixed Size                  7676976 bytes
Variable Size            1.2147E+10 bytes
Database Buffers         1.0066E+10 bytes
Redo Buffers               59428864 bytes
Database mounted.
Database opened.

Now run datapatch:

/oracle/app/oracle/product/12.1.0.2/dbhome_1/OPatch
$ ./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 on Fri Sep 23 15:26:39 2016
Copyright (c) 2016, Oracle.  All rights reserved.

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

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Patch 23177536 (Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016)):
  Installed in the binary registry only
Bundle series PSU:
  ID 160719 in the binary registry and not installed in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  The following patches will be applied:
    23177536 (Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016))
    23054246 (Database Patch Set Update : 12.1.0.2.160719 (23054246))

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

Validating logfiles...
Patch 23177536 apply: SUCCESS
  logfile: /oracle/app/oracle/cfgtoollogs/sqlpatch/23177536/20413866/23177536_apply_FINARCDB_2016Sep23_15_27_41.log (no errors)
Patch 23054246 apply: SUCCESS
  logfile: /oracle/app/oracle/cfgtoollogs/sqlpatch/23054246/20284967/23054246_apply_FINARCDB_2016Sep23_15_27_43.log (no errors)
SQL Patching tool complete on Fri Sep 23 15:27:50 2016