2014年11月12日 星期三

【Oracle 筆記 】OPatch Patch 6880880: UnsupportedClassVersionError


現象:

Oracle DB version 11.2.0.2.0, 安裝 OPatch Patch 6880880 for OPatch 11.2.0.3.6 (p6880880_112000_LINUX-x86-64.zip) 後,驗證安裝時,發現下列錯誤:

[mgr@dev OPatch]$ ./opatch version
Exception in thread "main" java.lang.UnsupportedClassVersionError: oracle/opatch/OPatch (Unsupported major.minor version 49.0)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)

OPatch failed with error code 1

Review:

查看 oraparam.ini 的 OUI Version 時 ,發現 OUI_VERSION=11.2.0.2.0,而 Patch 6880880 OPatch 11.2.0.3.6 也支援 OUI v 11.2.*,但為何解壓縮後,無法使用?

$ vi /u01/proddb/proddb/11.2.2/oui/oraparam.ini
java -version 查看support 的版本為 build 1.6.0_10-b33,表面看起來此OPatch 11.2.0.3.6 官方文件也說明只需要 JDK / JRE v. 1.5.0 或更高版本,即能運作正常,然而實際上仍然報錯。 這此找向下相容版本 p6880880_111000_LINUX-x86-64.zip,安裝後驗證仍然報錯。問題在那裏? 接著試著從 README 檔案這句話 The OUI version must be 11.2.* 著手,找出目前環境下 OUI 安裝的版本,。發現 OUI Version 為 10.1.0.6.0。所以重新下載,選定 p6880880_111000_LINUX-x86-64.zip 這版本安裝。安裝完後驗證:

[mgr@dev OPatch]$ opatch version

Oracle Interim Patch Installer version 1.0.0.0.64
Copyright (c) 2011 Oracle Corporation. All Rights Reserved..

Oracle recommends you to use the latest OPatch version
and read the OPatch documentation available in the OPatch/docs
directory for usage. For information about the latest OPatch and
other support-related issues, refer to document ID 293369.1
available on My Oracle Support (https://myoraclesupport.oracle.com)

OPatch Version: 1.0.0.0.64
結論: 1. p6880880 官方文件有誤導: p6880880_112000_LINUX-x86-64.zip 官方說明支援的 platform 包含 Oracle 11.2.0.2.0 ,但事實並非如此。 2. 造成此現象的原因有可能 Oracle DB 由 10g 升級,而 OUI version 為 10.1.0.6.0 3. 此新版本的 OPatch 由下列 help 中與舊的相對照,可看出提供許多新功能: 注意: Oracle AP server 與 DB server 各有 OPatch 工具。 Oracle AP server 的 OPatch 是以 AP 帳號登入,位置在 $ORACLE_HOME/OPatch 之下,而 Oracle DB server 的 OPatch 是以 DB 帳號登入,位置同樣也在 $ORACLE_HOME/OPatch 之下。此次原因發生於上 AP sever 的 Patch,而非上 Oracle DB server 的 Patch。 新的 OPatch:

[mgr@dev OPatch]$ opatch -h

Oracle Interim Patch Installer version 1.0.0.0.64
Copyright (c) 2011 Oracle Corporation. All Rights Reserved..

Oracle recommends you to use the latest OPatch version
and read the OPatch documentation available in the OPatch/docs
directory for usage. For information about the latest OPatch and
other support-related issues, refer to document ID 293369.1
available on My Oracle Support (https://myoraclesupport.oracle.com)


 Usage: opatch [ -h[elp] ] [ -r[eport] ] [ command ]

            command := apply
                       lsinventory
                       napply
                       nrollback
                       query
                       rollback
                       util
                       version

  := -help       Displays the help message for the command.
                       -report     Print the actions without executing.

舊的 OPatch:

[mgr@dev OPatch]$ opatch -h

Oracle Interim Patch Installer version 1.0.0.0.58
Copyright (c) 2007 Oracle Corporation. All Rights Reserved..

We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document
293369.1 which is viewable from metalink.oracle.com


 Usage: opatch [ -h[elp] ] [ -r[eport] ] [ command ]

            command := apply
                       lsinventory
                       query
                       rollback
                       version

  := -help       Displays the help message for the command.
                       -report     Print the actions without executing.

參考: 1. https://updates.oracle.com/download/6880880.html 2. https://docs.oracle.com/cd/B16240_01/doc/em.102/e15294/options.htm

沒有留言:

張貼留言

prettyPrint();