- Get Oracle instant client for MacOSX
- Go to the download site - http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
- Download "instantclient-basic-macos.x64-12.1.0.2.0.zip"
- Download "instantclient-sqlplus-macos.x64-12.1.0.2.0.zip"
- Download "instantclient-sdk-macos.x64-12.1.0.2.0.zip"
- Unarchive downloaded zip files into a same directory
- ex:
$HOME/Downloads/instantclient_12_1
- Create
install.sh
and copy the following code and past it on that file. - Run
source /usr/local/share/instantclient/instantclient.sh
- Run
sqlplus
to check if you can run "sqlplus" in any place - Add
source /usr/local/share/instantclient/instantclient.sh
to your .bashrc
Hello all,
Instead of mv'ing the files we should just cp'ing all the files.
Refresh the Symlinks with -sfn flag.
Preserve the "/opt/Oracle/product/" directory, like installing the DB or GRID.
I tried this and it worked as expected :
`#!/bin/bash
set -e
export ORACLE_VERSION="12.2.0.1.0"
mkdir -p /opt/Oracle/product/$ORACLE_VERSION/bin
mkdir -p /opt/Oracle/product/$ORACLE_VERSION/lib
mkdir -p /opt/Oracle/product/$ORACLE_VERSION/jdbc/lib
mkdir -p /opt/Oracle/product/$ORACLE_VERSION/rdbms/jlib
mkdir -p /opt/Oracle/product/$ORACLE_VERSION/sqlplus/admin
mkdir -p /opt/Oracle/product/$ORACLE_VERSION/instantclient
cp -R sdk /opt/Oracle/product/$ORACLE_VERSION/lib/
cp -R ojdbc* /opt/Oracle/product/$ORACLE_VERSION/jdbc/lib/
cp -R x*.jar /opt/Oracle/product/$ORACLE_VERSION/rdbms/jlib/
cp -R glogin.sql /opt/Oracle/product/$ORACLE_VERSION/sqlplus/admin/
cp -R dylib /opt/Oracle/product/$ORACLE_VERSION/lib/
cp -R *README /opt/Oracle/product/$ORACLE_VERSION/
cp -R * /opt/Oracle/product/$ORACLE_VERSION/bin/
echo "Creating SymLinks"
ln -sfn /opt/Oracle/product/$ORACLE_VERSION/bin/sqlplus /usr/local/bin/sqlplus
ln -sfn /opt/Oracle/product/$ORACLE_VERSION/lib/libclntsh.dylib.12.1 libclntsh.dylib
echo "Creating env variables"
echo "
export ORACLE_BASE=/opt/Oracle/
export ORACLE_HOME=$ORACLE_BASE/product/$ORACLE_VERSION
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
export OCI_DIR=$DYLD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_BASE/admin/network
" > /opt/Oracle/instantclient.sh
echo "Done!"
echo
echo "Next step: Add the following code to your ~/.bashrc"
echo "source /opt/Oracle/instantclient.sh"`
HackBook-Pro:~ test$ date;env | grep -i oracle
Fri Oct 26 20:54:22 CDT 2018
OCI_DIR=/opt/Oracle//product/12.2.0.1.0/lib
ORACLE_BASE=/opt/Oracle/
TNS_ADMIN=/opt/Oracle//admin/network
ORACLE_HOME=/opt/Oracle//product/12.2.0.1.0
HackBook-Pro:~ test$ date; sqlplus
Fri Oct 26 20:54:32 CDT 2018
SQL*Plus: Release 12.2.0.1.0 Production on Fri Oct 26 20:54:33 2018
Copyright (c) 1982, 2017, Oracle. All rights reserved.
Enter user-name: