Download the desired Instant Client ZIP files. All installations require the Basic or Basic Light package.
Unzip the packages into a single directory such as "~/instantclient_12_1". For example, to use SQL*Plus:
cd ~
unzip instantclient-basic-macos.x64-12.1.0.2.0.zip
Create the appropriate libclntsh.dylib link for the version of Instant Client. For example:
cd ~/instantclient_12_1
ln -s libclntsh.dylib.12.1 libclntsh.dylib
OCCI programs will additionally need:
ln -s libocci.dylib.12.1 libocci.dylib
Add links to ~/lib or /usr/local/lib to enable applications to find the libraries. For example, OCI based applications could do:
mkdir ~/lib
ln -s ~/instantclient_12_1/libclntsh.dylib ~/lib/
ln -s ~/instantclient_12_1/libclntsh.dylib.12.1 ~/lib/
Alternatively, copy the required libraries. For example, to use OCI applications:
mkdir ~/lib
cp /opt/oracle/instantclient_12_1/libclntsh.dylib.12.1 ~/lib/
cp /opt/oracle/instantclient_12_1/libclntshcore.dylib.12.1 ~/lib/
cp /opt/oracle/instantclient_12_1/libons.dylib ~/lib/
cp /opt/oracle/instantclient_12_1/libnnz12.dylib ~/lib/
cp /opt/oracle/instantclient_12_1/libociei.dylib ~/lib/
Note: Custom OCI applications, such as those that bundle Instant Client, may want to link with -rpath set to the directory containing Instant Client 12.1 instead of relying on libraries being in ~/lib.
To be able to run SQL*Plus, update PATH. For example:
export PATH=~/instantclient_12_1:$PATH
Run SQL*Plus and connect using your database credentials and connection string:
sqlplus hr/welcome@localhost/orclpdb
Installing Instant Client 11.2 on macOS
Instant Client 11.2 supports macOS X Lion, Mountain Lion and Mavericks.
Download the desired Instant Client ZIP files. All installations require the Basic or Basic Light package.
Unzip the packages into a single directory such as "~/instantclient_11_2". For example, to use SQL*Plus:
cd ~
unzip instantclient-basic-macos.x64-11.2.0.4.0.zip
unzip instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
< 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
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,libnnz11.dylib,\
libociei.dylib} ~/lib/
To be able 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
Run SQL*Plus and connect using your database credentials and connection string:
sqlplus hr/welcome@localhost/orclpdb