@@ -320,7 +320,7 @@ rm -i *jdbc* *occi* *mysql* *mql1* *ipc1* *jar uidrvci genezi adrci
320320
321321Refer 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
325325If 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:
574574export 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
579579If 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
669669The 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
676673There is no native Oracle Database for macOS but one can easily be run in a
677674Linux 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
701698be built from source code, see [ Node-oracledb Installation from
702699Source 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+
714739There are several alternative ways to tell node-oracledb where your Oracle
715740Client 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/ i nstantclient_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 / i nstantclient_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 / i nstantclient_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 / i nstantclient_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
767796If 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
779808Another alternative is to put the files in the ` network/admin` subdirectory of
780809Instant 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
782811Oracle 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+
799831Run 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
917949depend on the Instant Client version. Refer to the Instant Client
918950documentation.
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
922954If 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+
9751010Run 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:
11411176export 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
11461181If 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:
12651300export 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
12701305If 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-
19321965Issues and questions about node-oracledb can be posted on [ GitHub] [ 10 ] or
19331966[ Slack] [ 48 ] ([ link to join Slack] [ 49 ] ).
19341967
0 commit comments