@@ -130,12 +130,6 @@ example:
130
130
export http_proxy=http://my-proxy.example.com:80/
131
131
```
132
132
133
- or, in ` csh ` :
134
-
135
- ```
136
- setenv http_proxy http://my-proxy.example.com:80/
137
- ```
138
-
139
133
Install node-oracledb from the
140
134
[ NPM registry] ( https://www.npmjs.com/package/oracledb ) :
141
135
@@ -256,12 +250,6 @@ example:
256
250
export http_proxy=http://my-proxy.example.com:80/
257
251
```
258
252
259
- or, in ` csh ` :
260
-
261
- ```
262
- setenv http_proxy http://my-proxy.example.com:80/
263
- ```
264
-
265
253
Install node-oracledb from the
266
254
[ NPM registry] ( https://www.npmjs.com/package/oracledb ) :
267
255
@@ -301,7 +289,8 @@ node select1.js
301
289
302
290
## <a name =" instoh " ></a > 4. Node-oracledb installation on Linux with a Local Database
303
291
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 ` .
305
294
306
295
For easy development, the free
307
296
[ 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
328
317
329
318
### 4.2 Install the add-on
330
319
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
333
335
[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:
336
338
337
339
```
338
340
export OCI_LIB_DIR=$ORACLE_HOME/lib
@@ -348,12 +350,6 @@ example:
348
350
export http_proxy=http://my-proxy.example.com:80/
349
351
```
350
352
351
- or, in ` csh ` :
352
-
353
- ```
354
- setenv http_proxy http://my-proxy.example.com:80/
355
- ```
356
-
357
353
Install node-oracledb from the
358
354
[NPM registry](https://www.npmjs.com/package/oracledb):
359
355
@@ -364,15 +360,20 @@ npm install oracledb
364
360
If you are installing with `sudo`, you may need to use `sudo -E` to
365
361
preserve the environment variable values.
366
362
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
+
367
366
### 4.3 Run an example program
368
367
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.
376
377
377
378
Download the
378
379
[example programs](https://github.com/oracle/node-oracledb/tree/master/examples) from GitHub.
@@ -423,6 +424,19 @@ npm install oracledb
423
424
node example.js
424
425
```
425
426
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
+
426
440
### Using Instant Client RPMs without RPATH
427
441
428
442
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
441
455
to a new major or minor version (for example from 11.2 to 12.1)
442
456
without re-installing node-oracledb.
443
457
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
-
461
458
## <a name="instosx"></a> 6. Node-oracledb Installation on OS X with Instant Client
462
459
463
460
### 6.1 Install Xcode
@@ -540,12 +537,6 @@ example:
540
537
export http_proxy=http://my-proxy.example.com:80/
541
538
```
542
539
543
- or, in ` csh ` :
544
-
545
- ```
546
- setenv http_proxy http://my-proxy.example.com:80/
547
- ```
548
-
549
540
As a normal user, install node-oracledb from the
550
541
[NPM registry](https://www.npmjs.com/package/oracledb):
551
542
0 commit comments