Setting Oracle home environment variable in Linux platform

Setting Oracle home environment variable in Linux platform

Setting the Oracle Home and other environment variable in Linux platform:
1. Set at terminal at bash level(temporary at terminals)
2. Set at user level (with bash_profile)

Set at Terminal level (temporary persistent)
Set the destination according to it where oracle is installed and Oracle sid defined as the instance name.
Open the terminal window in Linux and set the following paths will set your Oracle Environment variables.

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0
export ORACLE_SID=test
export PATH=$ORACLE_HOME/bin:$PATH

Set Permanent at user level
When you login with user, the Oracle Home environment variable is already set when you login with user by setting them in bash_profile hidden file in Linux.
Location of bash_profile is /home/oracle/.bash_profile if you are setting in ORACLE user. Suppose user name is oraadmin then location is /home/oraadmin/.bash_profile.

-- Open bash_profile hidden file in text editor add following line:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0
export ORACLE_SID=test
export PATH=$ORACLE_HOME/bin:$PATH
-- Save the file

You can set other environment variable also present in Linux system:

#Oracle Environment
export ORACLE_HOME=/u01/oracle/12.2.0/dbhome_1
export ORACLE_BASE=/u01/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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.