Skip to content

Installation of Oracle on OSX

opak edited this page Jan 2, 2016 · 13 revisions

Instant Client

  1. Download appropriate version from Oracle and unzip. link
  2.  mkdir -p /usr/local/Oracle/product/instantclient/11.2.0.4.0/bin  
    
     mkdir -p /usr/local/Oracle/product/instantclient/11.2.0.4.0/lib  
    
     mkdir -p /usr/local/Oracle/product/instantclient/11.2.0.4.0/jdbc/lib  
    
     mkdir -p /usr/local/Oracle/product/instantclient/11.2.0.4.0/rdbms/jlib  
    
     mkdir -p /usr/local/Oracle/product/instantclient/11.2.0.4.0/sqlplus/admin  
    
    
  3.  mv ojdbc* /usr/local/Oracle/product/instantclient/11.2.0.4.0/jdbc/lib/
     mv x*.jar /usr/local/Oracle/product/instantclient/11.2.0.4.0/rdbms/jlib/
     mv glogin.sql /usr/local/Oracle/product/instantclient/11.2.0.4.0/sqlplus/admin/
     mv *dylib* /usr/local/Oracle/product/instantclient/11.2.0.4.0/lib/ 
     mv *README /usr/local/Oracle/product/instantclient/11.2.0.4.0/
     mv * /usr/local/Oracle/product/instantclient/11.2.0.4.0/bin/
    
    
  4.  cd /usr/local/bin
     ln -s ../Oracle/product/instantclient/11.2.0.4.0/bin/sqlplus sqlplus
    
    
  5.  cd /usr/local/Oracle/product/instantclient/11.2.0.4.0
     mkdir -p share/instantclient
     cd /usr/local/share
     ln -s ../Oracle/product/instantclient/11.2.0.4.0/share/instantclient/ instantclient
    
    
  6.  echo "export ORACLE_BASE=/usr/local/Oracle \
           export ORACLE_HOME=$ORACLE_BASE/product/instantclient/11.2.0.4.0 \
           export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib \
           export TNS_ADMIN=$ORACLE_BASE/admin/network" >> /usr/local/share/instantclient/instantclient.sh 
    
    
  7. echo "source /usr/local/share/instantclient/instantclient.sh" >> ~/.zhrc
    
    

Based on this post

Database

For database installation we recommend to use some of docker's image available.

Driver dependencies

  1. Download Oracle SDK link

  2. move sdk to $ORACLE_HOME

  3.     echo "export OCI_LIB_DIR=$ORACLE_HOME/lib
           export OCI_INC_DIR=$ORACLE_HOME/sdk/include" >> /usr/local/share/instantclient/instantclient.sh 
    
    
  4. cd $ORACLE_HOME/lib

  5. ln -s {libclntsh.dylib.11.1,libnnz11.dylib,libociei.dylib} /usr/local/lib

  6.   echo "export INSTANT_CLIENT_LIB_PATH=$ORACLE_HOME/lib
            export INSTANT_CLIENT_INCLUDE_PATH=$ORACLE_HOME/sdk/include" >> ~/.zshrc 
    
    

Compile issues:

Check your .zshrc:

export INSTANT_CLIENT_LIB_PATH=/usr/local/Oracle/product/instantclient/11.2.0.4.0/lib
export INSTANT_CLIENT_INCLUDE_PATH=/usr/local/Oracle/product/instantclient/11.2.0.4.0/sdk/include
export OCI_INCLUDE_DIR=/usr/local/Oracle/product/instantclient/11.2.0.4.0/sdk/include
export ERL_INTERFACE_DIR=/usr/local/lib/erlang/lib/erl_interface-3.8
  • brew install libevent
  • cd usr/local/Oracle/product/instantclient/11.2.0.4.0/lib/
  • ln -s libocci.dylib.11.1 libocci.dylib
  • ln -s libclntsh.dylib.11.1 libclntsh.dylib

if you have problem with event.h run:

xcode-select --install