How to set .bash_profile in Linux for Oracle


This page will walk through How to set .bash_profile in Linux for Oracle. .bash_profile is executed to configure your login shell before the initial command prompt.

Login as the oracle user and add the following lines in the .bash_profile file.

oracle-home-dir/.bash_profile
export PATH=$PATH:$HOME/bin
#Oracle Environment
export ORACLE_HOME=/home/oracle/oracle/product/11.2.0/dbhome_1
export ORACLE_BASE=/home/oracle/oracle
export ORACLE_SID=oracle
export ORACLE_TERM=xterm
export NLS_LANG=AMERICAN
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib
export JAVA_HOME=/opt/java/jdk1.8.0_14/
export PATH=$JAVA_HOME:$PATH:$ORACLE_HOME/bin
alias l='ls -lrt'

Save .bash_profile and execute it to effect at the kernel level.

$ . .bash_profile

PS: Tested with Oracle 11g.

References

  1. Oracle Database 11g Release 1 (11.1) Installation
  2. .bash_profile location

Similar Posts

About the Author

Sandeep Jaiswal
Sandeep Jaiswal is a software engineer by profession and reader/writer by passion. He is working in a well reputed MNC as a Database Administrator (DBA). He has a good understanding and knowledge of Database and exploring other technologies related to Software development.