banner



How To Set Oracle_home In Linux

ORACLE_HOME

In Oracle installation guides and scripts, you volition frequently come up across the term ORACLE_HOME. In fact, we used it on this site a couple of posts back, in the script to install SCOTT schema in Oracle.

This post volition embrace:

  • the significant and purpose of ORACLE_HOME
  • how to check if ORACLE_HOME is set
  • how to ready ORACLE_HOME
  • how to unset, modify or delete ORACLE_HOME

What is ORACLE_HOME?

ORACLE_HOME is a directory in the file system where the Oracle software is installed. The path to this directory is stored in an environment variable.

The value of ORACLE_HOME will vary co-ordinate to where you lot have installed Oracle. On a Windows machine, could have installed in nether C:\ or C:\Softwares or under D:\.

However, the file structure under ORACLE_HOME is fixed for whatever installation. For example, the location of sqlplus.exe is ever at ORACLE_HOME\bin, and tnsnames.ora is always to be found at ORACLE_HOME\network\admin.

This is why installation guides and scripts use ORACLE_HOME when they mention files nether the Oracle installation, as information technology provides a relative path to the bodily location of the file independent of where Oracle is installed on your machine.

How to check if ORACLE_HOME is set

The Oracle installation might not set ORACLE_HOME automatically, in which example you accept to prepare information technology yourself.

First – how to find out if ORACLE_HOME path is ready or not?

On Windows: On command prompt, type D:\>echo %ORACLE_HOME%. If this gives you the directory path, as in the code snippet below, then that means ORACLE_HOME is set.

            D:\>echo %ORACLE_HOME% C:\oraclexe\app\oracle\production\10.2.0\server        

If ORACLE_HOME is non set, the output will only give back %ORACLE_HOME%, as below. This means you lot need to set the value, which we'll meet how to in the next section.

D:\>repeat %ORACLE_HOME% %ORACLE_HOME%        

On Unix/Linux: type

env | grep ORACLE_HOME        

As with Windows, the output will betoken if ORACLE_HOME is fix already or needs to be set by yous.

TIP: If you lot run a script that uses ORACLE_HOME simply the ORACLE_HOME is not defined or incorrectly set, the output volition requite the fault every bit beneath:

SQL> @%ORACLE_HOME%\RDBMS\ADMIN\SCOTT.sql SP2-0310: unable to open file "%ORACLE_HOME%\RDBMS\ADMIN\SCOTT.sql"        

That's possibly another indication that your ORACLE_HOME might need to be stock-still.

How to set ORACLE_HOME

For the current runtime session, yous tin can set ORACLE_HOME with a single command:

On Windows:

D:\>set ORACLE_HOME=C:\oraclexe\app\oracle\production\10.2.0\server  D:\>echo %ORACLE_HOME% C:\oraclexe\app\oracle\product\10.2.0\server  D:\>        

On Unix/Linux:

consign ORACLE_HOME=/app/oracle/production/10.two.0/server        

This value will exist wiped off when you shut the electric current control line session. To set information technology as a global environment variable in Windows:

  1. Go to Command Panel -> System -> Advanced.
  2. Click on button "Environment Variables". This will open up a window with two sets of variables – User and System. User variables are visible to your login just, while system variables are visible to anyone else who uses the system.
  3. Choose "New" to create ORACLE_HOME variable as either User or Organisation variable, depending on how y'all want its visibility.
  4. Set its value to the Oracle directory.
  5. Click OK to relieve.
  6. Verify through a new command line session that the value has been set correctly.

ORACLE_HOME environment variable path

How to unset/modify/delete ORACLE_HOME

Yous might want to edit or delete ORACLE_HOME when in that location are multiple Oracle installs machine or if Oracle installation has been moved from 1 location to another.

If yous only want to override the value in 1 runtime session without affecting ORACLE_HOME permanently, just fix it on control line every bit you would for a new variable.

To change it globally on Windows, follow the same steps as for setting a new variable. But click here the "Edit" or "Delete" push, in place of the "New".

Source: https://www.oratable.com/oracle-home-path/

0 Response to "How To Set Oracle_home In Linux"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel