Skip to content

Commit dff0312

Browse files
committed
Review the init section
1 parent a65a649 commit dff0312

File tree

2 files changed

+48
-39
lines changed

2 files changed

+48
-39
lines changed

INSTALL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,10 +721,6 @@ Client libraries are, see [Initializing Node-oracledb][17]:
721721
}
722722
```
723723

724-
- Alternative, set `DYLD_LIBRARY_PATH` to include the Oracle Instant Client
725-
directory. Note this variable must be set in the terminal or shell that
726-
directly invokes Node.js. The variable will not propagate to sub-shells.
727-
728724
- Alternatively, create a symbolic link for the 'client shared library' in the
729725
`node_modules/oracledb/build/Release` directory where the `oracledb*.node`
730726
binary is. For example:
@@ -740,6 +736,10 @@ Client libraries are, see [Initializing Node-oracledb][17]:
740736
cd node_modules/oracledb/build/Release/ && ln -s libclntsh.dylib.19.1 libclntsh.dylib
741737
```
742738

739+
- Alternatively, set `DYLD_LIBRARY_PATH` to include the Oracle Instant Client
740+
directory. Note this variable must be set in the terminal or shell that
741+
directly invokes Node.js. The variable will not propagate to sub-shells.
742+
743743
- Alternatively, create a symbolic link for the 'client shared library' in
744744
`/usr/local/lib`. If the `lib` sub-directory does not exist, you can create
745745
it. For example:

doc/api.md

Lines changed: 44 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7616,11 +7616,11 @@ This method was added in node-oracledb 3.0.
76167616
## <a name="initnodeoracledb"></a> <a name="configureconnections"></a> 14. Initializing Node-oracledb
76177617

76187618
The node-oracledb add-on consists of JavaScript code that calls a binary module.
7619-
This binary loads Oracle Client libraries which communicate over Oracle Net
7620-
to an existing database. The Oracle Client libraries need to be installed
7621-
separately. See the [node-oracledb installation instructions][2]. Oracle Net
7622-
is not a separate product: it is how the Oracle Client and Oracle Database
7623-
communicate.
7619+
This binary loads Oracle Client libraries which communicate over Oracle Net to
7620+
an existing database. Node-oracledb can be installed with `npm` but the Oracle
7621+
Client libraries need to be installed separately. See the [node-oracledb
7622+
installation instructions][2]. Oracle Net is not a separate product: it is how
7623+
the Oracle Client and Oracle Database communicate.
76247624

76257625
![node-oracledb Architecture](./images/node-oracledb-architecture.png)
76267626

@@ -7632,7 +7632,8 @@ be in an installation of Oracle Instant Client, in a full Oracle Client
76327632
installation, or in an Oracle Database installation (if Node.js is running on
76337633
the same machine as the database). The versions of Oracle Client and Oracle
76347634
Database do not have to be the same. For certified configurations see Oracle
7635-
Support's [Doc ID 207303.1][187].
7635+
Support's [Doc ID 207303.1][187] and see the [node-installation
7636+
instructions][2].
76367637

76377638
Node-oracledb looks for the Oracle Client libraries as follows:
76387639

@@ -7644,7 +7645,7 @@ Node-oracledb looks for the Oracle Client libraries as follows:
76447645
'Basic' or 'Basic Light' package. If you pass the library directory from
76457646
a full client or database installation, such as Oracle Database "XE"
76467647
Express Edition, then you will need to have previously set your
7647-
environment to use that software installation, otherwise files such as
7648+
environment to use that software installation otherwise files such as
76487649
message files will not be located. If the Oracle Client libraries cannot
76497650
be loaded from `libDir`, then an error is thrown.
76507651

