Process Explorer Menü

OPatch bricht mit Fehlercode 41 ab (Windows)

Ziel

Dieser Blogeintrag soll Möglichkeiten aufzeigen, wie man dem OPatch Fehlercode 41 auf die Schliche kommt.

Bei der Installation eines Patches durch OPatch wird vor der eigentlichen Installation eine Vorabprüfung durchgeführt. Hierzu gehört auch die Prüfung CheckActiveFilesAndExecutables, bei der überprüft wird, ob Dateien im Oracle Home Verzeichnis noch aktiv von Prozessen benutzt werden. Schlägt diese Überprüfung fehl, meldet OPatch den Fehler 41 und bricht mit der Installation ab.

 

 

Testumgebung

Simuliert wurde dieses Problem in einer Oracle 11g Release 2 (Version 11.2.0.3) Umgebung. Als Betriebssystem kam Windows Server 2008 R2 in der 64-bit Version zum Einsatz.

 

Auf dem System gab es zwei Oracle Home Verzeichnisse:

1. Oracle Grid Infrastructure für einen Standalone Server – Pfad: C:\app\Administrator\product\11.2.0\grid

2. Oracle Database – Pfad: C:\app\Administrator\product\11.2.0\dbhome_1

 

OPatch lag in der zurzeit des Blogeintrags aktuellen Version 11.2.0.3.0 vor. Die aktuelle Version von OPatch kann über My Oracle Support bezogen werden. Die Patchnummer lautet 6880880.

C:\app\Administrator\software\bp5\13885389>opatch version OPatch Version: 11.2.0.3.0  OPatch succeeded.

 

Zur Veranschaulichung sollte der Bundle Patch 5 (Patchnummer 13885389) für das Oracle Database Home installiert werden. Die OPatch Ausführung brach mit der folgenden Ausgabe ab:

C:\app\Administrator\software\bp5\13885389>opatch apply  Oracle Interim Patch-Installationsprogramm Version 11.2.0.3.0 Copyright (c) 2012, Oracle Corporation.  All rights reserved. Alle Rechte vorbehalten.   Oracle Home       : C:\app\Administrator\product\11.2.0\dbhome_1 Central Inventory : C:\Program Files\Oracle\Inventory    from           : n/a OPatch version    : 11.2.0.3.0 OUI version       : 11.2.0.3.0 Log file location : C:\app\Administrator\product\11.2.0\dbhome_1\cfgtoollogs\opatch\13885389_May_25_2012_10_03_34\ apply2012-05-25_10-03-34AM_1.log  Applying interim patch '13885389' to OH 'C:\app\Administrator\product\11.2.0\dbhome_1' Verifying environment and performing prerequisite checks... Patch 13885389: Optional component(s) missing : [ oracle.precomp.lang, 11.2.0.3.0 ] , [ oracle.rdbms.tg4msql, 11.2.0.3.0 ] , [ oracle.rdbms.ic, 11.2.0.3.0 ] , [ oracle.has.cvu, 11.2.0.3.0 ] , [ oracle .has.crs, 11.2.0.3.0 ] , [ oracle.usm, 11.2.0.3.0 ] Prerequisite check "CheckActiveFilesAndExecutables" failed. The details are:  Following files are active : C:\app\Administrator\product\11.2.0\dbhome_1\bin\oracommon11.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclient11.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\orageneric11.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\orapls11.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\oran11.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraxml11.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\oci.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\orahasgen11.dll C:\app\Administrator\product\11.2.0\dbhome_1\bin\orahasgen11.dll C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar C:\app\Administrator\product\11.2.0\dbhome_1\oui\jlib\srvm.jar Log file location: C:\app\Administrator\product\11.2.0\dbhome_1\cfgtoollogs\opatch\13885389_May_25_2012_10_03_34\ apply2012-05-25_10-03-34AM_1.log  Recommended actions: OPatch needs to modify files which are being used by some processes.  OPatch failed with error code = 41

Wie man an der Ausgabe sehen kann, gibt es zwei unterschiedliche Typen von Dateien, die zurzeit in Benutzung sind. Zum einen gibt es DLL Dateien und zum anderen eine JAR Datei. Wie man nun heraus bekommt welcher Prozess diese Dateien verwendet, wird in den beiden folgenden Abschnitten erklärt.

 

Fehler 1: Aktive DLL gefunden

Um herauszufinden von welchem Prozess eine DLL verwendet wird, empfiehlt sich der Process Explorer von Microsoft, der hier zu finden ist. Nach dem Download der ZIP-Datei muss diese lediglich entpackt werden – eine Installation ist nicht notwendig.

 

Nach dem Entpacken kann der Prozess Explorer über die EXE procsxp.exe gestartet werden. Über Find > Find Handle or DLL… besteht unter Anderen die Möglichkeit nach DLL Dateien zu suchen. 

Process Explorer Menü

 

Ich suche an dieser Stelle nach einer DLL Datei, die OPatch als aktiv erkannt hat. Findet der Process Explorer einen Prozess, der diese DLL benutzt, wird die Prozess ID, sowie der Prozess Name angezeigt.

 

Process Explorer Beispiel

 

In diesem Fall wird die DLL C:\app\Administrator\product\11.2.0\dbhome_1\bin\oci.dll zurzeit von dem Prozess omtsreco.exe verwendet. Hinter dieser EXE Datei verbirgt sich der Windows Dienst OracleMTSRecoveryService

 

Fehler 2: srvm.jar in Benutzung

Die Sperrung der Datei srvm.jar beruht auf einen Bug in der aktuellen OPatch Version. Weitere Informationen hierzu finden sich im My Oracle Support unter der Bug-Nummer 13902704 (SRVM.JAR IS LOCKED BY OPATCH 11.2.0.3).

 

Als Workaround kann man die Datei %ORACLE_HOME%\OPatch\jlib\oracle.opatch.classpath.jar umbenennen bevor man die Patchinstallation durchführt. Nach der Patchinstallation sollte die Datei wieder in ihren ursprünglichen Namen zurück geändert werden.

ren %ORACLE_HOME%\OPatch\jlib\oracle.opatch.classpath.jar oracle.opatch.classpath1.jar  ren %ORACLE_HOME%\OPatch\jlib\oracle.opatch.classpath1.jar oracle.opatch.classpath.jar

Dieser Bug sollte in der nächsten Version von OPatch behoben sein.

Leave a Reply

Your email address will not be published. Required fields are marked *