SQL*PLus on Mac

December 1st, 2016

I would think installing SQL*Plus on the Mac would be point, click download, point click, install bam it works.


It did install mostly straight forward on my old Mac. Got a new Mac and no dice.

Tried installing myself guessing at the downloads. First of all why isn’t there just one download?

Downloaded instantclient and instantclient with SQL*Plus which turns out to be correct, but no dice. Still got errors.

Got errors. Gave up.

Came back again to look at it yesterday and followed this:


worked like a charm.

Then I ran a shell script that used SQL*Plus oramon.sh and get the error

dyld: Library not loaded: /ade/dosulliv_sqlplus_mac/oracle/sqlplus/lib/libsqlplus.dylib
Referenced from: /Applications/oracle/product/instantclient_64/
Reason: image not found

so I set my environment variable


Let’s check the environment variable:

$ env | grep LIB

Huh?! Where is my environment variable?

Apparently you can’t set DYLD_LIBRARY_PATH on Mac without over riding some security settings which didn’t sound attractive.

I googled around and found


which didn’t work for me. Then found


which has as a solution to set the library path inside an alias for SQL*Plus – cool!

alias sqlplus=”DYLD_LIBRARY_PATH=/Applications/oracle/product/instantclient_64/ sqlplus”

and I put that into my ~/.bashrc and it worked!


  1. Trackbacks

  2. No trackbacks yet.

  2. | #1


    Maybe you should have used SQLcl?




  3. Niggle
    | #2

    @Tim Hall
    Hi Tim,
    looking just at the title of this post, I was going to reply the same thing :)

    A lot of info here also: http://krisrice.blogspot.fr/


  4. Dave
    | #3

    I simply added the following to my .profile:
    export DYLD_LIBRARY_PATH=/opt/oracle/instantclient_11_2:$DYLD_LIBRARY_PATH

    I don’t recall having to do anything special to override Mac security, but it’s been a while, so I may forgotten it by now.

    In any case, sqlplus works fine from bash. I haven’t called it from a shell script or cron job, however.


  5. khailey
    | #4

    Hi Tim,

    Thanks for the comment. I didn’t try SQLcl. I saw in the digging around for the SQL*Plus error solutions that it was mentioned. The main reason I didn’t tied it is the scrips I use depend on a lot of SQL*PLus setting and figured the chance of SQLcl being completely compatible were slim, but then again I didn’t actually try it.

  6. khailey
    | #5

    Hi Dave,
    Thanks for the feedback.
    Maybe the reason sqlplus worked on my old Mac was because it was an older OS version and now security is higher – not sure.
    Now however, if I set DYLD_LIBRARY_PATH in my .profile it doesn’t care over into my subshells.
    I can get sqlplus to run in my login shell but not inside of scripts.
    Hard coding DYLD_LIBRARY_PATH in the scripts works, but that’s a bit brittle.
    I though the alias solutions was pretty nifty.

× 5 = thirty five