@@ -320,7 +320,7 @@ rm -i *jdbc* *occi* *mysql* *mql1* *ipc1* *jar uidrvci genezi adrci
320
320
321
321
Refer to the Oracle Instant Client documentation for details.
322
322
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
324
324
325
325
If you use optional Oracle configuration files such as ` tnsnames.ora ` ,
326
326
` 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:
574
574
export LD_LIBRARY_PATH=/usr/lib/oracle/18.3/client64/lib
575
575
```
576
576
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
578
578
579
579
If you use optional Oracle configuration files such as ` tnsnames.ora ` ,
580
580
` sqlnet.ora ` or ` oraaccess.xml ` with Instant Client, then put the files in an
@@ -668,10 +668,7 @@ Review the generic [prerequisites](#prerequisites).
668
668
669
669
The pre-built binaries were built on macOS Mojave 10.14.6.
670
670
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.
675
672
676
673
There is no native Oracle Database for macOS but one can easily be run in a
677
674
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
701
698
be built from source code, see [ Node-oracledb Installation from
702
699
Source Code] ( #github ) .
703
700
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
705
702
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:
708
726
709
727
```
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
712
733
```
713
734
735
+ The Instant Client directory will be ` $HOME/Downloads/instantclient_19_8 ` .
736
+
737
+ ##### Configure Instant Client
738
+
714
739
There are several alternative ways to tell node-oracledb where your Oracle
715
740
Client libraries are, see [ Initializing Node-oracledb] [ 17 ] :
716
741
717
- - Use [ ` oracledb.initOracleClient() ` ] [ 64 ] in your application:
742
+ - Use [ ` oracledb.initOracleClient() ` ] [ 64 ] in your application code :
718
743
719
744
``` javascript
720
745
const oracledb = require (' oracledb' );
721
746
try {
722
- oracledb .initOracleClient ({libDir: ' /Users/your_username/instantclient_19_3 ' });
747
+ oracledb .initOracleClient ({libDir: ' /Users/your_username/Downloads/instantclient_19_8 ' });
723
748
} catch (err) {
724
749
console .error (' Whoops!' );
725
750
console .error (err);
@@ -732,37 +757,41 @@ Client libraries are, see [Initializing Node-oracledb][17]:
732
757
binary is . For example:
733
758
734
759
```
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
+ },
736
769
```
737
770
738
771
Instead of linking, you can also copy all the required OCI libraries, for example:
739
772
740
773
```
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
742
775
cd node_modules/ oracledb/ build/ Release/ && ln - s libclntsh .dylib .19 .1 libclntsh .dylib
743
776
```
744
777
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
-
749
778
- 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:
752
781
753
782
```
754
783
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
756
785
```
757
786
758
787
Instead of linking, you can also copy all the required OCI libraries, for example:
759
788
760
789
```
761
790
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/
763
792
```
764
793
765
- #### 3.3 .5 Optionally create the Oracle Client configuration directory
794
+ #### 3.3 .5 Optionally create the Oracle Client configuration file directory
766
795
767
796
If you use optional Oracle configuration files such as ` tnsnames.ora` ,
768
797
` 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.
778
807
779
808
Another alternative is to put the files in the ` network/admin` subdirectory of
780
809
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
782
811
Oracle configuration directory for executables linked with this Instant Client.
783
812
784
813
#### 3.3 .6 Run an example program
@@ -796,6 +825,9 @@ module.exports = {
796
825
};
797
826
```
798
827
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
+
799
831
Run one of the examples, such as [`example.js`][63]:
800
832
801
833
```
@@ -917,7 +949,7 @@ and files from either the Basic or Basic Light packages. The exact libraries
917
949
depend on the Instant Client version. Refer to the Instant Client
918
950
documentation.
919
951
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
921
953
922
954
If you use optional Oracle configuration files such as `tnsnames.ora`,
923
955
`sqlnet.ora` or `oraaccess.xml` with Instant Client, then put the files in an
@@ -972,6 +1004,9 @@ module.exports = {
972
1004
};
973
1005
```
974
1006
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
+
975
1010
Run one of the examples, such as [ ` example.js ` ] [ 63 ] :
976
1011
977
1012
```
@@ -1141,7 +1176,7 @@ To run applications, you will need to set the link path:
1141
1176
export LIBPATH=/opt/oracle/instantclient_19_6:$LIBPATH
1142
1177
```
1143
1178
1144
- #### 3.5.5 Optionally create the Oracle Client configuration directory
1179
+ #### 3.5.5 Optionally create the Oracle Client configuration file directory
1145
1180
1146
1181
If you use optional Oracle configuration files such as ` tnsnames.ora ` ,
1147
1182
` 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:
1265
1300
export LD_LIBRARY_PATH_64=/opt/oracle/instantclient_19_6:$LD_LIBRARY_PATH_64
1266
1301
```
1267
1302
1268
- #### 3.6.5 Optionally create the Oracle Client configuration directory
1303
+ #### 3.6.5 Optionally create the Oracle Client configuration file directory
1269
1304
1270
1305
If you use optional Oracle configuration files such as ` tnsnames.ora ` ,
1271
1306
` sqlnet.ora ` or ` oraaccess.xml ` with Instant Client, then put the files in an
@@ -1927,8 +1962,6 @@ If creating a connection fails:
1927
1962
expected version first in ` PATH ` (on Windows) or ` LD_LIBRARY_PATH `
1928
1963
(on Linux)?
1929
1964
1930
- - On macOS, did you install Oracle Instant Client libraries in ` /usr/local/lib ` ?
1931
-
1932
1965
Issues and questions about node-oracledb can be posted on [ GitHub] [ 10 ] or
1933
1966
[ Slack] [ 48 ] ([ link to join Slack] [ 49 ] ).
1934
1967
0 commit comments