Error in writing to file ‘C:\oracle\product\10.2.0\db_1\jdk\bin\java.exe’. [C:\oracle\product\10.2.0\db_1\jdk\bin\java.exe (The process cannot access the file because it is being used by another process)]
Error in writing to file ‘C:\oracle\product\10.2.0\db_1\jdk\jre\bin\hpi.dll’. [C:\oracle\product\10.2.0\db_1\jdk\jre\bin\hpi.dll (The process cannot access the file because it is being used by another process)]
The installation of Oracle Database 10g Release 2 Patch Set 3 was successful.
The above was obtained from the update installation log after doing a non-interactive (silent) upgrade installation.
And if you run the update installer interactively, this is what you might get, which is basically the same thing as above.
And surprsingly, Oracle still says the update was successful even though you will not be able to actually update the database since you will find really soon that dbua and dbca both won’t start after installing the patch/update. If you’re trying to upgrade Oracle database server and getting the above error messages (or similar), you’re not alone.
Solution
The trick is that you have to stop all Oracle related services before you install the upgrade patch. If you’re using windows, the easiest is just to type the following four commands in the command prompt (it’s recommended that you follow the sequence)
net stop OracleDBConsole
net stop Oracle< ORACLE_HOME_NAME >iSQL*Plus
net stop Oracle< ORACLE_HOME_NAME >TNSListerner
net stop OracleService* replace
and < ORACLE_HOME_NAME > with those for your system.
In particular, you will notice that java.exe will be shutdown when the iSQL*Plus service has been turned off. And if java.exe is still running after doing all those above (check by using task manager), you might as well just end the java.exe process. Of course, since I was working in a VM, I went back to a previous snapshot and rerun the update installation again, this time closing down all the services mentioned above before doing so. I’m not so sure how you can revert/uninstall the patch or if you can rerun the update patch installation on top of Oracle again if you’ve done the install and saw this error message. If you know how, just leave a comment.
Carl Høgstedt says
I had this error when installing Oracle .NET client on a windws 2003 server.
Looking in services i found the service:
OracleMTSRecoveryService which was set to startup Automatic. I stopped this service and the installation completed without error.