Solved

Set ORACLE_HOME

Posted on 2010-09-11
10
1,384 Views
Last Modified: 2012-05-10
Hey I need to set ORACLE_HOME, LD_LIBRARY_PATH, PATH in solaris. So how can I set it. Can you guys please help me out. Thanks for your help in advance.
0
Comment
Question by:hussainkhan22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 84 total points
ID: 33653785
what shell are you using to log in to? you just need to change your profile to reflect this

eg if bourne shell /bin/sh  (just login and do   ps    to see the shell)

edit .profile (note the dot)

ORACLE_HOME=/usr/.... wherever
export ORACLE_HOME

LD_LIBRARY_PATH=/....
export LD_LIBRARY_PATH

PATH=$PATH:$ORACLE_HOME:$ORACLE_HOME/bin
export PATH


dont update /etc/profile unless you want changes made for ALL users. It is not recommended to do that.
0
 
LVL 15

Expert Comment

by:Devinder Singh Virdi
ID: 33653812
Alternately you can use ". oraenv" to set oracle_home and sid.
you can set env variables in single line as
export PATH=$PATH:$ORACLE_HOME .....
 
0
 

Author Comment

by:hussainkhan22
ID: 33654055
Hey alst question on this. I think we have 4 shell like c shell, bourn shell, korn shell and bash shell. So can you tell me the location where environments are set in all this 4 shell. I really appreciate your help. Thanks for your help in advance.
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 65

Expert Comment

by:rockiroads
ID: 33654119
go to your home directory and do ls -a (-a required to see hidden files)

then find the profiles

eg .profile
or .kshrc for kourne shell
or .cshrc for cshell

depending on shell, the code would be different for eg csh is    setenv PATH $PATH:/usr/...

0
 
LVL 4

Assisted Solution

by:boriskalavsky
boriskalavsky earned 84 total points
ID: 33655205
.profile for ksh
.login for c-shell
.bash_profile for bash
.profile for sh
0
 
LVL 25

Assisted Solution

by:madunix
madunix earned 166 total points
ID: 33660022
sample of my bash profile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=intranet; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$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

if [ $USER = "oracle" ]; then
  if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
  else
    ulimit -u 16384 -n 65536
  fi
fi
0
 
LVL 1

Assisted Solution

by:priyank_22in
priyank_22in earned 83 total points
ID: 33660462
Edit this file and update with this text - Check all your path and set accordingly.
/home/oracle/.bash_profile

###########
#   New   #
###########
# .bash_profile


# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

########
export TMP=/u01/app/oracle/tmp;
export TMPDIR=$TMP;
export ORACLE_BASE=/u01/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1;
export ORACLE_SID=<SID>;
export ORACLE_TERM=xterm;
export PATH=/usr/sbin:$PATH;
export PATH=$ORACLE_HOME/bin:$PATH;
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
export SHLIB_PATH=$ORACLE_HOME/lib32:$SHLIB_PATH

Thanks - P
0
 
LVL 1

Expert Comment

by:jtaneh
ID: 33660723
Generally, it will be better to write a script to set the environment manually. To "activate" the environment settings,  you will need to execute the script e.g. ". ./setoraenv", where you run with a '.' with a space and then dot slash and the name of the script. You may use the following that shall be suitable for different types of shell such as "sh", "bash" or "ksh". Usually the script can be placed at the home directory of the user ID "oracle" for your environment.



## start of script
PATH=$PATH:/u01/bin:/u01/sbin
ORA_HOME=/u01
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/u01/lib

export PATH ORA_HOME LD_LIBRARY_PATH
# end of script
0
 
LVL 25

Assisted Solution

by:madunix
madunix earned 166 total points
ID: 33660754
for more info about installing Oracle look @
http://ivan.kartik.sk/oracle/install_ora10gR2_redhat.html  (it might help)

0
 
LVL 77

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 83 total points
ID: 33661313
It's been many years since I've use Oracle on UNIX but I don't think things have changed that much.

I would strongly suggest you look at virdi_ds' post in http:#a33653812.  Oracle provides scripts to properly set up the environment.  These scripts are oraenv (For bourne and ksh style shells) and coraenv (for csh and similar shells).  

This will save to a lot of headache if your Oracle environment ever changes.  You will not need to go through all your users profiles and change things.

The basics for using it goes like (using ksh syntax):

#replace ORCL with a valid SID.
export ORACLE_SID=ORCL
export ORAENV_ASK=NO
. oraenv

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question