Oracle RAC - db_env of the user oracle
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.
| Item | Value |
|---|---|
| Path | /home/oracle/db_env |
| Shown here | oradb01 |
| Deployed on | oradb01 and oradb02, one line differs |
| Activated with | db_env, an alias for . /home/oracle/db_env |
| Depends on | DB_HOME and BASE_PATH from .bash_profile |
The file
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:
| Host | Line | Value |
|---|---|---|
oradb01 | ORACLE_SID | clsdb1 |
oradb02 | ORACLE_SID | clsdb2 |
The lines one by one:
| Line | What it does |
|---|---|
ORACLE_SID=clsdb1 | The 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_PATH | Rebuilt from BASE_PATH, with the bin directory of the database home first |
LD_LIBRARY_PATH, CLASSPATH | Evaluated 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.