Oracle Database - oraenv and coraenv script to set Linux environment variable

Card Puncher Data Processing

About

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:

  • For the Bourne, Bash, or Korn shell, use the oraenv command.
  • For the C shell, use the coraenv command.

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:

  • A central means of updating all user accounts with database changes
  • A mechanism for switching between databases specified in the oratab file

To switch between databases

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.

How to run the script

To run one of these scripts, use the appropriate command:

  • coraenv script:
% source /usr/local/bin/coraenv
  • oraenv script:
$ . /usr/local/bin/oraenv

Documentation / Reference





Discover More
Oracle Registry Windows
Oracle Database - Environment Variables / Registry Values

To configure the database installation, Oracle provide several Environment variable / Registry Value. : oracle_sid is used for a local connection - direct to the server - without using a listener...
Oracle Database 11gr2 Typical Installation
Oracle Database - Installation 11g Release 2 (11.2) on Linux OEL 5 (X86)

Installation of Oracle Database 11g Release 2 (11.2) on Oracle Enterprise Linux 5. Linux OEL installation login as root RAM: At least 1 GB swap space The following table describes...
Card Puncher Data Processing
Oracle Database - PATH environment Variable

The path environment variable in a Oracle Database context. The directory that contains the oraenv, coraenv, and dbhome scripts is called the local bin directory. All database users must have...
Oracle Database Installationl Location 11gr2 Oel Linux X86 64
Oracle Database 11gR2 - Installation on Linux OEL 5 Update 5 (x86_64)

Installation of Oracle Database 11g Release 2 (11.2) x86_64 on Oracle Enterprise Linux 5 Update 5 on the file system (ie without ASM) or GRID. Linux OEL installation login as root ...



Share this page:
Follow us:
Task Runner