I’m trying to find my listener.ora
file to edit it, but the docs say it’s in the ORACLE_HOME
directory, but where is that?
I’m running 12.1.0 on Windows Server 2008
asked Jun 6, 2016 at 22:35
Jeff PuckettJeff Puckett
4892 gold badges5 silver badges15 bronze badges
1
Open up a command prompt
Start -> Run -> "cmd.exe"
Start sqlplus as administrator
sqlplus / as sysdba
There’s a system stored procedure called get_env
for retrieving the value for ORACLE_HOME
, thanks Sabdar Syed for the query.
SQL > var OHM varchar2(100);
SQL > EXEC dbms_system.get_env('ORACLE_HOME', :OHM) ;
SQL > PRINT OHM
Should return a path like this:
C:apporacle_accountproduct12.1.0dbhome_1
answered Jun 6, 2016 at 22:35
Jeff PuckettJeff Puckett
4892 gold badges5 silver badges15 bronze badges
3
On Windows platform you can find oracle_home path in the registry.
Run regedit, then navigate to:
hkey local machine/software/oracle
Under oracle folder in the registry you will find something like:
KEY_OraDb10g_home1
There you can see oracle_home variable.
answered Jun 7, 2016 at 4:33
teoteo
3811 gold badge2 silver badges7 bronze badges
On cmd, type echo %ORACLE_HOME%
. If ORACLE_HOME
is set it will return you the path or else it will return %ORACLE_HOME%
.
Marco
3,6804 gold badges21 silver badges30 bronze badges
answered Sep 26, 2019 at 6:38
1
- Start
regedit
(search for it from the Start menu) - Open the HKEY_LOCAL_MACHINE folder
- Open the Oracle folder
- Open a folder called ORACLEMTSR
- Open the setup folder
- Access to the current version
There you will find a «file» called HOME; open it and you will see where Oracle was installed.
RDFozz
11.6k4 gold badges22 silver badges37 bronze badges
answered Oct 27, 2017 at 23:17
2
ORACLE_HOME is the location of Oracle database home directory path, which contains many important file relationship we may use them very often. To find the directory path, we need more information.
In this post, I’ll talk about how to find ORACLE_HOME in the following OS:
- How to Find ORACLE_HOME in Windows
- How to Find ORACLE_HOME in Linux or Unix-like
ORACLE_HOME Path in Windows OS
Every Oracle environment variable is set in Registry Editor (i.e. regedit). To open the registry editor, please press ⊞ Win + R to opens the «Run Program Or File» Window, type regedit, then Enter.
Run Block — regedit
In registry editor, you can go for the path:
ComputerHKEY_LOCAL_MACHINESOFTWAREORACLEKEY_ORACLE_HOME_NAME
It’s shown as below.
regedit — ORACLE_HOME
In this case, the ORACLE_HOME is at:
C:appclientproduct19.0.0client_1
ORACLE_HOME Path in Linux or Unix-like OS
To check ORACLE_HOME in Linux or Unix-like OS (e.g. AIX, Solaris), the simplest way is to echo the environment variable $ORACLE_HOME for sure.
[oracle@test ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/19.3.0/dbhome_1
If there’s no such environment variable in your system, you can print oratab file if you know where it is.
[oracle@test ~]$ cat /etc/oratab
...
ORA19C1:/u01/app/oracle/product/19.3.0/dbhome_1:Y
In the second field, it’s ORACLE_HOME.
RAC Database
Since oratab file may contain no information about ORACLE_HOME in a RAC database, you should use the server control utility (SRVCTL) to check.
[oracle@primary01 ~]$ srvctl config database -d orclcdb
Database unique name: ORCLCDB
Database name: ORCLCDB
Oracle home: /u01/app/oracle/product/19.0.0/db_1
Oracle user: oracle
Spfile: +DATA/ORCLCDB/spfile
Password file: +DATA/ORCLCDB/pwfile
...
In the above, command srvctl config database -d <db_unique_name> shows pretty much information including ORACLE_HOME for us.
Oracle
Overview
In this tutorial, we will learn the steps involved to set ORACLE_HOME environment variable on Windows 10. This variable should point to the install location of the Oracle Database on the machine. We can set this variable after the Oracle installation on the machine.
For example, if the Oracle base install location is installed on c:oracle then we need to set this variable to:
ORACLE_HOME=C:oracle
Oracle Install on Windows:
Check if the variable is set:
Open the command prompt and issue the following command.
> echo %ORACLE_HOME%
If we get the same name displayed on the screen and not the real directory path, then the variable is not set on the machine.
Set ORACLE_HOME
Let’s see the steps to set the variable on Windows.
Type the following “system environment variables” in the Search Bar.
Click on the ‘Edit the system environment variables’ Control Panel search result.
In the System Properties window, choose the Advanced tab. Click on the Environment Variables… button.
In the System Variables section, click on the New… button.
Add the environment variable
Variable name: -> ORACLE_HOME
Variable value: -> C:oracle
Click on the OK button. Alternatively, we can choose the install folder by clicking on the Browse Directory… button.
Append to PATH
Locate the PATH system variable. Double click on it to edit the variable. Click on New button.
Add the bin directory to the PATH variable.
%ORACLE_HOME%bin
Verify
Open command prompt and issue the following echo command to verify that the variable is set.
> echo %ORACLE_HOME%
That’s it. The environment variable has been set on the Windows machine.
—
Database Tutorials on this website:
More information about Oracle Database:
https://www.oracle.com/database/
Usually registry keys for Oracle home are registered at the time of installation, not sure why registry keys are missing.When you set variables from command prompt you’re setting at session level not system wide. In order to make it permanent you need to set either user wide or system wide variables.
From elevated command prompt type sysdm.cpl
go to advanced tab click Environment Variables
at the bottom,click new either system or user variables ,enter ORACLE_HOME and browse to ORACLE_HOME directory
After that you need to add bin in ORACLE_HOME directory to path,in the same pop up window look for variable path(user or system),click edit —> new browse to bin directory.
After completing above steps,open another command prompt and check for ORACLE_HOME
and executable commands in bin directory(sqlplus,impdp,rman etc)
C:echo %ORACLE_HOME%
— this variable read from either registry entries or system/user variables
C:where sqlplus
— from path variable
In my previous article i have given the detailed description of multiple queries related to oracle. In this article i would like to throw light on – How to set oracle_home path? I will explain multiple steps for setting up the oracle_home path.We often use the oracle_home in detail. In this post i would like to cover the following topics in detail.
- What is mean by ORACLE_HOME and What is Purpose of it?
- How to check the ORACLE_HOME setting
- How to set ORACLE_HOME path
- How to change setting of oracle home or how to delete or change oracle home
Purpose of ORACLE_HOME:
- ORACLE_HOME is a directory name which will come at the time of Oracle software installation.
- The specified directory path of ORACLE_HOME directory is been stored in an environment variable.
- The path of the ORACLE_HOME directory is stored the installation path of oracle. Example : For windows it could be C: or C:Software or under D:.
- File Structure under oracle home : The structure of files in ORACLE_HOME is fixed. Example : The location of sqlplus.exe is always ORACLE_HOME/bin and Tnsnames.ora path will be ORACLE_HOMEnetworkadmin.
- The ORACLE_HOME file will always used to ensure the correct oracle version is accessed running against the database.
- When it is important : It is very critical when you are using multiple versions of oracle on same windows server. ORACLE_HOME file is also important for installing the patches of oracle.
How to set oracle_home path? :
Once you install the Oracle.We require to check ORACLE_HOME file is set or not. We require to set the ORACLE_HOME .
How to set oracle_home path? – Windows Server
There are so many questions in mind that what is exact path of ORACLE_HOME file.We require to check whether the ORACLE_HOME is set or not.
c:>echo %ORACLE_HOME%
C:oraclexeapporacleproduct11.1.0.6server
If the path is given below (The version name may be different). If ORACLE_HOME is not set then you require to set the ORACLE_HOME.
C :> echo %ORACLE_HOME%%ORACLE_HOME
How to set oracle_home path?
We require to set the ORACLE_HOME for Windows server ,
C:>set ORACLE_HOME=C:oraclexeapporacleproduct11.1.0.6server
C:>echo %ORACLE_HOME%C:oraclexeapporacleproduct11.1.0.6server
C:>
How to check and set Environment variable path?
Step 1 : Go to the Control Panel –> System –> Advanced
Step 2 :We require to create on button named “Environment Variables”. There are two set of variables – first is User and other is System variables.The user variables are the variables which are visible to anyone who has logged in to the system. The system variables are visible to any other person who uses the system.
Step 3:Depending on the visibility you require to create ORACLE_HOME variable by clicking on New button.
Step 4 : We require to set the ORACLE_HOME directory value and Save it.
Step 5: We require to verify it with new command line session,
- Go to Control Panel -> System -> Advanced.
- Click on button “Environment Variables”. This will open a window with two sets of variables – User and System. User variables are visible to your login only, while system variables are visible to anyone else who uses the system.
- Choose “New” to create ORACLE_HOME variable as either User or System variable, depending on how you want its visibility.
- Set its value to the Oracle directory.
- Click OK to save.
- Verify through a new command line session that the value has been set correctly.
How to set oracle_home path? – Unix or Linux Server
You can also check and set the ORACLE_HOME path on unix or linux server. The first step is to check the ORACLE_HOME.
Command to use :
env | grep ORACLE_HOME
If the path is not set then you will get the following error.
SQL> @%ORACLE_HOME%RDBMSADMINSCOTT.sqlSP2-0310: unable to
open
file "%ORACLE_HOME%RDBMSADMINSCOTT.sql"
If you get above error then you require to set the ORACLE_HOME using following Steps.
Step 1 : Open the linux/unix operating system command prompt.
Step 2 : Use following commands to set the ORACLE_HOME and ORACLE_SID are set properly.
Command 1 : (bash or ksh) export ORACLE_SID=orcl
Command 2 :csh or tcsh) setenv ORACLE_SID orcl
You can set these with the scripts coraenv
(for the C shell) and oraenv
(for other shells). These scripts are typically located in the /usr/local/bin
directory.
Step 3 : Check and Ensure that the ORACLE_HOME/BIN directory in environment variable path.
Step 4 : Command to use,
export ORACLE_HOME=/app/oracle/product/11.1.0.6/server
How to change setting of ORACLE_HOME?
There is need to edit or delete the ORACLE_HOME. These kind of situation occurs when there is need to install multiple oracle installations. You require to follow the same steps and only you need to click on Edit or Delete button accordingly in Windows.
In Linux system also you can also edit profile file for your default shell in home directory. Example : /home/oracle , so that these environment variables are set every time you log in as that user.
I hope you get clear idea about – How to set oracle_home path? in detail .If you like this article or if you have any issues with the same kindly comment in comments section.