Before using certain tools that access the Oracle database, such as SQL*Plus, you must configure environment variables for your operating system. These environment variables are used by Oracle Database to determine the database instance to which the tool should connect.
To configure operating system environment variables for your database instance on Linux and UNIX systems:
Open an operating system command window.
Ensure that the environment variables ORACLE_HOME
and ORACLE_SID
are set properly. The commands to use to set these environment variables depend on the shell you use to interface with the operating system. For example:
(bash or ksh) export ORACLE_SID=orcl
(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.
Ensure that the $ORACLE_HOME/bin
directory is in your PATH
environment variable.
You can also edit the profile file for your default shell in the home directory of the software owner, for example /home/oracle
, so that these environment variables are set every time you log in as that user.
To configure operating system environment variables for your database instance on Windows systems:
See Also:
Oracle Database Administrator's Reference for Linux and UNIX-Based Operating Systems for more information about setting environment variables
Oracle Database Platform Guide for Microsoft Windows for details on modifying the registry entries