DataPatch: patch 23177536: The database must be in upgrade mode <- are you serious!?

29. September 2016 Uncategorized 2

Today I applied the latest patchset 12.1.0.2.160719  (July 2016) and afterwards I executed datapatch tool, but got a really stupid error:

[oracle/ACME1@acme01 OPatch]$ sqlplus / as sysdba
SQL> select  PATCH_ID, PATCH_UID, VERSION, STATUS, DESCRIPTION
     from DBA_REGISTRY_SQLPATCH
     order by BUNDLE_SERIES;
     
no rows selected

[oracle/ACME1@acme01 OPatch]$ ./datapatch -verbose
SQL Patching tool version 12.1.0.2.0 on Thu Sep 29 11:47:41 2016
Copyright (c) 2016, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_18294_2016_09_29_11_47_41/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))

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

Please refer to MOS Note 1609718.1 and/or the invocation log
/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_18294_2016_09_29_11_47_41/sqlpatch_invocation.log
for information on how to resolve the above errors.

SQL Patching tool complete on Thu Sep 29 11:48:51 2016

So, the database must be in upgrade mode!? I don’t think so.

I was suspicious that I hit some bug and was correct:

Bug 19883092 – Datapatch does not have a way of bypassing the check for upgrade mode (Doc ID 19883092.8)

Datapatch does not have a way of bypassing the check for upgrade mode. Datapatch checks for patches which require upgrade mode, and if the DB is not in upgrade mode then it fails with a prereq error.  This is fine, except that DBCA needs to call datapatch during database creation. There will be no other users connected, but the DB will not be in upgrade mode. Thus this check is not needed.

This fix adds a new flag -skip_upgrade_check.
If this is set then check_queue_prereqs will not check upgrade mode.

The solution is to add a new flag -skip_upgrade_check:

[oracle/ACME1@acme01 OPatch]$ ./datapatch -verbose -skip_upgrade_check
SQL Patching tool version 12.1.0.2.0 on Thu Sep 29 12:02:45 2016
Copyright (c) 2016, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_35512_2016_09_29_12_02_45/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: /u01/app/oracle/cfgtoollogs/sqlpatch/23177536/20400035/23177536_apply_acme_2016Sep29_12_03_51.log (no errors)
Patch 23054246 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/23054246/20213895/23054246_apply_acme_2016Sep29_12_03_51.log (no errors)
SQL Patching tool complete on Thu Sep 29 12:03:54 2016

[oracle/ACME1@acme01 OPatch]$ sqlplus / as sysdba

SQL> select  PATCH_ID, PATCH_UID, VERSION, STATUS, DESCRIPTION
     from DBA_REGISTRY_SQLPATCH
     order by BUNDLE_SERIES;
     
PATCH_ID PATCH_UID VERSION  STATUS  DESCRIPTION
-------- --------- -------- ------- ------------------------------------------------------
23054246  20213895 12.1.0.2 SUCCESS Database Patch Set Update : 12.1.0.2.160719 (23054246)
23177536  20400035 12.1.0.2 SUCCESS Database PSU 12.1.0.2.160719, Oracle JavaVM Component (JUL2016)

 

Et voilà!


2 thoughts on “DataPatch: patch 23177536: The database must be in upgrade mode <- are you serious!?”

  • 1
    Michal on December 30, 2016 Reply

    Hello,
    from Oracle Recommended Patches — “Oracle JavaVM Component Database PSU” (OJVM PSU) Patches (Doc ID 1929745.1)

    “Note-3:Post install steps depend on whether a database has JavaVM installed or not:
    For each database with JavaVM installed:
    Start the database in UPGRADE mode, run OJVM PSU post install steps, shutdown and restart the database for DB PSU post install steps.
    (It is not mandatory to use UPGRADE mode but some database configurations may report ORA-7445 errors if the DB is started normally before OJVM PSU post install steps have been executed).
    From April 2015 onwards the OJVM PSU Readme and patching steps now use UPGRADE mode

    • 2
      oracleninja on December 31, 2016 Reply

      Hi Michal,

      thanks for the info – good to know it!

Leave a Reply

Your email address will not be published. Required fields are marked *