Hi,
The How To has been extracted from the following link: http://www.joelennon.ie/2014/02/06/installing-oracle-instant-client-mac-os-x/
Oracle Database 10.2 and 11.1 are no longer available for download. The software is available as a media or FTP request for those customers who own a valid Oracle Database product license for any edition. Oracle® Database. Client Release Notes. 11 g Release 2 (11.2) for Apple Mac OS X (Intel). This document contains important information that was not included in the platform-specific or product-specific documentation for this release.
I just skipped some text and modified some paths to adapt it to oracle client 11.2.0.4 release.
1. Download the files from the Oracle Site
Be sure to grab the following two files:
- Instant Client Package – Basic
- Instant Client Package – SQL*Plus
2. Extract the files and create the proper folder structure.
Open a Terminal window and unzip the downloaded files.
$ unzip -qq instantclient-basic-macos.x64-11.2.0.4.0.zip
$ unzip -qq instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
Note: The -qq flag will tell the unzip utility to run in quieter mode, preventing any output from being displayed on the screen.
By default, the archive will extract all these files to a single directory. Instead, we’ll create a nicely structured directory to keep these files in your user Applications folder.
$ mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/bin
Oracle 11g Client Download
$ mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/lib
$ mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/jdbc/lib
$ mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/rdbms/jlib
$ mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/sqlplus/admin
$ mkdir -p /Applications/oracle/product/instantclient_64/11.2.0.4.0/network/admin
Next, move the files over to these directories as follows:
$ cd instantclient_11_2
$ mv ojdbc* /Applications/oracle/product/instantclient_64/11.2.0.4.0/jdbc/lib/
$ mv x*.jar /Applications/oracle/product/instantclient_64/11.2.0.4.0/rdbms/jlib/
$ mv glogin.sql /Applications/oracle/product/instantclient_64/11.2.0.4.0/sqlplus/admin/
$ mv *dylib* /Applications/oracle/product/instantclient_64/11.2.0.4.0/lib/
$ mv *README /Applications/oracle/product/instantclient_64/11.2.0.4.0/
$ mv * /Applications/oracle/product/instantclient_64/11.2.0.4.0/bin/
3. Create a proper tnsnames.ora file to define proper connection strings
Copy or create a tnsnames.ora file to /Applications/oracle/product/instantclient_64/11.2.0.4.0/network/admin/
Example:
Create the tnsnames.ora file with the vi editor, paste the following lines and save it.
MYDB=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=*********)
(PORT=1521)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SID=MYDB-SID)
) )
(You can better ask to a DBA to review the content of this file and ask her to provide you with a proper test connection)
4. Set up environment variables
Edit or create a file .bash_profile
$ cd /Users/UserName
$ vi ~/.bash_profile
if you haven’t created a .bash_profile before the file will be empty, otherwise just add the following lines to the end of the existing file.
export ORACLE_HOME=/Applications/oracle/product/instantclient_64/11.2.0.4.0
export PATH=$ORACLE_HOME/bin:$PATH
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
To load this profile, run the following command:
$ source ~/.bash_profile
Assuming you have set up your tnsnames.ora file correctly, you should now be able to connect one of the databases as follows:
5. Start using SQLPlus
$ sqlplus username/password@database
6. Did you enjoy? That’s all folks.
?
**********************************
Fixing command history for using SQLPlus line edition with arrow keys
If you have used the command-line SQLPlus in a Windows environment, you will probably be used to using the command history to execute previous SQL statements using the arrow keys. One thing you’ll notice in SQLPlus for the Mac is that this doesn’t work by default, if you hit the up key you’ll see a strange character sequence ^[[A rather than the previous command. Let’s go ahead and fix this now.
To do this, you’ll need to use rlwrap. You could download this from source and build it yourself, but I find it much easier to use the fantastic brew package manager for Mac OS X. Head over to http://brew.sh/ and follow the instructions to install and set up Homebrew (it’s very easy). With Homebrew installed, you can now easily install rlwrap on your system with one command:
$ ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
$ brew install rlwrap
The final thing you need to do is tell your system to use rlwrap whenever you use SQL*Plus. To do that, you’ll need to edit your .bash_profile file again.
$ vi ~/.bash_profile
Add the following line to the end of the file.
alias sqlplus=’rlwrap sqlplus’
Now reload the .bash_profile:
$ source ~/.bash_profile
Now, when you launch SQL*Plus and try to use the arrow keys to access previous commands, it will work.
Advertisements
Version 18.1.0.0.0 (64-bit)
Base - one of these packages is required
Name | Download | Description |
---|---|---|
Basic Package | All files required to run OCI, OCCI, and JDBC-OCI applications (71,982,447 bytes) (cksum - 1702106497) | |
Basic Light Package | Smaller version of the Basic package, with only English error messages and Unicode, ASCII, and Western European character set support (35,297,778 bytes) (cksum - 2930628103) |
Tools - optional packages
Name | Download | Description |
---|---|---|
SQL*Plus Package | The SQL*Plus command line tool for SQL and PL/SQL queries (916,567 bytes) (cksum - 1531146804) | |
Tools Package | Includes Data Pump, SQL*Loader and Workload Replay Client (1,205,728 bytes) (cksum - 3871420477) |
Development and Runtime - optional packages
Name | Download | Description |
---|---|---|
SDK Package | Additional header files and an example makefile for developing Oracle applications with Instant Client (Updated 5 March 2019) (925,639 bytes) (cksum - 1251767455) | |
JDBC Supplement Package | Additional support for Internationalization under JDBC (1,572,899 bytes) (cksum - 3513377311) | |
ODBC Package | Additional libraries for enabling ODBC applications (1,998,707 bytes) (cksum - 3748565934) | |
Precompiler Package | Precompiler Downloads | Additional files for Pro*C and Pro*COBOL |
Version 12.2.0.1.0 (64-bit) Updated 15-Jan-2018
Base - one of these packages is required
Name | Download | Description |
---|---|---|
Basic Package | All files required to run OCI, OCCI, and JDBC-OCI applications (68,160,048 bytes) (cksum - 2145539248) | |
Basic Light Package | Smaller version of the Basic package, with only English error messages and Unicode, ASCII, and Western European character set support (32,101,235 bytes) (cksum - 1597579561) |
Tools - optional packages
Name | Download | Description |
---|---|---|
SQL*Plus Package | The SQL*Plus command line tool for SQL and PL/SQL queries (905,985 bytes) (cksum - 3193372887) | |
Tools Package | Includes Data Pump, SQL*Loader and Workload Replay Client (1,188,607 bytes) (cksum - 4234197225) |
Development and Runtime - optional packages
Name | Download | Description |
---|---|---|
SDK Package | Additional header files and an example makefile for developing Oracle applications with Instant Client (673,883 bytes) (cksum - 3731483473) | |
JDBC Supplement Package | Additional support for Internationalization under JDBC (1,570,334 bytes) (cksum - 1705103068) | |
ODBC Package | Additional libraries for enabling ODBC applications (1,962,870 bytes) (cksum - 3397148646) | |
Precompiler Package | Precompiler Downloads | Additional files for Pro*C and Pro*COBOL |
Version 12.1.0.2 (64-bit) Updated 5-Jul-2017
Name | Download | Description |
---|---|---|
Instant Client Package - Basic | All files required to run OCI, OCCI, and JDBC-OCI applications (63,591,161 bytes) (cksum - 2819753276) | |
Instant Client Package - Basic Light | Smaller version of the Basic package, with only English error messages and Unicode, ASCII, and Western European character set support (31,539,594 bytes) (cksum - 1112518720) | |
Instant Client Package - JDBC Supplement | Additional support for XA, Internationalization, and RowSet operations under JDBC (143,238 bytes) (cksum - 988652685) | |
Instant Client Package - SQL*Plus | Additional libraries and executable for running SQL*Plus with Instant Client (871,943 bytes) (cksum - 1242636584) | |
Instant Client Package - ODBC | Additional libraries for enabling ODBC applications (1,865,942 bytes) (cksum - 2249115520) | |
Instant Client Package - SDK | Additional header files and an example makefile for developing Oracle applications with Instant Client (664,114 bytes) (cksum - 670890418) | |
Instant Client Package - WRC | Workload Replay Client used to replay workload for RAT's DB Replay Feature (236,151 bytes) (cksum - 3773150080) | |
Precompiler Package | Precompiler Downloads | Additional files for 'proc' binary and related files to precompile a Pro*C application and demo |
Version 12.1.0.2 (32-bit) Updated 4-Jan-17
Name | Download | Description |
---|---|---|
Instant Client Package - Basic | All files required to run OCI, OCCI, and JDBC-OCI applications (64,143,856 bytes) (cksum - 3075410801) | |
Instant Client Package - Basic Light | Smaller version of the Basic, with only English error messages and Unicode, ASCII, and Western European character set support (32,093,291 bytes) (cksum - 1437280362) | |
Instant Client Package - JDBC Supplement | Additional support for XA, Internationalization, and RowSet operations under JDBC (143,295 bytes) (cksum - 2965858677) | |
Instant Client Package - SQL*Plus | Additional libraries and executable for running SQL*Plus with Instant Client (892,440 bytes) (cksum - 1535728498) | |
Instant Client Package - ODBC | Additional libraries for enabling ODBC applications (1,883,055 bytes) (cksum - 1502599121) | |
Instant Client Package - SDK | Additional header files and an example makefile for developing Oracle applications with Instant Client (664,121 bytes) (cksum - 2233654893) | |
Instant Client Package - WRC | Workload Replay Client used to replay workload for RAT's DB Replay Feature (258,686 bytes) (cksum - 2882512306) | |
Precompiler Package | Precompiler Downloads | Additional files for 'proc' binary and related files to precompile a Pro*C application and demo |
Version 11.2.0.4.0 (64-bit)
Name | Download | Description |
---|---|---|
Instant Client Package - Basic | All files required to run OCI, OCCI, and JDBC-OCI applications (62,794,903 bytes) | |
Instant Client Package - Basic Light | Smaller version of the Basic, with only English error messages and Unicode, ASCII, and Western European character set support (26,034,836 bytes) | |
Instant Client Package - JDBC Supplement | Additional support for XA, Internationalization, and RowSet operations under JDBC (1,560,298 bytes) | |
Instant Client Package - SQL*Plus | Additional libraries and executable for running SQL*Plus with Instant Client (884,608 bytes) | |
Instant Client Package - SDK | Additional header files and an example makefile for developing Oracle applications with Instant Client (651,903 bytes) | |
Instant Client Package - WRC | Workload Replay Client used to replay workload for RAT's DB Replay Feature (235,951 bytes) | |
Precompiler Package | Precompiler Downloads | Additional files for 'proc' binary and related files to precompile a Pro*C application and demo |
Version 11.2.0.4.0 (32-bit)
Name | Download | Description |
---|---|---|
Instant Client Package - Basic | All files required to run OCI, OCCI, and JDBC-OCI applications (58,425,231 bytes) | |
Instant Client Package - Basic Light | Smaller version of the Basic, with only English error messages and Unicode, ASCII, and Western European character set support (23,003,182 bytes) | |
Instant Client Package - JDBC Supplement | Additional support for XA, Internationalization, and RowSet operations under JDBC (11,078 bytes) | |
Instant Client Package - SQL*Plus | Additional libraries and executable for running SQL*Plus with Instant Client (800,263 bytes) | |
Instant Client Package - SDK | Additional header files and an example makefile for developing Oracle applications with Instant Client (651,903 bytes) | |
Instant Client Package - WRC | Workload Replay Client used to replay workload for RAT's DB Replay Feature (197,708 bytes) | |
Precompiler Package | Precompiler Downloads | Additional files for 'proc' binary and related files to precompile a Pro*C application and demo |
Version 10.2.0.4 (64-bit)
Name | Download | Description |
---|---|---|
Instant Client Package - Basic | All files required to run OCI, OCCI, and JDBC-OCI applications (35,013,419 bytes) | |
Instant Client Package - Basic Light | Smaller version of the Basic, with only English error messages and Unicode, ASCII, and Western European character set support (10.2 only) (11,877,594 bytes) | |
Instant Client Package - JDBC Supplement | Additional support for XA, Internationalization, and RowSet operations under JDBC (1,493,189 bytes) | |
Instant Client Package - SQL*Plus | Additional libraries and executable for running SQL*Plus with Instant Client (746,094 bytes) | |
Instant Client Package - SDK | Additional header files and an example makefile for developing Oracle applications with Instant Client (603,530 bytes) |
Version 10.2.0.4 (32-bit)
Name | Download | Description |
---|---|---|
Instant Client Package - Basic | All files required to run OCI, OCCI, and JDBC-OCI applications (34,109,360 bytes) | |
Instant Client Package - Basic Light | Smaller version of the Basic, with only English error messages and Unicode, ASCII, and Western European character set support (10.2 only) (10,975,530 bytes) | |
Instant Client Package - JDBC Supplement | Additional support for XA, Internationalization, and RowSet operations under JDBC (1,490,104 bytes) | |
Instant Client Package - SQL*Plus | Additional libraries and executable for running SQL*Plus with Instant Client (711,801 bytes) | |
Instant Client Package - SDK | Additional header files and an example makefile for developing Oracle applications with Instant Client (603,526 bytes) |