Now I try to show how to set some environment variables so I only need to enter
sqlplusand can start my work without preparing anything first.
I know I could do this in my local
.profile, but I was looking for a more centralized way to provide them, maybe on a shared desktop where basic applications are installed just once.
This is all about OSX Mountain Lion - I'm working on 10.8.2 right now.
The variables I want to set/enhance are
That is quite simple: I just added (as root) a new line in
That was a little bit more tricky as I had to create (as root) the file first. In
there is one line now:
setenv ORACLE_HOME /Users/berx/instantclient_11_2
If you are curious what this is used for, it's the equivalent to Linux
LD_LIBRARY_PATH. This is needed for all applications which are linked dynamically. Even sqlplus is linked that way.
Unfortunately it can not be set in
/etc/launchd.conf. To be more precise, it CAN be set, but it will not show up in the terminal.
Instead it will create this line at the top of each terminal window direct after it opens:
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/login) is setuid or setgid
That's due to a security setting in Mountain Lion.
I decided to use the profile for this work. In my case
# ORACLE_HOME is set in /etc/launchd.conf !!
sqlplusdirectly from my terminal without caring about the environment anymore.
There is just one little drawback: all commands with setuid/setgid bit, like
sudonow throw a warning like this:
dyld: DYLD_ environment variables being ignored because main executable (/bin/ps) is setuid or setgid
But for me this is acceptable.
The only workaround I could imagine is any kind of wrapper for sqlplus.