Monday, January 10, 2011

Setting envrionment variables through .bash_profile and oraenv

This is a very convinient way to set envrionemnt variables for Oracle in TEST envrionment. (For critical production envrionment, I still recommend to set Oracle envrionment variables explicitly using export)
Add following lines to ~/.bash_profile (for ksh/sh, add it to ~/.profile)

ORAENV_ASK=NO
ORACLE_SID=prorcl

. oraenv


Output/Verification:

login as: oracle
oracle@vmxdb05's password:
Last login: Sun Jan 9 21:56:17 2011 from b5-donghua1.lan
The Oracle base has been set to /u01/app/oracle
[oracle@vmxdb05 ~]$ env|grep -e ORA -e LIB
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib
ORACLE_SID=prorcl
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

No comments:

Post a Comment