Windows 10 pro x64, Oracle database 21c express edition: How to set ORACLE_HOME correct?

670 Views Asked by At

I am using Windows 10 pro x64, Oracle database 21c Express edition, Oracle SQL Developer 22.2.1 . How to set ORACLE_HOME correct?

enter image description here

I know this my setting was wrong (because sqlplus.exe cannot run/open with this system variable, I tried)

enter image description here

enter image description here

Is ORACLE_HOME

C:\app\Administrator\product\21c
C:\app\Administrator\product\21c\dbhomeXE
C:\app\Administrator\product\21c\homes
C:\app\Administrator\product\21c\homes\OraDB21Home1

? Please guide me set ORACLE_HOME correctly!

1

There are 1 best solutions below

0
On

On Windows you don't need to explicitly set an Oracle Home because we can work it out from the registry and the PATH.

But if you want to set an ORACLE_HOME its the parent folder of the 'bin' directory. Thus if sqlplus was found in C:\app\Administrator\product\21c\homes\OraDB21Home1\bin then your ORACLE_HOME would be C:\app\Administrator\product\21c\homes\OraDB21Home1

If you're running multiple versions/installations of Oracle (as I do), I'll often create a little batch file for each version,eg

sql19.cmd
=========
set ORACLE_SID=db19
set ORACLE_HOME=C:\oracle\product\19
set PATH=C:\oracle\product\19\bin;%PATH%
sqlplus scott/tiger@db19_pdb1 

sql21.cmd
=========
set ORACLE_SID=db21
set ORACLE_HOME=C:\oracle\product\21
set PATH=C:\oracle\product\21\bin;%PATH%
sqlplus scott/tiger@db21_pdb1 

and so on