Opatch Throws error : java.text.ParseException: Unparseable date: “2016.Aug.09 08:27:15 AEST

Oracle opatch utility should have used the latest available JRE to avoid those kind of TZ issues. It is a bug obviously.

SYMPTOMS

For 12.1.0.2 GI Home,  opatch  12.2.0.1.5 and later versions  throw below errors :

$ opatch lsinventory
Oracle Interim Patch Installer version 12.2.0.1.5
Copyright (c) 2016, Oracle Corporation. All rights reserved.


Oracle Home : /u01/app/12.1.0.2/grid
Central Inventory : /u01/app/oraInventory
 from : /u01/app/12.1.0.2/grid/oraInst.loc
OPatch version : 12.2.0.1.5
OUI version : 12.1.0.2.0
Log file location : /u01/app/12.1.0.2/grid/cfgtoollogs/opatch/opatch2016-09-08_17-08-01PM_1.log

sInstallTime = >2016.Aug.09 08:27:15 AEST<
java.text.ParseException: Unparseable date: "2016.Aug.09 08:27:15 AEST"
 at java.text.DateFormat.parse(DateFormat.java:337)
 at oracle.sysman.oii.oiii.OiiiCompsXMLHandler$OiiiInstallCompElementHandler.onStart(OiiiCompsXMLHandler.java:923)
 at oracle.sysman.oix.oixs.OixsElementHandler.startElement(OixsElementHandler.java:140)

CAUSE

  1. opatch is using $ORACLE_HOME/jdk/jre, which is version 1.6. But opatch has its own jre version 1.8, which is not used by opatch. it does not make sense.
  2. TZ entry AEST is added into $ORACLE_HOME/inventory/ContentsXML/comps.xml.
  3. Before opatch 12.2.0.1.5, TZ EST was used instead. Java1.6 does not understand AEST.

SOLUTION

  1. For “opatch” command failure.
    $ORACLE_HOME/OPatch/opatch lsinventory -jre $ORACLE_HOME/OPatch/jre
  2. For  ‘opatchauto apply’ failure.
$cd $ORACLE_HOME/OPatch
[+ASM1] grid@racnode1:/u01/app/12.1.0.2/grid/OPatch$ mv opatch opatch.bin
[+ASM1] grid@racnode1:/u01/app/12.1.0.2/grid/OPatch$ echo "/u01/app/12.1.0.2/grid/OPatch/opatch.bin $@ -jre /u01/app/12.1.0.2/grid/OPatch/jre" > opatch
[+ASM1] grid@racnode1:/u01/app/12.1.0.2/grid/OPatch$ chmod 750 opatch
[+ASM1] grid@racnode1:/u01/app/12.1.0.2/grid/OPatch$ cat opatch
/u01/app/12.1.0.2/grid/OPatch/opatch.bin $@ -jre /u01/app/12.1.0.2/grid/OPatch/jre