Generally, you will need to setup these environment variables:
| $ORACLE_HOME | |
|---|---|
| $LD_LIBRARY_PATH
$LIBPATH | $LIBPATH if you're on AIX, $LD_LIBRARY_PATH everywhere else |
| $TNS_ADMIN | if your tnsnames.ora is located somewhere other than $ORACLE_HOME/network/admin/ |
| $PERL5LIB | if you have Perl scripts that need to use DBD::Oracle |
| $PATH | add "$ORACLE_HOME/bin/" |
TODO: explain how I find the proper values of these
export PATH="$( echo "$PATH" | perl -F: -nale 'print join(":", grep { ! /\Q$ENV{ORACLE_HOME}\E/i } @F )' )"
export PERL5LIB="$( echo "$PERL5LIB" | perl -F: -nale 'print join(":", grep { ! /\Q$ENV{ORACLE_HOME}\E/i } @F )' )"
export LD_LIBRARY_PATH="$( echo "$LD_LIBRARY_PATH" | perl -F: -nale 'print join(":", grep { ! /\Q$ENV{ORACLE_HOME}\E/i } @F )' )"
unset ORACLE_HOME TNS_ADMIN