How To Set or Switch Oracle Homes On Windows
How To Set or Switch Oracle Homes On Windows
1
Copyright (c) 2025, Oracle. All rights reserved. Oracle Confidential.
In this Document
Goal
Solution
Why Should 'ORACLE_HOME' not be set on Oracle for Windows Environments
How does Oracle Determine the executable location?
Starting Oracle Executables
Modifying the default Oracle Home and PATH environment variables using the Oracle Universal
Installer (OUI)
Summary
APPLIES TO:
GOAL
To provide guidance regarding setting (or better stated: not setting) Oracle Home on Windows. Unlike on other platforms,
one should never keep ORACLE_HOME set as a fixed environment variable on Windows environments. This is largely due
to the fact that Oracle determines where executable files reside at run-time.
SOLUTION
Setting ORACLE_HOME in the environment can cause the software to work incorrectly. When you invoke an Oracle
executable on Windows, the Oracle software will get ORACLE_HOME from the environment but get (possibly) other mis-
matched variables from the registry.
When you invoke an Oracle executable on Windows, for example sqlplus.exe, the variables that get used for that program
are determined by the PATH environment variable and the location of the executable program (which Oracle home it
resides in).
For example: setting ORACLE_HOME=c:\oracle in the environment while the PATH points to d:\oracle\bin first, could cause
a different ORACLE_HOME to be used than is desired since ORACLE_HOME is set to c:\oracle, but all the other variables
will be gotten from the registry.
Note that even having a value of <blank> can cause unpredictable and/or undesirable behavior.
ORACLE_HOME should not exist - at all - with any or even no value - as a System Environment Variable
in Oracle on Windows environments.
In the case of Oracle RAC we have - by definition - at least two Oracle homes: for 10g and 11gR1, we have the Oracle
Clusterware home plus the database home, and possibly a separate Oracle Automatic Storage Management (ASM) home.
For 11gR2 we have the Oracle Grid Infrastructure home (Oracle Clusterware plus Oracle ASM) and the database home.
Having the ORACLE_HOME set to the database home in a Windows Oracle RAC environment will cause (among other
potential issues) all of our clusterware logs to be written to that Oracle home which can be a matter of concern when
diagnosing clusterware issues.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=rknd6nmnx_140&id=969581.1 1/2
3/28/25, 1:38 PM Document 969581.1
Setting ORACLE_HOME= in the environment is not necessary. This is because Oracle software will determine where the
executable file resides at run-time (i.e. c:\...\oracle\bin for instance) and will then open a 'pointer' file in that directory.
That pointer file specifies where in the registry to look for Oracle variables. The ORACLE_HOME variable in that registry key
is the value used by the product. Hence, there is no need to set any ORACLE_HOME= for any process whose .exe file lives
in an ORACLE_HOME\bin directory.
For Any Executable That Does Not Live in ORACLE_HOME\bin But Still Loads Oracle Software (examples
include: a web server process or other 3rd party software)
The ORACLE_HOME that is used is the first one in the PATH environment variable that contains the Oracle software that
the 3rd party program needs. So, if the 3rd party software needs a particular Oracle DLL, then it will search the PATH until
it finds the DLL and then that DLL will go through the process as described above to find the pointer file and then the
ORACLE_HOME value.
By typing just the executable name and not a full path name, then you get the 1st executable (and Oracle Home) in the
PATH. You can change PATH with the SET= command --or-- by going to Control Panel -> System and changing
environnment variables, hitting Apply, and then opening a new Command Prompt window.
One invokes the executable based on the full path in the shortcut created by the installer.
The executable specified first in the current PATH variable will be invoked. You can change the Path by going to Control
Panel, which changes the path globally for that user/session and perhaps for the whole system if you change a system
environment variable.
Modifying the default Oracle Home and PATH environment variables using the Oracle Universal Installer
(OUI)
You can use OUI to specify an Oracle home as the default Oracle home and update the PATH environment variable to point
to that Oracle home.
Invoke OUI and click on 'Installed Products,' then the 'Environment' tab. A list of all the installed Oracle homes on your
machine is displayed. Check the radio box next to the Oracle home you want to use to select and then use the UP and
DOWN arrows to move the selected Oracle home to the top of the list.
Summary
Except for some edge cases such as when using the OPATCH utility, there should be no reason to set ORACLE_HOME in
the environment in Oracle on Windows environments - in fact, it should be avoided. If a particular 3rd party app wants to
use a particular Oracle Home, the PATH variable should be modified to put the ORACLE_HOME first (or near the front) of
the PATH for that 3rd party application launch.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=rknd6nmnx_140&id=969581.1 2/2