The leading edge of scripting languages and Oracle Database brought to you by the Data Access Development team

Using SQL*Plus Instant Client 11.2 on OS X El Capitan

Christopher Jones
Senior Principal Product Manager

The installation steps for using SQL*Plus 11.2 (Instant Client) and other OCI-based applications have necessarily changed since OS X El Capitan broke DYLD_LIBRARY_PATH. The updated instructions are given on the Instant Client Downloads for Mac OS X (Intel x86) page.

Update: Instant Client 12.1 is out and installation is easier. Check out the above link for instructions

Here are the 11.2 instructions repeated. The steps also work on earlier versions of OS X:

  1. Download the desired Instant Client ZIP files from OTN. All installations require the Basic or Basic Lite package.

  2. Open a terminal and unzip the packages into a single directory such as "~/instantclient_11_2". For example, to use SQL*Plus:

    cd ~
    unzip instantclient-basic-macos.x64-
    unzip instantclient-sqlplus-macos.x64-
  3. Create the appropriate libclntsh.dylib link for the version of Instant Client. For example:

    cd ~/instantclient_11_2
    ln -s libclntsh.dylib.11.1 libclntsh.dylib

    Note: OCCI programs will additionally need:

    ln -s libocci.dylib.11.1 libocci.dylib
  4. Add links to "~/lib" for required Basic package libraries. For example, to use OCI programs (including SQL*Plus, Python's cx_Oracle, PHP's OCI8, Node.js's node-oracledb, and Ruby's ruby-oci8 driver):

    mkdir ~/lib
    ln -s ~/instantclient_11_2/libclntsh.dylib.11.1 ~/lib/
    ln -s ~/instantclient_11_2/{libnnz11.dylib,libociei.dylib} ~/lib/
  5. To run SQL*Plus, add its libraries to "~/lib", and update PATH. For example:

    ln -s ~/instantclient_11_2/{libsqlplus.dylib,libsqlplusic.dylib} ~/lib/
    export PATH=~/instantclient_11_2:$PATH

Join the discussion

Comments ( 2 )
  • Mark Wagner Friday, February 15, 2019
    well this almost worked but i got:
    Terrapins-MBP:~ Terrapin$ sqlplus
    Error 6 initializing SQL*Plus
    SP2-0667: Message file sp1.msb not found
    SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

    and i dont know how to do that because i dont know where it is on my system
  • Christopher Jones Friday, February 15, 2019
    Use Instant Client 12.2 and follow the installation instructions https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html#ic_osx_inst

    My ~/lib directory simply has:

    $ ls -l ~/lib
    total 0
    lrwxr-xr-x 1 cjones staff 43 19 Jul 2018 libclntsh.dylib -> /Users/cjones/instantclient_12_2/libclntsh.dylib
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.