Windows平臺下opatch apply報錯:OUI-67073

skzhuga發表於2018-12-07

近期Oracle被安全部門掃出來不少漏洞,要打相應的補丁。Oracle版本是11.2.0.1,平臺是Windows Server 2008 R2。

首先在MOS上下載了相應patch,解壓,用opatch apply安裝,結果報錯:

[2018-12-7 10:08:35] [INFO]         opatch-external.jar is in C:\app\Administrator\product\11.2.0\dbhome_1\OPatch\jlib\opatch-external.jar

[2018-12-7 10:08:35] [INFO]         [OPSR-TIME] Loading cooked inventory

[2018-12-7 10:08:35] [INFO]         [OPSR-MEMORY] : Loading cooked one offs. Heap memory used 18 (MB)

[2018-12-7 10:08:35] [INFO]         [OPSR-MEMORY] : Loaded cooked oneoffs. Heap memory used : 18 (MB)

[2018-12-7 10:08:35] [INFO]         [OPSR-TIME] Cooked inventory loaded successfully

[2018-12-7 10:08:35] [INFO]         Checking if Oracle Home has components required by patches...

[2018-12-7 10:08:35] [INFO]         CheckMissingComps: Cached file does not exist or is invalid, re-build prereq result.

[2018-12-7 10:08:35] [INFO]         Checking conflict among patches...

[2018-12-7 10:08:35] [INFO]         Running prereq checkConflictAmongPatchesWithDetail

[2018-12-7 10:08:36] [INFO]         Following patches can be applied:  10100101

[2018-12-7 10:08:36] [INFO]         Following patches are not required:

[2018-12-7 10:08:36] [INFO]         Following patches are auto rollbackable:

[2018-12-7 10:08:36] [INFO]         Finished checking prereq checkConflictAmongPatchesWithDetail

[2018-12-7 10:08:36] [INFO]         Conflict checking amongst patches PASSED

[2018-12-7 10:08:36] [INFO]         Checking conflicts against Oracle Home...

[2018-12-7 10:08:36] [INFO]         Running prereq checkConflictAgainstOHWithDetail

[2018-12-7 10:08:36] [INFO]         Following patches can be applied:  10100101

[2018-12-7 10:08:36] [INFO]         Following patches are not required:

[2018-12-7 10:08:36] [INFO]         Following patches are auto rollbackable:

[2018-12-7 10:08:36] [INFO]         Finished checking prereq checkConflictAgainstOHWithDetail

[2018-12-7 10:08:36] [INFO]         Running prerequisite checks...

[2018-12-7 10:08:36] [INFO]         Space Needed : 835.45MB

[2018-12-7 10:08:36] [INFO]         Prereq checkPatchApplicableOnCurrentPlatform Passed for patch : 10100101

[2018-12-7 10:08:36] [INFO]         Following active files are not used by opatch process :

                                    C:\app\Administrator\product\11.2.0\dbhome_1\bin\oci.dll

                                    Following active files are used by opatch process :

[2018-12-7 10:08:36] [INFO]         Prerequisite check "CheckActiveFilesAndExecutables" failed.

                                    The details are:

                                    

                                    Following active files are not used by opatch process :

                                    C:\app\Administrator\product\11.2.0\dbhome_1\bin\oci.dll

                                    Following active files are used by opatch process :

[2018-12-7 10:08:36] [SEVERE]       OUI-67073:UtilSession 失敗: Prerequisite check "CheckActiveFilesAndExecutables" failed.

[2018-12-7 10:08:36] [INFO]         Finishing UtilSession at Fri Dec 07 10:08:36 CST 2018

[2018-12-7 10:08:36] [INFO]         Log file location: C:\app\Administrator\product\11.2.0\dbhome_1\cfgtoollogs\opatch\opatch2018-12-07_10-08-32上午_1.log

[2018-12-7 10:08:36] [INFO]         堆疊說明: java.lang.RuntimeException: Prerequisite check "CheckActiveFilesAndExecutables" failed.

                                    at oracle.opatch.OPatchSessionHelper.runApplyPrereqs(OPatchSessionHelper.java:6699)

                                    at oracle.opatch.opatchutil.NApply.legacy_process(NApply.java:998)

                                    at oracle.opatch.opatchutil.NApply.legacy_process(NApply.java:368)

                                    at oracle.opatch.opatchutil.NApply.process(NApply.java:348)

                                    at oracle.opatch.opatchutil.OUSession.napply(OUSession.java:1108)

                                    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:597)

                                    at oracle.opatch.UtilSession.process(UtilSession.java:359)

                                    at oracle.opatch.OPatchSession.process(OPatchSession.java:2650)

                                    at oracle.opatch.OPatch.process(OPatch.java:784)

                                    at oracle.opatch.OPatch.main(OPatch.java:834)

                                    Caused by: java.lang.RuntimeException: Prerequisite check "CheckActiveFilesAndExecutables" failed.

                                    ... 13 more

                                    Caused by: oracle.opatch.PrereqFailedException: Prerequisite check "CheckActiveFilesAndExecutables" failed.

                                    ... 13 more

報CheckActiveFilesAndExecutables,說明有Oracle的相關檔案被鎖定了。但報錯日誌中並沒有列出哪些被鎖定。

檢視相關Oracle服務,都已經關閉了,應該沒有檔案被鎖定才對:

仔細檢視報錯日誌,發現

Following active files are not used by opatch process :

C:\app\Administrator\product\11.2.0\dbhome_1\bin\oci.dll

報oci.dll還處在活動狀態,仔細想了想,雖然日誌中應該是Windows在啟動時根據Oracle的環境變數載入了某些檔案,應該是這些檔案導致opatch失敗。因此採取以下措施:

  1.修改Windows環境變數,去掉path中Oracle相關配置

 2.將Oracle自動啟動的服務調整為手動

重啟Windows後,重新opatch apply,問題被成功解決。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31544156/viewspace-2284483/,如需轉載,請註明出處,否則將追究法律責任。

相關文章