Skip to content

Commit 754423b

Browse files
committed
Add an install guide section about OS X
1 parent 167e708 commit 754423b

File tree

1 file changed

+101
-3
lines changed

1 file changed

+101
-3
lines changed

INSTALL.md

Lines changed: 101 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ limitations under the License.
2121
2. [Node-oracledb Installation on Linux with Instant Client RPMs](#instrpm)
2222
3. [Node-oracledb Installation on Linux with Instant Client ZIP files](#instzip)
2323
4. [Node-oracledb Installation on Linux with a Local Database](#instoh)
24-
5. [Advanced installation on Linux](#linuxadv)
24+
5. [Node-oracledb Installation on OS X with Instant Client ZIP files](#instosx)
25+
6. [Advanced installation on Linux](#linuxadv)
2526

2627
## <a name="overview"></a> 1. Overview
2728

@@ -58,7 +59,7 @@ Linux. My database is on another machine. | [Node-oracledb Installation on Lin
5859
Solaris. My database is on another machine. | [Node-oracledb Installation on Linux with Instant Client ZIP files](#instzip)
5960
Linux or Solaris, with a database on the same machine. | [Node-oracledb Installation on Linux with a Local Database](#instoh)
6061
Linux or Solaris, with the full Oracle client (installed via runInstaller) on the same machine. | [Node-oracledb Installation on Linux with a Local Database](#instoh)
61-
Mac OS X. | [Node-oracledb Installation on Linux with Instant Client ZIP files](#instzip)
62+
Mac OS X. | [Node-oracledb Installation on OS X with Instant Client ZIP files](#instosx)
6263
Another OS with Oracle 11.2 or 12.1 libraries available | Update binding.gyp and make any code changes required, sign the [OCA](https://www.oracle.com/technetwork/community/oca-486395.html), and submit a pull request with your patch (Windows support is already being worked on).
6364

6465
### Other Resources Useful for node-oracledb
@@ -351,8 +352,105 @@ Run one of the examples:
351352
```
352353
node examples/select1.js
353354
```
355+
356+
## <a name="instosx"></a> 5. Node-oracledb Installation on OS X with Instant Client ZIP files
354357

355-
## <a name="linuxadv"></a> 5. Advanced installation on Linux
358+
### 5.1 Install Xcode
359+
360+
Building node-oracledb requires Xcode from the Mac App store.
361+
362+
### 5.2 Clone [this repository](https://github.com/oracle/node-oracledb)
363+
364+
```
365+
git clone https://github.com/oracle/node-oracledb.git
366+
```
367+
368+
### 5.3 Install Node.js
369+
370+
Node can be installed from various sources, such as via *brew*.
371+
372+
```
373+
brew install node
374+
```
375+
376+
Set your PATH to include the *node* and *npm* binaries:
377+
378+
```
379+
export PATH=/usr/local/bin:$PATH
380+
```
381+
382+
### 5.4 Install the free Oracle Instant Client ZIPs
383+
384+
Download the free 'Basic' and 'SDK' ZIPs from
385+
[Oracle Technology Network](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html)
386+
and
387+
[install them](http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html#ic_osx_inst):
388+
389+
```
390+
cd /opt/oracle
391+
unzip instantclient-basic-macos.x64-11.2.0.4.0.zip
392+
unzip instantclient-sdk-macos.x64-11.2.0.4.0.zip
393+
mv instantclient_11_2 instantclient
394+
cd instantclient
395+
ln -s libclntsh.dylib.11.1 libclntsh.dylib
396+
```
397+
398+
To run applications, you will need to set the link path:
399+
400+
```
401+
export DYLD_LIBRARY_PATH=/opt/oracle/instantclient
402+
```
403+
404+
### 5.5 Install the driver
405+
406+
The installer will automatically locate Instant Client in
407+
`/opt/oracle/instantclient`. If it elsewhere, tell the installer
408+
where to find it:
409+
410+
```
411+
export OCI_LIB_DIR=/whereever/instantclient_11_2
412+
export OCI_INC_DIR=/whereever/instantclient_11_2/sdk/include
413+
```
414+
415+
Run the installer:
416+
417+
```
418+
cd node-oracledb
419+
npm install -g
420+
```
421+
422+
### 5.6 Run an example program
423+
424+
Set `NODE_PATH` to include the newly installed node-oracledb driver:
425+
426+
```
427+
export NODE_PATH=/usr/local/lib/node_modules
428+
```
429+
430+
Edit `dbconfig.js` in the `examples` directory and set the database
431+
credentials to your environment.
432+
433+
```
434+
module.exports = {
435+
user : "hr",
436+
password : "welcome",
437+
connectString : "localhost/XE"
438+
};
439+
```
440+
441+
Run one of the examples:
442+
443+
```
444+
node examples/select1.js
445+
```
446+
447+
*Note:* Remember to set `DYLD_LIBRARY_PATH` first.
448+
449+
To run a database on OS X, one option is to use VirtualBox,
450+
see
451+
[The Easiest Way to Enable Oracle Database Application Development on Mac OS X](https://blogs.oracle.com/opal/entry/the_easiest_way_to_enable).
452+
453+
## <a name="linuxadv"></a> 6. Advanced installation on Linux
356454

357455
### Instant Client RPMs and RPATH
358456

0 commit comments

Comments
 (0)