[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Set ORACLE_HOME

Posted on 2010-09-11
10
Medium Priority
?
1,390 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 336 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 336 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 664 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 332 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 664 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 332 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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 syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

650 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