Install sqlplus instant client on macOS

Download Instant Client for macOS
http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html#ic_osx_inst

Alexs-MBP:Downloads alexlima$ pwd
/Users/alexlima/Downloads
Alexs-MBP:Downloads alexlima$ ls -lrt in*
-rw-r–r–@ 1 alexlima staff 68160048 Jan 25 11:13 instantclient-basic-macos.x64-12.2.0.1.0-2.zip
-rw-r–r–@ 1 alexlima staff 905985 Jan 25 11:14 instantclient-sqlplus-macos.x64-12.2.0.1.0-2.zip
-rw-r–r–@ 1 alexlima staff 673883 Jan 25 11:14 instantclient-sdk-macos.x64-12.2.0.1.0-2.zip
# Unzip basic libraries
Alexs-MBP:Downloads alexlima$ unzip instantclient-basic-macos.x64-12.2.0.1.0-2.zip
Archive: instantclient-basic-macos.x64-12.2.0.1.0-2.zip
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 instantclient-sqlplus-macos.x64-12.2.0.1.0-2.zip
Archive: instantclient-sqlplus-macos.x64-12.2.0.1.0-2.zip
inflating: SQLPLUS_README
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 instantclient-basic-macos.x64-12.2.0.1.0-2.zip
-rw-r–r–@ 1 alexlima staff 905985 Jan 25 11:14 instantclient-sqlplus-macos.x64-12.2.0.1.0-2.zip
-rw-r–r–@ 1 alexlima staff 673883 Jan 25 11:14 instantclient-sdk-macos.x64-12.2.0.1.0-2.zip
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
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oradb1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
# Connect to a remote database with sqlplus
Alexs-MBP:admin alexlima$ sqlplus alima/xxxxx@orcl
SQL*Plus: Release 12.2.0.1.0 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 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>
# 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
DONE..

 

2 comments

Leave a Reply to Adam Cancel reply

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

WordPress.com Logo

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

Google photo

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

Twitter picture

You are commenting using your Twitter 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.