@@ -7675,21 +7676,23 @@ Node-oracledb looks for the Oracle Client libraries as follows:
76757676
node_modules/oracledb/build/Release/`. If the libraries are not found, no
76767677
error is thrown and the search continues, see next bullet point.
76777678

7678-
- In `/usr/local/lib`. If the Oracle Client libraries cannot be loaded, then
7679-
an error is thrown.
7679+
- In the library search path such as set in `DYLD_LIBRARY_PATH` (note this
7680+
variable does not propagate to sub-shells) or in `/usr/local/lib`. If the
7681+
Oracle Client libraries cannot be loaded, then an error is thrown.
76807682

76817683
- On Linux and related platforms:
76827684

76837685
- In the [`libDir`](#odbinitoracleclientattrsopts) directory specified in a
76847686
call to [`oracledb.initOracleClient()`](#odbinitoracleclient). Note on
76857687
Linux this is only useful to force immediate loading of the libraries
7686-
because the libraries must also be in the system library search path.
7687-
This directory should contain the libraries from an unzipped Instant
7688-
Client 'Basic' or 'Basic Light' package. If you pass the library
7689-
directory from a full client or database installation, such as Oracle
7690-
Database "XE" Express Edition then you will need to have previously set
7691-
the `ORACLE_HOME` environment variable. If the Oracle Client libraries
7692-
cannot be loaded from `libDir`, then an error is thrown.
7688+
because the libraries must also be in the system library search path,
7689+
i.e. configured with `ldconfig` or set in `LD_LIBRARY_PATH`. This
7690+
directory should contain the libraries from an unzipped Instant Client
7691+
'Basic' or 'Basic Light' package. If you pass the library directory from
7692+
a full client or database installation, such as Oracle Database "XE"
7693+
Express Edition then you will need to have previously set the
7694+
`ORACLE_HOME` environment variable. If the Oracle Client libraries cannot
7695+
be loaded from `libDir`, then an error is thrown.
76937696

76947697
- If `libDir` was not specified, then Oracle Client libraries are looked for
76957698
in the operating system library search path, such as configured with
@@ -7782,8 +7785,10 @@ Name | Description
77827785
The files should be in a directory accessible to Node.js, not on the
77837786
database server host.
77847787

7785-
For example, if the file `/etc/my-oracle-config/tnsnames.ora` should be used,
7786-
you can call [`oracledb.initOracleClient()`](#odbinitoracleclient):
7788+
To make node-oracledb use the files you can set
7789+
[`configDir`](#odbinitoracleclientattrsopts) in a call to
7790+
[`oracledb.initOracleClient()`](#odbinitoracleclient). For example, if the file
7791+
`/etc/my-oracle-config/tnsnames.ora` should be used, then your code could be:
77877792

77887793
```javascript
77897794
const oracledb = require('oracledb');
@@ -7865,14 +7870,23 @@ Name | Description
78657870
------|-------------
78667871
`LD_LIBRARY_PATH` | Used on Linux and some UNIX platforms. Set this to the directory containing the Oracle Client libraries, for example `/opt/oracle/instantclient_19_6` or `$ORACLE_HOME/lib`. The variable needs to be set in the environment before Node.js is invoked. The variable is not needed if the libraries are located by an alternative method, such as from running `ldconfig`. On some UNIX platforms an OS specific equivalent, such as `LIBPATH` or `SHLIB_PATH` is used instead of `LD_LIBRARY_PATH`.
78677872
`PATH` | The library search path for Windows should include the location where `OCI.DLL` is found. Not needed if you pass [`libDir`](#odbinitoracleclientattrsopts) when calling [`oracledb.initOracleClient()`](#odbinitoracleclient)
7868-
`TNS_ADMIN` | The location of the optional [Oracle Net configuration files](#tnsadmin) and [Oracle Client configuration files](#oraaccess), including `tnsnames.ora`, `sqlnet.ora`, and `oraaccess.xml`, if they are not in a default location, or if [`configDir`](#odbinitoracleclientattrsopts) was not used in a call to [`oracledb.initOracleClient()`](#odbinitoracleclient).
7873+
`TNS_ADMIN` | The location of the optional [Oracle Net configuration files](#tnsadmin) and [Oracle Client configuration files](#oraaccess), including `tnsnames.ora`, `sqlnet.ora`, and `oraaccess.xml`, if they are not in a default location. The [`configDir`](#odbinitoracleclientattrsopts) value in a call to [`oracledb.initOracleClient()`](#odbinitoracleclient) overrides `TNS_ADMIN`.
78697874
`ORA_SDTZ` | The default session time zone, see [Fetching Dates and Timestamps](#datehandling).
78707875
`ORA_TZFILE` | The name of the Oracle time zone file to use. See the notes below.
78717876
`ORACLE_HOME` | The directory containing the Oracle Database software. This directory must be accessible by the Node.js process. This variable should *not* be set if node-oracledb uses Oracle Instant Client.
78727877
`NLS_LANG` | Determines the 'national language support' globalization options for node-oracledb. If not set, a default value will be chosen by Oracle. Note that node-oracledb will always uses the AL32UTF8 character set. See [Globalization and National Language Support (NLS)](#nls).
78737878
`NLS_DATE_FORMAT`, `NLS_TIMESTAMP_FORMAT` | See [Fetching Numbers and Dates as String](#fetchasstringhandling). The variables are ignored if `NLS_LANG` is not set.
78747879
`NLS_NUMERIC_CHARACTERS` | See [Fetching Numbers and Dates as String](#fetchasstringhandling). The variable is ignored if `NLS_LANG` is not
78757880

7881+
##### Time Zone File
7882+
7883+
The name of the Oracle time zone file to use can be set in `ORA_TZFILE`.
7884+
7885+
If node-oracledb is using Oracle Client libraries from an Oracle Database or
7886+
full Oracle Client software installation, and you want to use a non-default time
7887+
zone file, then set `ORA_TZFILE` to the file name with a directory prefix, for
7888+
example: `export ORA_TZFILE=/opt/oracle/myconfig/timezone_31.dat`.
7889+
78767890
Oracle Instant Client includes a small and big time zone file, for example
78777891
`timezone_32.dat` and `timezlrg_32.dat`. The versions can be shown by running
78787892
the utility `genezi -v` located in the Instant Client directory. The small file
@@ -7886,11 +7900,6 @@ directory, and move the file into it. Then set `ORA_TZFILE` to the file name,
78867900
without any directory prefix. The `genezi -v` utility will show the time zone
78877901
file in use.
78887902

7889-
If node-oracledb is using Oracle Client libraries from an Oracle Database or
7890-
full Oracle Client software installation, and you want to use a non-default time
7891-
zone file, then set `ORA_TZFILE` to the file name with a directory prefix, for
7892-
example: `export ORA_TZFILE=/opt/oracle/myconfig/timezone_31.dat`.
7893-
78947903
The Oracle Database documentation contains more information about time zone
78957904
files, see [Choosing a Time Zone File][184].
78967905

@@ -7932,22 +7941,22 @@ oracledb.initOracleClient({
79327941
});
79337942
```
79347943

7935-
The convention for `driverName` is to separate the product name from the product
7936-
version by a colon and single space characters. The value will be shown in
7937-
Oracle Database views like `V$SESSION_CONNECT_INFO`. If this attribute is not
7938-
specified, then the value "node-oracledb : *version*" is used, see [Add-on
7939-
Name](#drivernameview).
7944+
The `driverName` value will be shown in Oracle Database views like
7945+
`V$SESSION_CONNECT_INFO`. The convention for `driverName` is to separate the
7946+
product name from the product version by a colon and single space characters.
7947+
If this attribute is not specified, then the value "node-oracledb : *version*"
7948+
is used, see [Add-on Name](#drivernameview).
79407949

7941-
The `errorUrl` string will be shown in the exception raised if
7942-
`initOracleClient()` cannot load the Oracle Client libraries. This allows
7943-
applications that use node-oracledb to refer users to application-specific
7944-
installation instructions. If this value is not specified, then the
7945-
[node-oracledb installation instructions][2] URL is used.
7950+
The `errorUrl` string will be shown in the exception raised if the Oracle Client
7951+
libraries cannot be loaded. This allows applications that use node-oracledb to
7952+
refer users to application-specific installation instructions. If this
7953+
attribute is not set, then the [node-oracledb installation instructions][2] URL
7954+
is used.
79467955

79477956
## <a name="connectionhandling"></a> 15. Connection Handling
79487957

79497958
Connections between node-oracledb and Oracle Database are used for executing
7950-
[SQL](#sqlexecution), [PL/SQL](#plsqlexecution), and [SODA](#sodaoverview).
7959+
[SQL](#sqlexecution), [PL/SQL](#plsqlexecution), and for [SODA](#sodaoverview).
79517960

79527961
There are two types of connection:
79537962

0 commit comments

Comments
 (0)