Install sqlplus instant client on macOS

Download Instant Client for macOS

Alexs-MBP:Downloads alexlima$ pwd
Alexs-MBP:Downloads alexlima$ ls -lrt in*
-rw-r–r–@ 1 alexlima staff 68160048 Jan 25 11:13
-rw-r–r–@ 1 alexlima staff 905985 Jan 25 11:14
-rw-r–r–@ 1 alexlima staff 673883 Jan 25 11:14
# Unzip basic libraries
Alexs-MBP:Downloads alexlima$ unzip
inflating: instantclient_12_2/BASIC_README
inflating: instantclient_12_2/adrci
inflating: instantclient_12_2/genezi
linking: instantclient_12_2/libclntsh.dylib -> libclntsh.dylib.12.1
inflating: instantclient_12_2/libclntsh.dylib.12.1
inflating: instantclient_12_2/libclntshcore.dylib.12.1
inflating: instantclient_12_2/libnnz12.dylib
linking: instantclient_12_2/libocci.dylib -> libocci.dylib.12.1
inflating: instantclient_12_2/libocci.dylib.12.1
inflating: instantclient_12_2/libociei.dylib
inflating: instantclient_12_2/libocijdbc12.dylib
inflating: instantclient_12_2/libons.dylib
inflating: instantclient_12_2/liboramysql12.dylib
inflating: instantclient_12_2/ojdbc8.jar
inflating: instantclient_12_2/uidrvci
inflating: instantclient_12_2/xstreams.jar
finishing deferred symbolic links:
instantclient_12_2/libclntsh.dylib -> libclntsh.dylib.12.1
instantclient_12_2/libocci.dylib -> libocci.dylib.12.1
# Unzip sqlplus libraries
Alexs-MBP:Downloads alexlima$ unzip -j
inflating: glogin.sql
inflating: libsqlplus.dylib
inflating: libsqlplusic.dylib
inflating: sqlplus
Alexs-MBP:Downloads alexlima$ ls -lrt
-rw-r–r–@ 1 alexlima staff 68160048 Jan 25 11:13
-rw-r–r–@ 1 alexlima staff 905985 Jan 25 11:14
-rw-r–r–@ 1 alexlima staff 673883 Jan 25 11:14
drwxr-xr-x@ 18 alexlima staff 576 Jan 25 14:31 instantclient_12_2
# Move installation to user root folder
Alexs-MBP:Downloads alexlima$ mv instantclient_12_2/ ../
Alexs-MBP:Downloads alexlima$ mkdir -p ~/instantclient_12_2/network/admin
# Create symbolic links to /usr/local/lib
Alexs-MBP:Downloads alexlima$ ln -s ~/instantclient_12_2/libclntsh.dylib /usr/local/lib/
Alexs-MBP:Downloads alexlima$ sudo ln -s ~/instantclient_12_2/libclntsh.dylib /usr/local/lib/
Alexs-MBP:Downloads alexlima$ sudo ln -s ~/instantclient_12_2/libclntsh.dylib.12.1 /usr/local/lib/
# Create system variables
Alexs-MBP:Downloads alexlima$ export PATH=~/instantclient_12_2:$PATH
Alexs-MBP:Downloads alexlima$ export TNS_ADMIN=/Users/alexlima/instantclient_12_2/network/admin
Alexs-MBP:Downloads alexlima$ cd $TNS_ADMIN
Alexs-MBP:Downloads alexlima$ vi tnsnames.ora
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb1)(PORT = 1521))
# Connect to a remote database with sqlplus
Alexs-MBP:admin alexlima$ sqlplus alima/xxxxx@orcl
SQL*Plus: Release Production on Thu Jan 25 14:41:23 2018
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Last Successful login time: Thu Jan 25 2018 14:28:33 -07:00
Connected to:
Oracle Database 12c Enterprise Edition Release – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
# Add variables to .bash_profile
export SQLPATH=/Users/alexlima/Dropbox/BIAS_FTE/Training/AOT/scripts
export TNS_ADMIN=/Users/alexlima/instantclient_12_2/network/admin
export PATH=~/instantclient_12_2:$PATH



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.