Sunday, April 30, 2017

opatch lsinventory throws "java.text.ParseException: Unparseable date"


Due to some issues when opatch lsinventory is executed a java exception like below is thrown.

sInstallTime = >2017.Apr.28 12:40:15 AEST<
java.text.ParseException: Unparseable date: "2017.Apr.28 12:40: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)
        at oracle.sysman.oix.oixs.OixsDefaultHandler.startElement(OixsDefaultHandler.java:109)
        at oracle.xml.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:182)
        at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1635)
        at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:458)
        at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:404)
        at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:244)
        at oracle.sysman.oii.oiii.OiiiInstallXMLReader.readComps(OiiiInstallXMLReader.java:324)
        at oracle.sysman.oii.oiii.OiiiInstallXMLReader.readComps(OiiiInstallXMLReader.java:232)
        at oracle.sysman.oii.oiii.OiiiInstallInventory.getCompOHListElement(OiiiInstallInventory.java:2307)
        at oracle.sysman.oii.oiii.OiiiAreaInventory.getAllCompsVect(OiiiAreaInventory.java:1057)
        at oracle.opatch.ipm.RawInventory.loadRawInventory(RawInventory.java:217)
        at oracle.opatch.ipm.RawInventory.init(RawInventory.java:171)
        at oracle.opatch.ipm.RawInventory.getInstance(RawInventory.java:87)
        at oracle.opatch.ipm.IPMReadServices.getRawInventory(IPMReadServices.java:149)
        at oracle.opatch.ipm.IPMReadServices.loadInventory(IPMReadServices.java:1031)
        at oracle.opatch.LsInventorySession.process(LsInventorySession.java:317)
        at oracle.opatch.OPatchSession.process(OPatchSession.java:2058)
        at oracle.opatch.OPatch.process(OPatch.java:808)
        at oracle.opatch.OPatch.main(OPatch.java:858)

In order  to overcome this issue make following changes:
a.      Go to $GRID_HOME/OPatch
      [root@db12c-01 Patch]# cd $GRID_HOME/OPatch
      [root@db12c-01 OPatch]# pwd
       /u01/app/12.1.0.2/grid/OPatch
      [root@db12c-01 OPatch]# 

b.      More opatch executable to opatch.sh
mv opatch opatch.sh

c.       Create new opatch file
vi opatch

d.      Add following line in new opatch file

/u01/app/12.1.0.2/grid/OPatch/opatch.sh $@ -jre /u01/app/12.1.0.2/grid/OPatch/jre

e.     Change permission of new opatch file

      [grid@db12c-01 OPatch]# chmod 750 opatch
      [grid@db12c-01 OPatch]# ls -l opatch opatch.sh
      -rwxr-xr-- 1 grid oinstall    82 Apr 28 21:13 opatch
      -rwxr-x--- 1 grid oinstall 44345 Apr 28 20:16 opatch.sh
      [grid@db12c-01 OPatch]#

f. Run opatch lsinventory to check it worked.



No comments:

Post a Comment