This section describes how to set a common operating system environment (environment variable) by using the oraenv or coraenv scripts, depending on the default shell:
Do not call the oraenv or coraenv script from the Oracle software owner (typically, oracle) user's shell startup script. Because these scripts prompt for values, they can prevent the dbstart script from starting a database automatically when the system starts.
The oraenv or coraenv script is usually called from the user's shell startup file (for example, .profile or .login). It sets the ORACLE_SID and ORACLE_HOME environment variables and includes the ORACLE_HOME/bin directory in the PATH environment variable setting.
The oraenv and coraenv scripts are created during installation. These scripts set environment variables based on the contents of the oratab file and provide:
You may find yourself frequently adding and removing databases from the development system or your users may be switching between several different Oracle Databases installed on the same system. You can use the oraenv or coraenv script to ensure that user accounts are updated and to switch between databases.
When switching between databases, users can run the oraenv or coraenv script to set these environment variables.
To run one of these scripts, use the appropriate command:
% source /usr/local/bin/coraenv
$ . /usr/local/bin/oraenv