Oracle Environment Variables



Share this article :

There are required and optional environment variables for Oracle data sources.The following environment variables are valid for Oracle:

ORACLE_HOME

Set the ORACLE_HOME environment variable to the directory path where the Oracle client software is installed. Specify the fully qualified path for the environment variable: ORACLE_HOME= oracle home directory. For example,

ORACLE_HOME=\usr\oracle\10.0.1

ORACLE_BASE (optional)

ORACLE_BASE represents the root of the Oracle client directory tree. For example,

ORACLE_BASE=oracle_root_directory

ORA_NLS (optional)

Oracle’s National Language Support (NLS) architecture allows you to store, process, and retrieve data in native languages. It ensures that database utilities and error messages, sort order, date, time, monetary, numeric, and calendar conventions automatically adapt to the native language and locale. If multiple versions of Oracle are running on your system, you must ensure that:

• The appropriate ORA_NLS environment variable is set
• The corresponding NLS data files for the versions that you are using are available

The location-specific data is stored in a directory that is specified by the ORA_NLS environment variable. Each version of Oracle has a different ORA_NLS data directory. For example,

ORA_NLS33=oracle_home_directory/ocommon/nls/admin/

NLS_LANG (optional)

Oracle provides Globalization Support that enables users to interact with a database in their own language, as defined by the NLS_LANG parameter. When you install Oracle Database Client components, Oracle Universal Installer sets the NLS_LANG parameter in the registry. The NLS_LANG parameter uses the following format,

NLS_LANG = LANGUAGE_TERRITORY.CHARACTER_SET

TNS_ADMIN (optional)

• On Windows
The Oracle client looks for the tnsnames.ora file in the %ORACLE_HOME%\NETWORK\ADMIN directory, where %ORACLE_HOME% is defined. If the tnsnames.ora file is not in the %ORACLE_HOME%\NETWORK\ADMIN directory, you must set the TNS_ADMIN environment variable. You set the environment variable to the path where the tnsnames.ora file is located.

• On AIX or Linux
The Oracle client looks for the tnsnames.ora file in the /etc directory. If the tnsnames.ora file is not in the /etc directory, then the Oracle client looks for the tnsnames.ora file in the $ORACLE_HOME/network/admin directory, where $ORACLE_HOME is defined. If the tnsnames.ora file is not in the $ORACLE_HOME/network/admin directory, you must set the TNS_ADMIN environment variable. You set the environment variable to the path where the tnsnames.ora file is located. For example, if the tnsnames.ora file is in the /home/oracle directory, you set the environment variable to:

TNS_ADMIN=/home/oracle

• On Solaris
The Oracle client looks for the tnsnames.ora file in the /var/opt/oracle directory. If the tnsnames.ora file is not in the /var/opt/oracle directory, then the Oracle client looks for the tnsnames.ora file in the $ORACLE_HOME/network/admin directory, where $ORACLE_HOME is defined. If the tnsnames.ora file is not in the $ORACLE_HOME/network/admin directory, you must set the TNS_ADMIN environment variable. You set the variable to the path where the tnsnames.ora file is located. For example, if the tnsnames.ora file is in the /home/oracle directory, you set the environment variable to:

TNS_ADMIN=/home/oracle

Related posts

V$AQ: Oracle Queues Statistic
Oracle init.ora File
ORA-01683: unable to extend index X partition X by X in tablespace X
How to Determine Oracle Database Character Set
© 2017 ITsiti. All Rights Reserved
Powered by KEEM