Skip to content

Instantly share code, notes, and snippets.

@plasx
Forked from addodelgrossi/instantclientguide.md
Created May 23, 2018 03:23
Show Gist options
  • Save plasx/3201f4f784636bc1f33aa2747afdfce7 to your computer and use it in GitHub Desktop.
Save plasx/3201f4f784636bc1f33aa2747afdfce7 to your computer and use it in GitHub Desktop.
Installing instant client 12 on macOS Sierra

Installing Oracle Mac OS Sierra

Download

  • instantclient-basic-macos.x64-12.2.0.1.0.zip
  • instantclient-sqlplus-macos.x64-12.2.0.1.0.zip
  • instantclient-sdk-macos.x64-12.2.0.1.0.zip

Create a directory /usr/local/lib/share/oracle

export ORACLE_HOME=/usr/local/lib/share/oracle
export VERSION=12.2.0.1.0
export ARCH=x86_64
    
mkdir -p $ORACLE_HOME

Copy Instant Client Basic & SDK to /usr/local/lib/share/oracle

cd ~/Downloads
cp instantclient-basic-macos.x64-$VERSION.zip $ORACLE_HOME
cp instantclient-sdk-macos.x64-$VERSION.zip $ORACLE_HOME
cp instantclient-sqlplus-macos.x64-$VERSION.zip $ORACLE_HOME    

Unpack both files to that directory:

cd $ORACLE_HOME
tar -xzf instantclient-basic-macos.x64-$VERSION.zip
tar -xzf instantclient-sdk-macos.x64-$VERSION.zip
tar -xzf instantclient-sqlplus-macos.x64-$VERSION.zip

Create Symbolic links in the instant client folder in /user/local/lib/share/oracle

cd instantclient_12_2
ln -s libclntsh.dylib.12.1 libclntsh.dylib
ln -s libocci.dylib.12.1 libocci.dylib

export DYLD_LIBRARY_PATH=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME

now you can get rid of the zip files you downloaded as they aren't needed anymore

cd /usr/local/lib/share/oracle
rm instantclient-basic-macos.x64-$VERSION.zip
rm instantclient-sdk-macos.x64-$VERSION.zip
rm instantclient-sqlplus-macos.x64-$VERSION.zip

move all the files & folders outside of /instantclient_12_2 to the parent directory /usr/local/lib/share/oracle

mv  -v $ORACLE_HOME/instantclient_12_2/* /$ORACLE_HOME/
rm -rf instantclient_12_2/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment