X

Author Profile

Christopher Jones
Senior Principal Product Manager

Christopher is a Senior Principal Product Manager working with the Oracle Database Data Access team primarily on APIs for scripting languages including Node.js, Python, PHP and the newly launched ODPI-C library for Oracle Database driver writers.  He has responsibilities for Oracle Call Interface (OCI) and related Oracle Database APIs; for Oracle Database clients such as Oracle Instant Client; and for general database adoption by developers, including championing Oracle Database XE.  He remains a lead maintainer of PHP's OCI8 extension for Oracle Database.  He co-released the popular book "The Underground PHP and Oracle Manual" and is the author of a number of technical articles.  Christopher has presented at big and small conferences around the world including the O'Reilly Open Source Convention and Oracle OpenWorld.  

Twitter: @ghrd

Email: christopher.jones@oracle.com

Blog: http://blogs.oracle.com/opal/

Recent Posts by Christopher Jones

Installing node-oracledb on OS X with Oracle Instant Client 11.2.0.4

----> This note and script is obsolete. The current node-oracledb OS X install instructions contain nicer solutions <----- . I've been hacking an Apple OS X shell script to install node-oracledb. You tell it where your Instant Client libraries and headers ZIP packages are. It then installs node-oracledb, resulting in an instantclient directory and a node_modules directory. This automates the instructions Node-oracledb Installation on OS X with Instant Client. My osxinstall.sh script can be seen here. [Now removed] I was investigating how to avoid needing to set DYLD_LIBRARY_PATH. I wanted to find how to replicate the use of rpath, which is available for node-oracledb on Linux. A standard install on OS X needs DYLD_LIBRARY_PATH set, otherwise Node.js will fail with the error: cjones@cjones-mac:~/n$ node select1.js /Users/cjones/n/node_modules/oracledb/lib/oracledb.js:28 throw err; ^ Error: dlopen(/Users/cjones/n/node_modules/oracledb/build/Release/oracledb.node, 1): Library not loaded: /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1 Referenced from: /Users/cjones/n/node_modules/oracledb/build/Release/oracledb.node Reason: image not found at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.<anonymous> (/Users/cjones/n/node_modules/oracledb/lib/oracledb.js:23:15) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) So, I was playing with osxinstall.sh to see how to circumvent this. Before running osxinstall.sh, edit it and set the paths to where the Instant Client 11.2.0.4 'basic' and 'sdk' ZIP files are located on your filesystem, see IC_BASIC_ZIP and IC_SDK_ZIP. (You can download Instant Client from OTN. Use the 64-bit packages). You also specify the target application directory you are using, see TARGET_DIR. This is where the components are installed into. Update https_proxy if you are behind a firewall, otherwise comment it out. If you have various node_modules directories around, then npm might end up installing oracledb in an unexpected place and the script will error. The key bit of osxinstall.sh that I was interested in is: # For Oracle Instant Client 11.2.0.4: these are the default paths we will change IC_DEF1=/ade/b/3071542110/oracle/rdbms/lib IC_DEF2=/ade/dosulliv_ldapmac/oracle/ldap/lib . . . # Warning: work in progress - may not be optimal chmod 755 $OCI_LIB_DIR/*dylib $OCI_LIB_DIR/*dylib.11.1 install_name_tool -id libclntsh.dylib.11.1 $OCI_LIB_DIR/libclntsh.dylib.11.1 install_name_tool -change $IC_DEF2/libnnz11.dylib $OCI_LIB_DIR/libnnz11.dylib \ $OCI_LIB_DIR/libclntsh.dylib.11.1 install_name_tool -id libnnz11.dylib $OCI_LIB_DIR/libnnz11.dylib install_name_tool -change $IC_DEF1/libclntsh.dylib.11.1 \ $OCI_LIB_DIR/libclntsh.dylib.11.1 $OCI_LIB_DIR/libociei.dylib install_name_tool -change $IC_DEF1/libclntsh.dylib.11.1 \ $OCI_LIB_DIR/libclntsh.dylib.11.1 $NODE_ORACLEDB_LIB chmod 555 $OCI_LIB_DIR/*dylib $OCI_LIB_DIR/*dylib.11.1 This changes the library install and identification names using install_name_tool. Note this tool cannot allocate more space for path names than currently exists. My code is a work in progress; I may work out a better way, perhaps using libtool. Comments & suggestions welcome. The script does more than most people probably need. In future even I might only run parts extracted from it. If you are new to node-oracledb, check out its install and API documentation on GitHub. You may also be interested in reading The Easiest Way to Install Oracle Database on Mac OS X.