LINUXOR.SK ... open source notes ...

Oracle RAC - db_env of the user oracle

category: solutionz/oracle · date: 2016-12-31 · updated: 2026-10-02 · author: LALA

Oracle RAC Solution · Config document · referenced from Database creation and user environments

A small file of environment variables that the user oracle sources to point the current shell back at the database home and the local database instance, after grid_env has pointed it at the Grid Infrastructure home. The alias db_env in .bash_profile sources it.

ItemValue
Path/home/oracle/db_env
Shown hereoradb01
Deployed onoradb01 and oradb02, one line differs
Activated withdb_env, an alias for . /home/oracle/db_env
Depends onDB_HOME and BASE_PATH from .bash_profile

The file

bash
ORACLE_SID=clsdb1; export ORACLE_SID
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

On the second node the notes show the first line and ... for the rest:

HostLineValue
oradb01ORACLE_SIDclsdb1
oradb02ORACLE_SIDclsdb2

The lines one by one:

LineWhat it does
ORACLE_SID=clsdb1The local database instance
ORACLE_HOME=$DB_HOME/data/u01/app/oracle/db11204; the profile builds DB_HOME from ORACLE_BASE
PATH=$ORACLE_HOME/bin:$BASE_PATHRebuilt from BASE_PATH, with the bin directory of the database home first
LD_LIBRARY_PATH, CLASSPATHEvaluated again with the new ORACLE_HOME

The result is the environment a fresh login of oracle already has, so the file is needed only to come back from grid_env without logging in again.

← solutionz/oracle