Solved

Set ORACLE_HOME

Posted on 2010-09-11
10
1,373 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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 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.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now