You are on page 1of 2

Setting Oracle environment variables in UNIX

by Jeff Hunter, Sr. Database Administrator

The following are a few of the basic ORACLE environment variables that can be set by
the DBA. For more environment variables, please refer to the reference guides.

To check the value of these environment variables enter:

env | grep -e ORA -e TNS


Oracle Environment Variables
Path to library files. (Eg: /usr/lib:/usr/openwin/lib:
LD_LIBRARY_PATH
$ORACLE_HOME/lib:/usr/games/lib)
Full path name to the base directory for all versions of Oracle
ORACLE_BASE
products.
Full path name to the version of ORACLE you are currently
using. ORACLE_HOME is normally found beneath
ORACLE_HOME
ORACLE_BASE in the directory tree. This variable is used to
find executable programs and message files.
ORACLE Server system identifier (SID) or instance name. The
ORACLE_SID database name is used as ORACLE_SID. This is required for all
ORACLE products and is set by the coraenv or oraenv script.
Defines the path names to locate files. If ORACLE_PATH is set,
the application searches the directories specified by
ORACLE_PATH $ORACLE_PATH first, then the current directory. If
ORACLE_PATH is not set, then the application uses the current
directory. This variable is used by SQL*Plus, Forms and Menu.
Defines a terminal definition. If not set, it defaults to the value of
ORACLE_TERM your TERM environment variable. Used by all character mode
products.
This will not ask for ORACLE_SID, it will take it as it is
ORAENV_ASK specified. This variable is normally set to "NO" before oraenv is
invoked from a script.
Defines the path name to the TNS (Transparent Network
TNS_ADMIN
Substrate) files like TNSNAMES.ORA, SQLNET.ORA etc.
ORACLE_TRACLE Trace Oracle's Unix shell scripts as they execute (using set -x).
TWO_TASK The TWO_TASK environment variable specifies a SQL*Net
connect string for connecting to a remote machine in a
client/server configuration. SQL*Net will check the value of
TWO_TASK and automatically add it to your connect string.
For example the following are equivalent:

sqlplus scott/tiger@db1

and

export TWO_TASK=db1; sqlplus scott/tiger

You might also like