============================================================
XML文件错误导致的OUI启动失败故障解决
参考文档ID:1079106.1
by : 王磊/菜小小~@2011/2/27 10:57 QQ:262477752
============================================================
故障现象
准备对升级RedHat Linux 5.4下面的Oracle 10.2.0.1 RAC 升级到Oracle 10.2.0.5 RAC,启动OUI时出现故障:
[oracle@NEWORACLE1 Disk1]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3, SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1, asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-02-27_09-44-58AM. Please wait ...[oracle@NEWORACLE1 Disk1]$ Oracle Universal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.
org.xml.sax.SAXParseException:
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:415)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:284)
at oracle.xml.parser.v2.NonValidatingParser.parseEndTag(NonValidatingParser.java:1391)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1336)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:361)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:307)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:213)
at oracle.sysman.oii.oiii.OiiiInstallXMLReader.readHomes(OiiiInstallXMLReader.java:126)
at oracle.sysman.oii.oiii.OiiiInstallInventory.readHomes(OiiiInstallInventory.java:653)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.loadPartialInstallInv(OiiiInstallAreaControl.java:656)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.initInstallInv(OiiiInstallAreaControl.java:701)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.loadInstallInventory(OiiiInstallAreaControl.java:568)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.initAreaControl(OiiiInstallAreaControl.java:1785)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.initAreaControl(OiiiInstallAreaControl.java:1749)
at oracle.sysman.oii.oiic.OiicInstallSession.setAreaControls(OiicInstallSession.java:1418)
at oracle.sysman.oii.oiic.OiicInstallSession.
at oracle.sysman.oii.oiic.OiicSessionWrapper.createNewSession(OiicSessionWrapper.java:846)
at oracle.sysman.oii.oiic.OiicSessionWrapper.
at oracle.sysman.oii.oiic.OiicInstaller.init(OiicInstaller.java:508)
at oracle.sysman.oii.oiic.OiicInstaller.runInstaller(OiicInstaller.java:961)
at oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.java:899)
org.xml.sax.SAXParseException:
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:415)
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:284)
at oracle.xml.parser.v2.NonValidatingParser.parseEndTag(NonValidatingParser.java:1391)
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1336)
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:361)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:307)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:213)
at oracle.sysman.oii.oiii.OiiiInstallXMLReader.readHomes(OiiiInstallXMLReader.java:126)
at oracle.sysman.oii.oiii.OiiiInstallInventory.readHomes(OiiiInstallInventory.java:653)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.loadPartialInstallInv(OiiiInstallAreaControl.java:656)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.initInstallInv(OiiiInstallAreaControl.java:701)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.loadInstallInventory(OiiiInstallAreaControl.java:568)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.initAreaControl(OiiiInstallAreaControl.java:1785)
at oracle.sysman.oii.oiii.OiiiInstallAreaControl.initAreaControl(OiiiInstallAreaControl.java:1749)
at oracle.sysman.oii.oiic.OiicInstallSession.setAreaControls(OiicInstallSession.java:1418)
at oracle.sysman.oii.oiic.OiicInstallSession.
at oracle.sysman.oii.oiic.OiicSessionWrapper.createNewSession(OiicSessionWrapper.java:846)
at oracle.sysman.oii.oiic.OiicSessionWrapper.
at oracle.sysman.oii.oiic.OiicInstaller.init(OiicInstaller.java:508)
at oracle.sysman.oii.oiic.OiicInstaller.runInstaller(OiicInstaller.java:961)
at oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.java:899)
尝试解决
想当然的认为跟oraInventory,目录有关,尝试检查并修改oraInventory权限为755,发现再启动oui故障依旧
[oracle@NEWORACLE1 oraInventory]$ ls -l /home/oracle/oraInventory
total 72
drwxrwx--- 2 oracle oinstall 4096 Jan 21 11:53 Contents
drwxrwx--- 2 oracle oinstall 4096 Jan 21 15:15 ContentsXML
-rwxrwx--- 1 oracle oinstall 37 Jan 21 11:55 install.platform
drwxr-x--- 3 oracle oinstall 4096 Feb 27 09:44 logs
-rwxrwx--- 1 oracle oinstall 60 Jan 21 10:56 oraInst.loc
-rwxrwx--- 1 oracle oinstall 301 Jan 21 10:48 oraInstaller.properties
-rwxrwx--- 1 oracle oinstall 1165 Jan 21 10:56 orainstRoot.sh
drwxrwx--- 2 oracle oinstall 4096 Jan 21 10:48 oui
-rwxrwx--- 1 oracle oinstall 3290 Jan 21 10:54 sessionContext.ser
[oracle@NEWORACLE1 oraInventory]$ chmod -R 755 /home/oracle/oraInventory
[oracle@NEWORACLE1 oraInventory]$ ls -l
total 72
drwxr-xr-x 2 oracle oinstall 4096 Jan 21 11:53 Contents
drwxr-xr-x 2 oracle oinstall 4096 Jan 21 15:15 ContentsXML
-rwxr-xr-x 1 oracle oinstall 37 Jan 21 11:55 install.platform
drwxr-xr-x 3 oracle oinstall 4096 Feb 27 09:44 logs
-rwxr-xr-x 1 oracle oinstall 60 Jan 21 10:56 oraInst.loc
-rwxr-xr-x 1 oracle oinstall 301 Jan 21 10:48 oraInstaller.properties
-rwxr-xr-x 1 oracle oinstall 1165 Jan 21 10:56 orainstRoot.sh
drwxr-xr-x 2 oracle oinstall 4096 Jan 21 10:48 oui
-rwxr-xr-x 1 oracle oinstall 3290 Jan 21 10:54 sessionContext.ser
解决办法
官方文档:
OUI and Opatch error : org.xml.sax.SAXParseException: : XML-20121: (Fatal Error) End tag does not match start tag 'HOME_LIST' [ID 1079106.1]
查文档,说是XML文件损坏有关
The cause of the issue is XML file corruption.
Error org.xml.sax.SAXParseException is due to corrupted/improper XML files that opatch/OUI fail to read/retrieve information from them.
Following are the basic XML files get read by Opatch or OUI utilities while retrieving the information about installed oracle products/components in the system
"Inventory_Loc"/ContentsXML/comps.xml
"Inventory_Loc"/ContentsXML/inventory.xml
ORACLE_HOME/inventory/ContentsXML/comps.xml
ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml
于是需要检查如下的xml文件是否损坏
"Inventory_Loc"/ContentsXML/comps.xml
"Inventory_Loc"/ContentsXML/inventory.xml
ORACLE_HOME/inventory/ContentsXML/comps.xml
ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml
使用opatch 检查xml文件
[oracle@NEWORACLE1 OPatch]$ opatch util LoadXML -help
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /home/oracle/oracle/product/10.2.0/db_1
Central Inventory : /home/oracle/oraInventory
from : /home/oracle/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /home/oracle/oracle/product/10.2.0/db_1/oui
Log file location : /home/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Feb_27_10-11-47-CST_Sun.log
DESCRIPTION
Options to OPatch Util
updateRemoteNodes: propagate/remove files/directories to/on remote nodes
using files under OH/.patch_storage/
copyListedFiles: copy all files listed in
OH/.patch_storage/
copyListedFilesTest: copy a single file to remote nodes
copyListedDirs: recursively copy all directories listed in
OH/.patch_storage/
copyListedDirsTest: recursively copy a single directory to remote nodes
removeListedFiles: remove files listed in
OH/.patch_storage/
removeListedFilesTest: remove a single file on remote nodes
removeListedDirs: recursively remote directories listed in
OH/.patch_storage/
removeListedDirsTest: recursively remove a directory on remote nodes
runRemoteMake: invoke re-link on remote nodes. Commands are stored in
OH/.patch_storage/
runAnyCommand: run any command on remote nodes
loadXML: prompt for path/name of the XML file, then check if the XML is correct.
checkOuiVersion: prompt for ORACLE_HOME, then check if the OUI version
of the home is compatible with the OUI version that OPatch required.
SYNTAX
opatch util [option]
For example 'opatch util checkOuiVersion'
OPatch succeeded.
发现说xml文件有问题:
[oracle@NEWORACLE1 OPatch]$ opatch util LoadXML
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
UTIL session
Oracle Home : /home/oracle/oracle/product/10.2.0/db_1
Central Inventory : /home/oracle/oraInventory
from : /home/oracle/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /home/oracle/oracle/product/10.2.0/db_1/oui
Log file location : /home/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Feb_27_10-13-39-CST_Sun.log
Invoking method loadxml
Please enter the complete path to the XML file to load:
(enter both the dir. path and the file name)"
/home/oracle/oraInventory/ContentsXML/inventory.xml
You entered: "/home/oracle/oraInventory/ContentsXML/inventory.xml".
Failed to load XML file due to SAXException, msg=End tag does not match start tag 'HOME'.
UtilitySession failed to check the XML file.
UtilSession::process() failed.
UtilSession failed: "UtilSession::process() failed."
java.lang.Error: UtilSession::process() failed.
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at oracle.opatch.UtilSession.process(UtilSession.java:195)
at oracle.opatch.OPatchSession.main(OPatchSession.java:1160)
at oracle.opatch.OPatch.main(OPatch.java:506)
OPatch failed with error code 255
仔细检查inventory.xml后发现HOME的tag不成对,将其修改正确后故障解决
[oracle@NEWORACLE1 ~]$ cat /home/oracle/oraInventory/ContentsXML/inventory.xml
<!-- Copyright (c) 2005 Oracle Corporation. All rights Reserved -->
<!-- Do not modify the contents of this file by hand. -->
修改后
[oracle@NEWORACLE1 ~]$ cat /home/oracle/oraInventory/ContentsXML/inventory.xml
<!-- Copyright (c) 2005 Oracle Corporation. All rights Reserved -->
<!-- Do not modify the contents of this file by hand. -->
修改后再次OUI ok
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/21162451/viewspace-697266/ ,如需转载,请注明出处,否则将追究法律责任。