Skip to content

Commit ad50a1b

Browse files
committed
Update macOS install instructions for new DMGs
1 parent 5ee8a83 commit ad50a1b

File tree

3 files changed

+73
-34
lines changed

3 files changed

+73
-34
lines changed

INSTALL.md

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ rm -i *jdbc* *occi* *mysql* *mql1* *ipc1* *jar uidrvci genezi adrci
320320

321321
Refer to the Oracle Instant Client documentation for details.
322322

323-
##### 3.2.1.5 Optionally create the Oracle Client configuration directory
323+
##### 3.2.1.5 Optionally create the Oracle Client configuration file directory
324324

325325
If you use optional Oracle configuration files such as `tnsnames.ora`,
326326
`sqlnet.ora` or `oraaccess.xml` with Instant Client, then put the files in an
@@ -574,7 +574,7 @@ will need to have the link path set:
574574
export LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib
575575
```
576576

577-
##### 3.2.3.5 Optionally create the Oracle Client configuration directory
577+
##### 3.2.3.5 Optionally create the Oracle Client configuration file directory
578578

579579
If you use optional Oracle configuration files such as `tnsnames.ora`,
580580
`sqlnet.ora` or `oraaccess.xml` with Instant Client, then put the files in an
@@ -668,10 +668,7 @@ Review the generic [prerequisites](#prerequisites).
668668

669669
The pre-built binaries were built on macOS Mojave 10.14.6.
670670

671-
Oracle Instant Client libraries are required on macOS. Note that Oracle Instant
672-
Client 19c and earlier are not supported on macOS Catalina 10.15: you will need
673-
to allow access to several Instant Client libraries from the Security & Privacy
674-
preference pane.
671+
Oracle Instant Client libraries are required on macOS.
675672

676673
There is no native Oracle Database for macOS but one can easily be run in a
677674
Linux virtual machine, see [The Easiest Way to Install Oracle Database on Apple
@@ -701,25 +698,53 @@ If a pre-built node-oracledb binary is not installable, the binary can
701698
be built from source code, see [Node-oracledb Installation from
702699
Source Code](#github).
703700

704-
#### 3.3.4 Install the free Oracle Instant Client 'Basic' ZIP file
701+
#### 3.3.4 Install the free Oracle Instant Client 'Basic' package
705702

706-
Download the free **Basic** 64-bit ZIP from [Oracle Technology Network][22] and
707-
unzip it. For example in Terminal you could unzip in your home directory:
703+
Download the **Basic** 64-bit DMG from [Oracle Technology Network][22].
704+
705+
##### Manual Installation
706+
707+
In Finder, double click on the DMG to mount it.
708+
709+
Open a terminal window and run the install script in the mounted package, for example:
710+
711+
```
712+
$ /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh
713+
```
714+
715+
This copies the contents to `$HOME/Downloads/instantclient_19_8`.
716+
717+
In Finder, eject the mounted Instant Client package.
718+
719+
If you have multiple Instant Client DMG packages mounted, you only need to run
720+
`install_ic.sh` once. It will copy all mounted Instant Client DMG packages at
721+
the same time.
722+
723+
##### Scripted Installation
724+
725+
Instant Client installation can alternatively be scripted, for example:
708726

709727
```
710-
cd ~
711-
unzip instantclient-basic-macos.x64-19.3.0.0.0dbru.zip
728+
cd $HOME/Downloads
729+
curl -O https://download.oracle.com/otn_software/mac/instantclient/198000/instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
730+
hdiutil mount instantclient-basic-macos.x64-19.8.0.0.0dbru.dmg
731+
/Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru/install_ic.sh
732+
hdiutil unmount /Volumes/instantclient-basic-macos.x64-19.8.0.0.0dbru
712733
```
713734

735+
The Instant Client directory will be `$HOME/Downloads/instantclient_19_8`.
736+
737+
##### Configure Instant Client
738+
714739
There are several alternative ways to tell node-oracledb where your Oracle
715740
Client libraries are, see [Initializing Node-oracledb][17]:
716741

717-
- Use [`oracledb.initOracleClient()`][64] in your application:
742+
- Use [`oracledb.initOracleClient()`][64] in your application code:
718743

719744
```javascript
720745
const oracledb = require('oracledb');
721746
try {
722-
oracledb.initOracleClient({libDir: '/Users/your_username/instantclient_19_3'});
747+
oracledb.initOracleClient({libDir: '/Users/your_username/Downloads/instantclient_19_8'});
723748
} catch (err) {
724749
console.error('Whoops!');
725750
console.error(err);
@@ -732,37 +757,41 @@ Client libraries are, see [Initializing Node-oracledb][17]:
732757
binary is. For example:
733758

734759
```
735-
ln -s ~/instantclient_19_3/libclntsh.dylib node_modules/oracledb/build/Release
760+
ln -s ~/Downloads/instantclient_19_8/libclntsh.dylib node_modules/oracledb/build/Release
761+
```
762+
763+
This can be added to your `package.json` files:
764+
765+
```
766+
"scripts": {
767+
"postinstall": "ln -s $HOME/Downloads/instantclient_19_8/libclntsh.dylib $(npm root)/oracledb/build/Release"
768+
},
736769
```
737770

738771
Instead of linking, you can also copy all the required OCI libraries, for example:
739772

740773
```
741-
cp ~/instantclient_19_3/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libnnz19.dylib,libociei.dylib} node_modules/oracledb/build/Release
774+
cp ~/Downloads/instantclient_19_8/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libnnz19.dylib,libociei.dylib} node_modules/oracledb/build/Release
742775
cd node_modules/oracledb/build/Release/ && ln -s libclntsh.dylib.19.1 libclntsh.dylib
743776
```
744777

745-
- Alternatively, set `DYLD_LIBRARY_PATH` to include the Oracle Instant Client
746-
directory. Note this variable must be set in the terminal or shell that
747-
directly invokes Node.js. The variable will not propagate to sub-shells.
748-
749778
- Alternatively, create a symbolic link for the 'client shared library' in
750-
`/usr/local/lib`. If the `lib` sub-directory does not exist, you can create
751-
it. For example:
779+
`/usr/local/lib`. Note this may not work on all versions of macOS.
780+
If the `lib` sub-directory does not exist, you can create it. For example:
752781

753782
```
754783
mkdir /usr/local/lib
755-
ln -s ~/instantclient_19_3/libclntsh.dylib /usr/local/lib
784+
ln -s ~/Downloads/instantclient_19_8/libclntsh.dylib /usr/local/lib
756785
```
757786

758787
Instead of linking, you can also copy all the required OCI libraries, for example:
759788

760789
```
761790
mkdir /usr/local/lib
762-
cp ~/instantclient_19_3/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libnnz19.dylib,libociei.dylib} /usr/local/lib/
791+
cp ~/Downloads/instantclient_19_8/{libclntsh.dylib.19.1,libclntshcore.dylib.19.1,libnnz19.dylib,libociei.dylib} /usr/local/lib/
763792
```
764793

765-
#### 3.3.5 Optionally create the Oracle Client configuration directory
794+
#### 3.3.5 Optionally create the Oracle Client configuration file directory
766795

767796
If you use optional Oracle configuration files such as `tnsnames.ora`,
768797
`sqlnet.ora` or `oraaccess.xml` with Instant Client, then put the files in an
@@ -778,7 +807,7 @@ Or you can set the environment variable `TNS_ADMIN` to that directory name.
778807

779808
Another alternative is to put the files in the `network/admin` subdirectory of
780809
Instant Client, for example in
781-
`/Users/your_username/instantclient_19_3/network/admin`. This is the default
810+
`/Users/your_username/Downloads/instantclient_19_8/network/admin`. This is the default
782811
Oracle configuration directory for executables linked with this Instant Client.
783812

784813
#### 3.3.6 Run an example program
@@ -796,6 +825,9 @@ module.exports = {
796825
};
797826
```
798827
828+
Make sure Instant Client is configured as shown above. For example you may want
829+
to add calls to `oracledb.initOracleClient()` to the scripts.
830+
799831
Run one of the examples, such as [`example.js`][63]:
800832
801833
```
@@ -917,7 +949,7 @@ and files from either the Basic or Basic Light packages. The exact libraries
917949
depend on the Instant Client version. Refer to the Instant Client
918950
documentation.
919951
920-
##### 3.4.1.5 Optionally create the Oracle Client configuration directory
952+
##### 3.4.1.5 Optionally create the Oracle Client configuration file directory
921953
922954
If you use optional Oracle configuration files such as `tnsnames.ora`,
923955
`sqlnet.ora` or `oraaccess.xml` with Instant Client, then put the files in an
@@ -972,6 +1004,9 @@ module.exports = {
9721004
};
9731005
```
9741006

1007+
Make sure Instant Client is configured as shown above. For example you may want
1008+
to add calls to `oracledb.initOracleClient()` to the scripts.
1009+
9751010
Run one of the examples, such as [`example.js`][63]:
9761011

9771012
```
@@ -1141,7 +1176,7 @@ To run applications, you will need to set the link path:
11411176
export LIBPATH=/opt/oracle/instantclient_19_6:$LIBPATH
11421177
```
11431178

1144-
#### 3.5.5 Optionally create the Oracle Client configuration directory
1179+
#### 3.5.5 Optionally create the Oracle Client configuration file directory
11451180

11461181
If you use optional Oracle configuration files such as `tnsnames.ora`,
11471182
`sqlnet.ora` or `oraaccess.xml` with Instant Client, then put the files in an
@@ -1265,7 +1300,7 @@ To run applications, you will need to set the link path:
12651300
export LD_LIBRARY_PATH_64=/opt/oracle/instantclient_19_6:$LD_LIBRARY_PATH_64
12661301
```
12671302

1268-
#### 3.6.5 Optionally create the Oracle Client configuration directory
1303+
#### 3.6.5 Optionally create the Oracle Client configuration file directory
12691304

12701305
If you use optional Oracle configuration files such as `tnsnames.ora`,
12711306
`sqlnet.ora` or `oraaccess.xml` with Instant Client, then put the files in an
@@ -1927,8 +1962,6 @@ If creating a connection fails:
19271962
expected version first in `PATH` (on Windows) or `LD_LIBRARY_PATH`
19281963
(on Linux)?
19291964

1930-
- On macOS, did you install Oracle Instant Client libraries in `/usr/local/lib`?
1931-
19321965
Issues and questions about node-oracledb can be posted on [GitHub][10] or
19331966
[Slack][48] ([link to join Slack][49]).
19341967

doc/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7682,7 +7682,7 @@ Node-oracledb looks for the Oracle Client libraries as follows:
76827682
in the directory where the `oracledb*.node` binary is. For example in
76837683
`node_modules/oracledb/build/Release`. This directory should contain the
76847684
libraries from an unzipped Instant Client 'Basic' or 'Basic Light'
7685-
package. For example, use `ln -s ~/instantclient_19_3/libclntsh.dylib
7685+
package. For example, use `ln -s ~/Downloads/instantclient_19_8/libclntsh.dylib
76867686
node_modules/oracledb/build/Release/`. If the libraries are not found, no
76877687
error is thrown and the search continues, see next bullet point.
76887688

test/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Test node-oracledb
22

3-
*Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.*
3+
*Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.*
44

55
You may not use the identified files except in compliance with the Apache
66
License, Version 2.0 (the "License.")
@@ -45,9 +45,15 @@ for relevant licenses.
4545
See [INSTALL](https://oracle.github.io/node-oracledb/INSTALL.html)
4646
for installation details.
4747

48+
On macOS, run a command like:
49+
50+
```
51+
ln -s $HOME/Downloads/instantclient_19_8/libclntsh.dylib $(npm root)/oracledb/build/Release
52+
```
53+
4854
Note: the
4955
[test suite](https://github.com/oracle/node-oracledb/tree/master/test)
50-
is on GitHub. NPM module had not contained the tests since node-oracledb 1.9.1.
56+
is on GitHub.
5157

5258
### <a name="workdir"></a> 1.1 Create a working directory
5359

@@ -226,4 +232,4 @@ dbaccess = (description=(RETRY_COUNT=20)(RETRY_DELAY=3)
226232

227233
We firstly encoutered this error with `test/callTimeout.js`. It uses some hard-coded variables as assertion condition, which may lead to assertion fail in slow network situation.
228234

229-
The solution is commenting out this line `sqlnet.recv_timeout=<minutes>` from `sqlnet.ora` file.
235+
The solution is commenting out this line `sqlnet.recv_timeout=<minutes>` from `sqlnet.ora` file.

0 commit comments

Comments
 (0)