Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: LD_LIBRARY_PATH in multi-home environment
I use the following...
sids=`cat /etc/oratab | grep -v "#" | grep -v '*' | cut -f1,4 -d: |
sort`
PS3="Please select an ORACLE environment from the list above: "
select sid in $sids; do
export ORACLE_SID="$sid"
export ORACLE_HOME=`grep "$sid": /etc/oratab | cut -f2 -d:`
export PS1=`uname -n`':$LOGNAME:$ORACLE_SID:$PWD>'
export
PATH=/opt/ansic/bin:/usr/bin:/usr/local/bin:/usr/contrib/bin:/usr/ucb:$ORACLE_HOME/bin:.:~/bin:/opt/perf/bin:/opt/java1.3/jr
e/bin
export
CLASSPATH=$ORACLE_HOME/jdbc/lib/classes12.zip:/home/oracle/java:.
break
done
Purists will agrue that oraenv should be used, but I have used the above (or a derivative) for almost ten years without an issue.
Regardless, I would use somthing where you loop through oratab, and set the parameters according to the ORACLE_SID you choose. You can use ORAENV_ASK to set the parameters (using oraenv) based on your current ORACLE_SID without asking you to confirm, too.
Regards,
Steve Received on Tue Apr 18 2006 - 12:46:32 CDT