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

Unknown's avatar

Author: SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

One thought on “Setting Oracle home environment variable in Linux platform”

  1. I hope the pearl script will set an active Directory on my mobile phone. I thank you for all your work, and would be happy, if you reply to my lines, witch I wrote in this small context.

    Props to the $Header, of the script, from witch I’m very impressed of.

    I wish all the best…

    Jan

Leave a Reply

Discover more from SmartTechWays - Innovative Solutions for Smart Businesses

Subscribe now to keep reading and get access to the full archive.

Continue reading