Skip to content

Commit 7c61c7d

Browse files
committed
INSTALL clarifications for ORACLE_HOME and rpath sections
1 parent 703bd65 commit 7c61c7d

File tree

1 file changed

+44
-53
lines changed

1 file changed

+44
-53
lines changed

INSTALL.md

Lines changed: 44 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ example:
130130
export http_proxy=http://my-proxy.example.com:80/
131131
```
132132

133-
or, in `csh`:
134-
135-
```
136-
setenv http_proxy http://my-proxy.example.com:80/
137-
```
138-
139133
Install node-oracledb from the
140134
[NPM registry](https://www.npmjs.com/package/oracledb):
141135

@@ -256,12 +250,6 @@ example:
256250
export http_proxy=http://my-proxy.example.com:80/
257251
```
258252

259-
or, in `csh`:
260-
261-
```
262-
setenv http_proxy http://my-proxy.example.com:80/
263-
```
264-
265253
Install node-oracledb from the
266254
[NPM registry](https://www.npmjs.com/package/oracledb):
267255

@@ -301,7 +289,8 @@ node select1.js
301289

302290
## <a name="instoh"></a> 4. Node-oracledb installation on Linux with a Local Database
303291

304-
The ORACLE_HOME can be either a database home or a full Oracle client installation installed with Oracle's `runInstaller`.
292+
The `ORACLE_HOME` can be either a database home or a full Oracle
293+
client installation installed with Oracle's `runInstaller`.
305294

306295
For easy development, the free
307296
[Oracle XE](http://www.oracle.com/technetwork/database/database-technologies/express-edition/overview/index.html)
@@ -328,11 +317,24 @@ export PATH=/opt/node-v4.2.3-linux-x64/bin:$PATH
328317

329318
### 4.2 Install the add-on
330319

331-
The installer will automatically look for Oracle libraries and headers under
332-
`$ORACLE_HOME`, see
320+
Set required Oracle environment variables, such as `ORACLE_HOME` by
321+
executing:
322+
323+
```
324+
source /usr/local/bin/oraenv
325+
```
326+
327+
Or, if you are using Oracle XE, by executing:
328+
329+
````
330+
source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh
331+
```
332+
333+
The node-oracledb installer will automatically look for Oracle
334+
libraries and headers under `$ORACLE_HOME`, see
333335
[Oracle Client Location Heuristic on Linux](#linuxinstsearchpath).
334-
However, if you have Instant Client RPMs installed and don't wish the RPMs
335-
to be used, you must explicitly set two environment variables:
336+
However, if you also have Instant Client RPMs installed and don't wish the
337+
RPMs to be used, you must explicitly set two environment variables:
336338
337339
```
338340
export OCI_LIB_DIR=$ORACLE_HOME/lib
@@ -348,12 +350,6 @@ example:
348350
export http_proxy=http://my-proxy.example.com:80/
349351
```
350352
351-
or, in `csh`:
352-
353-
```
354-
setenv http_proxy http://my-proxy.example.com:80/
355-
```
356-
357353
Install node-oracledb from the
358354
[NPM registry](https://www.npmjs.com/package/oracledb):
359355
@@ -364,15 +360,20 @@ npm install oracledb
364360
If you are installing with `sudo`, you may need to use `sudo -E` to
365361
preserve the environment variable values.
366362
363+
Note: A compiler supporting C++11 is required when building with
364+
Node.js 4 or later, otherwise the NAN component will fail to build.
365+
367366
### 4.3 Run an example program
368367
369-
Set `LD_LIBRARY_PATH` to the Oracle library directory. This variable,
370-
and other variables used by Oracle clients, are typically set in a
371-
shell by executing `source /usr/local/bin/oraenv`. Or, if you are
372-
using Oracle XE, execute `source
373-
/u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh`. The Node.js
374-
process will need access permissions for the Oracle libraries and
375-
other files.
368+
Set `LD_LIBRARY_PATH` to the Oracle library directory, if it was not
369+
set by `oraenv` or `oracle_env.sh`:
370+
371+
```
372+
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
373+
```
374+
375+
Make sure the Node.js process has directory and file access
376+
permissions for the Oracle libraries and other files.
376377
377378
Download the
378379
[example programs](https://github.com/oracle/node-oracledb/tree/master/examples) from GitHub.
@@ -423,6 +424,19 @@ npm install oracledb
423424
node example.js
424425
```
425426
427+
### <a name="forcerpath"></a> Forcing RPATH
428+
429+
If rpath is not automatically enabled when installing node-oracledb on
430+
Linux, you can force it to be used. Do this by setting the
431+
node-oracledb installation variable `FORCE_RPATH` to any value. For
432+
example when installing with a local database:
433+
434+
```
435+
source /usr/local/bin/oraenv # this sets ORACLE_HOME and LD_LIBRARY_PATH
436+
FORCE_RPATH=1 npm install oracledb
437+
node example.js
438+
```
439+
426440
### Using Instant Client RPMs without RPATH
427441
428442
If you want to use Instant Client RPMs without using rpath, then set
@@ -441,23 +455,6 @@ This is useful if you will need to upgrade Oracle Instant Client RPMs
441455
to a new major or minor version (for example from 11.2 to 12.1)
442456
without re-installing node-oracledb.
443457
444-
If you are installing with `sudo`, you may need to use `sudo -E` to
445-
preserve the environment variable values.
446-
447-
### Forcing RPATH
448-
449-
If you want to force using rpath when installing node-oracledb on
450-
Linux, then set the node-oracledb installation variable `FORCE_RPATH`
451-
to any value. For example:
452-
453-
```
454-
export OCI_LIB_DIR=/opt/oracle/instantclient
455-
export OCI_INC_DIR=/opt/oracle/instantclient/sdk/include
456-
FORCE_RPATH=1 npm install oracledb
457-
unset OCI_LIB_DIR OCI_INC_DIR
458-
node example.js
459-
```
460-
461458
## <a name="instosx"></a> 6. Node-oracledb Installation on OS X with Instant Client
462459
463460
### 6.1 Install Xcode
@@ -540,12 +537,6 @@ example:
540537
export http_proxy=http://my-proxy.example.com:80/
541538
```
542539
543-
or, in `csh`:
544-
545-
```
546-
setenv http_proxy http://my-proxy.example.com:80/
547-
```
548-
549540
As a normal user, install node-oracledb from the
550541
[NPM registry](https://www.npmjs.com/package/oracledb):
551542

0 commit comments

Comments
 (0)