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
is correct.
$ dbhome
/usr/oracle/9.2.0
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 sysdba
whereas after oraenv has been executed, the following command
would work:
$ sqlplus system/manager as sysdba
The above is an excerpt from Oracle Utilities - Using
Hidden Programs, Import/Export, SQL Loader, oradebug, Dbverify, Tkprof
and More by Rampant TechPress (Dave Moore).
It’s only $19.95 and you can order the
book and get instant access to the online Oracle utilities scripts:
http://www.rampant-books.com/book_2003_1_utils.htm
|