Solved

Set ORACLE_HOME

Posted on 2010-09-11
10
1,381 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
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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 76

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

786 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