Oracle: client environment variables on Windows and Linux
Environment variables, clean-up steps and ODBC drivers to check before installing an Oracle Instant Client on Windows, with the Linux equivalent.
Environment variables and clean-up to check before installing an Oracle client (Instant Client or full client) on Windows, with the Linux equivalents.
Windows
Clean up a previous installation
Before a reinstall, check these locations for leftover Oracle components:
- Registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, the 32-bitHKEY_LOCAL_MACHINE\SOFTWARE\Oracle*key, andHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Oracle*. - Folders:
C:\Oracle(or theORACLE_BASEfolder),C:\Program Files\Oracle,C:\Program Files (x86)\Oracle, Oracle entries inC:\ProgramData\Microsoft\Windows\Start Menu\Programs, and Oracle folders in the user profiles underC:\Users. - Empty
C:\tempand the Recycle Bin.
Environment variables
| Variable | Value (example: Instant Client 11.2 installed in C:\Oracle) |
|---|---|
PATH |
Append the client folder: %PATH%;C:\Oracle\instantclient_11_2 |
ORACLE_HOME |
C:\Oracle\instantclient_11_2 |
ORACLE_SID |
<SID>, the instance you connect to |
TNS_ADMIN |
Folder that contains tnsnames.ora, here C:\Oracle\instantclient_11_2 |
ODBC drivers
Check the installed ODBC drivers in these registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC DriversHKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI
Linux
export ORACLE_HOME=/opt${USER}/instantclient_19_14
export LD_LIBRARY_PATH="$ORACLE_HOME":$LD_LIBRARY_PATH
export PATH=$LD_LIBRARY_PATH:$PATH
export TNS_ADMIN=/home/${USER}/instantclient_19_14/network/admin
ORACLE_HOME points to the client folder, LD_LIBRARY_PATH lets the dynamic loader find the client libraries, and TNS_ADMIN points to the folder that contains tnsnames.ora.
Notes
- The 64-bit registry path was redacted in the source and is not restored here.
- The SID is replaced by
<SID>, and the client folder names are examples. - Two lines are kept as written in the source and need a review before use:
/opt${USER}(probably/opt/${USER}) andPATH=$LD_LIBRARY_PATH:$PATH(the client folder is$ORACLE_HOME). - Back up the registry before deleting any key.