installing Oracle Instantclient on Mac OS/X without setting environment variables? - oracle

Oracle's instructions specify setting DYLD_LIBRARY_PATH. This makes my application dependent on random users' configuration and is very troublesome to set up.
How can I avoid having to set any environment variables?
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html
related note for linux: installing Oracle Instantclient on Linux without setting environment variables?

Oracle's instantclient installation instructions specify that the user set DYLD_LIBRARY_PATH. This is very troublesome to manage for multiple users.
To use the instantclient without setting any environment variables:
Download the instantclient distribution from oracle.com. For doing non-java software development, you will need (assuming Oracle 10.2):
instantclient-basic-macosx-10.2.0.4.0.zip
instantclient-sdk-macosx-10.2.0.4.0.zip
instantclient-sqlplus-macosx-10.2.0.4.0.zip
Unzip the three files. This will give you a directory
instantclient_10_2/
Copy the files to /usr, which is one of the default places the dynamic loader searches.
sudo cp instantclient_10_2/sdk/include/*.h /usr/include
sudo cp instantclient_10_2/sqlplus /usr/bin
sudo cp instantclient_10_2/*.dylib /usr/lib
If you use tnsnames.ora, copy it to /etc, which is the default global place the oracle runtime searches.
sudo cp tnsnames.ora /etc
Test with
/usr/bin/sqlplus scott/tiger#myoracle

If your goal is simply to run sqlplus on your MacBook, this might work for you. Remove the DYLD_LIBRARY_PATH environment variable from ~/.bashrc and replace it with an alias:
alias sqlplus="DYLD_LIBRARY_PATH=/Applications/instantclient_11_2 sqlplus"
Blog entry: sqlplus and DYLD_LIBRARY_PATH on Mac OS/X

After much research I found an sustainable solution to this error, that involves editing Apache's launchd configuration .plist file to specify the required DYLD_LIBRARY_PATH, ORACLE_HOME, and LD_LIBRARY_PATH environment variables.
You can view the full answer here: https://stackoverflow.com/a/20670810/1914455

Related

Yarn (Binary) Offline installation on Centos 7

How do i install Yarn (binary) offline on Centos 7. The machine doesn't have internet. Apologise if the question has been asked before.
I couldn't find it anywhere. All Questions point to using Yarn in offline mode but not how to install it offline at the first place.
Finally, i managed to do it via tarball (Note this is Linux installation).
You can install Yarn by downloading a tarball and extracting it anywhere.
cd /opt
wget https://yarnpkg.com/latest.tar.gz
tar zvxf latest.tar.gz
Yarn is now in /opt/yarn-[version]/
the following steps will add Yarn to path variable and run it from anywhere.
Note: your profile may be in your .profile, .bash_profile, .bashrc, .zshrc, etc.
Add this to your profile:
export PATH="$PATH:/opt/yarn-[version]/bin"
(the path may vary depending on where you extracted Yarn to)
In the terminal, log in and log out for the changes to take effect
To have access to Yarn’s executables globally, you will need to set up the PATH environment variable in your terminal. To do this, add
export PATH="$PATH:`yarn global bin`"
to your profile.
Here is the link i found it
Although Yarn can work in offline mode, the packages must be downloaded and stored in the in an offline mirror. Refer to this article.
Your Centos machine will need to be connected to another machine that has access to the Internet. The most common solution is to set up a http/https proxy, then set up yarn to use the proxy
yarn config set proxy http://proxy.server.com:8080
yarn config set https-proxy http://proxy.server.com:8080

anaconda search path for environments?

Can the anaconda tools that manipulate environments use a search path when looking for environments?
I would like to have a single anaconda installation shared among our group, with a shared set of read-only environments and each user also having their own set of writable personal environments.
Commands like conda env list and conda info -e would have to iterate over an environment search path. So would activate.
Does conda support such an architecture?
I think the answer yes, the envs_dirs configuration parameter can be set in your $HOME/.configrc file (looks like yaml) to change the list of directories searched for environments. You can also set the conda environment search path via the CONDA_ENVS_PATH shell environment variable
https://conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html#specify-environment-directories-envs-dirs
However the specific usage scenario outlined above is already handled without modifying any configuration parameters.
If the anaconda install directory is not writable, then conda searches both the shared environments and the environments under $HOME/.conda/envs.
If the anaconda installation directory is writable, the per-user environments in $HOME/envs are silently ignored.

ASM and ORACLE switching environments?

I've just installed ASM and try to change environment using this commands but its not working
1)Did you installed it properly? May be you missed something...
2)Check your .bash_profile file. It is a hidden file stored in oracle users’ home directory /home/oracle
3)You have a lot of mistakes try this
change root to oracle:
su - oracle
then try this commands
export ORACLE_SID=+ASM
export ORAENV_ASK=NO
. oraenv
and then check with this command: which sqlplus
If its not working reboot it.

Cygwin not executing .bashrc after Heroku Toolbelt Windows install

After installing Heroku Toolbelt, Cygwin is no longer executing .bashrc How do I fix this?
This heroku/toolbelt issue on github Creates/overwrites ENV['HOME'] on Windows, which breaks Cygwin says to
Renaming HOME to %USERPROFILE% evidently fixes this
My HOME System Properties Variable is already named %USERPROFILE%.
Being a noobie I focused on a PATH issue. I began changing my System Path Variable to include the .bashrc PATH
C:\cygwin\home\usermatt
I then tried various system PATH variables, one at a time, restarting my machine each time:
C:\cygdrive\c\home\usermatt\
C:\home\usermatt\
C:\cygwin\c\home\usermatt\
Cygwin's pwd on startup is /cygdrive/c/Users/usermatt. I tried moving .bashrc here without success.
The Cygwin FAQs and the comments in the file itself warn of problems after editing the etc/profile file and I did not try this.
All was well before installing Heroku Toolbelt. How can I get Cygwin to find the .bashrc file?
According to the link you provided:
you need to remove the HOME environment variable from the system
properties. Look how to set/remove variables from Windows permanently.
This will depend on your Windows OS, but in general:
Right click on your "Computer" and select Properties
Click on "Advanced System Settings"
Click on "Environment Variables..."
Find and delete the Home variable
OK your way out and try Cygwin again

MacPorts Installation -- Shell Commands/Postflight Script

I had run the MacPorts installer (2.0.3) for my OS X Leopard (10.5.8) which finished "successfully". Unfortunately the port command was not available so I looked in the MacPorts Guide which says that the installer should have run a so-called "postflight" script that sets the necessary environment variables. I tried to run the postflight script manually (which I downloaded from here), but the execution fails with the following output:
Detected the bash shell.
Your shell already has the right PATH environment variable for use with
MacPorts!
Your shell already has the right MANPATH environment variable for use with
MacPorts!
Your shell already has the right DISPLAY environment variable for use with
MacPorts!
Adding [default] tag to sources.conf if needed...
couldn't read file "/Contents/Resources/upgrade_sources_conf_default.tcl": no
such file or directory
Updating port image format...
couldn't read file "/Contents/Resources/images_to_archives.tcl": no such file or
directory
Synchronizing the MacPorts installation with the project's rsync server...
-bash: __PREFIX__/bin/port: No such file or directory
An attempt to synchronize your recent MacPorts installation with the project's
rsync server failed!
Please run 'sudo port -d selfupdate' manually to find out the cause of the
error.
You have succesfully installed the MacPorts system, launch a terminal and try it
out!
Read the port(1) manual page and http://guide.macports.org for help,
http://www.macports.org/contact.php if you need to get in touch with The
MacPorts Project.
Any ideas?
First invoke the port command directly:
$ /opt/local/bin/port help
If that comes back with something reasonable (like the help text) then it's just that your $PATH isn't being used by your current shell. Try logging off and back on again to resolve that in the short term (this will test that your .bashrc file is correctly configured) or you could just modify the PATH environment variable directly (which doesn't test .bashrc):
$ export PATH=$PATH:/opt/local/bin
You downloaded the postflight script but it alone cannot access the accessory scripts in Contents/ because those are located into the install package.
Those missing Tcl scripts are for upgrading from an older install, the log says PATH was already correctly configured but the macports bin directory could have the wrong position in PATH variables, for instance being at the end of PATH.
If you are doing a fresh install you can just only need PATH and MANPATH -you want man pages provided by macports before system's ones- as per [1]
[1] http://guide.macports.org/#installing.shell.postflight

Resources