Oracle oraenv and coraenv Utilities
oraenv and coraenv Utilities
The oraenv and coraenv utilities both aid in setting the
Oracle environment on UNIX systems (other utilities exist on
Windows platform that enable the Oracle Home to be set.) The
coraenv utility is appropriate for the UNIX C Shell; oraenv
should be used with either the Bourne or Korn shells.
Database operations require the ORACLE_HOME to be set before
the user may access the database. If ORACLE_HOME is not set,
commands such as sqlplus, exp, or any other utility for that
matter, will not be found.
Both utilities are shell scripts that do the same thing in the
different UNIX shells. They will prompt for a SID of the
database unless ORAENV_ASK is set to N. The utility will also
append the ORACLE_HOME value to the path, marking the location
of the utility.
The oraenv command will prompt for the SID of the database
that you wish $ORACLE_HOME to access.
$ . oraenv
ORACLE_SID =  ? ASG920
The dbhome utility can now be used to verify that $ORACLE_HOME
The “dot space” part of the command is required to make the
environment change with the parent shell, as opposed to
entering a command without it which would only affect the
subshell running that process.
These commands can be used to avoid specifying the network
service name when issuing commands. For instance, without
using oraenv, an sqlplus command would look like:
$ sqlplus system/manager@nameofservice as sysRemote DBA
whereas after oraenv has been executed, the following command
$ sqlplus system/manager as sysRemote DBA
To learn more about these techniques,
see the book "Advanced
Oracle Utilities: The Definitive Reference".
You can buy it directly from the
publisher and get instant access to the code
depot of utilities scripts.