-1

I am working on a project where I want my Node.js based backend to communicate with Oracle DB, Locally while development on windows system it wasn't difficult to install the pre requisite for node-oracledb module as mentioned here https://community.oracle.com/docs/DOC-931127 but now when I want to install the same pre requisite for centos6, I am facing issues.

List of pre requisite,

  1. C Compiler with support for C++ 11.
  2. Python.
  3. Oracle Instant Client "basic" and "SDK" packages.

installing first two wasn't a challenge but finding rpm package for 3 is a tuff task.

Note: Everything has to be done using the Command line.

MT0
  • 143,790
  • 11
  • 59
  • 117
jigar gala
  • 1,600
  • 12
  • 20

3 Answers3

1

The Oracle Instant Client libraries are currently not available via RPM. As a workaround, many folks download the libraries the normal way and then put them somewhere they can access them over the network. Then they use a command line tool like curl to pull them in when needed.

Dan McGhan
  • 4,479
  • 1
  • 11
  • 15
  • I think you meant NPM not RPM? – Christopher Jones Jul 19 '17 at 01:46
  • I meant RPM, as in the command line tool, not the file format. Same goes for Yum and NPM! :) – Dan McGhan Jul 21 '17 at 16:00
  • Instant Client RPMs have to be installed with either the rpm or yum command line tools. (What am I missing in the general problem to be solved?) Also the Instant Client RPM packages are on ULN for users with Oracle Linux support, so those users don't even need to downloaded them separately. – Christopher Jones Jul 28 '17 at 02:59
  • I think the issue is that he can't get the RPMs through the command line. I'm suggesting he get them once and put them somewhere he can get them via the command line. – Dan McGhan Jul 28 '17 at 23:56
  • Thanks, your comments helped me out. – jigar gala Aug 08 '17 at 13:25
0

Instant Client RPMs are available for 32-bit and 64-bit Linux. (The Instant Client home page is here.) Since Centos isn't an officially supported Linux, YMMV with the RPMs.

If the RPMs aren't usable for whatever reason, then download the Instant Client ZIP files, unzip them, and create the symbolic link ln -s libclntsh.so.12.1 libclntsh.so.

The Instant Client libraries will need to be in LD_LIBRARY_PATH, or you can use ldconfig similar to:

sudo sh -c "echo /opt/oracle/instantclient_12_2 > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig

You will also need the OS libaio package installed. Using yum on the RPMs will pull this dependency in automatically, or you can install it separately.

Christopher Jones
  • 9,449
  • 3
  • 24
  • 48
0

After all the search and effort I am finally able to install oracledb on my Centos system through the command line.

Please follow below steps on Command line as root user (Assuming Python is already installed):

1) Download required rpm Oracle instant client packages.

wget ftp://ftp.icm.edu.pl/vol/rzm6/linux-slc/centos/7.1.1503/cernonly/x86_64/Packages/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm

wget ftp://ftp.icm.edu.pl/vol/rzm6/linux-slc/centos/7.0.1406/cernonly/x86_64/Packages/oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm

wget ftp://ftp.icm.edu.pl/vol/rzm6/linux-slc/centos/7.0.1406/cernonly/x86_64/Packages/oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm

Above commands will download rpm packages for oracle instant client.

2) Install Downloaded rpm packages.

[~]: sudo rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracle-instantclient12.########################################### [100%]
[~]: sudo rpm -ivh oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracle-instantclient12.########################################### [100%]
[~]: sudo rpm -ivh oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:oracle-instantclient12.########################################### [100%]

3) Download the repo files for DevTools2, a Red Hat package that contains a supported C++11 compiler.

wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo

4) Install the compiler and support tools.

yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++

Above step will download Oracle instant client, C++ compiler and DevTools2 compiler. Now it's time to install oracledb.

Before you can compile C++11 code with the DevTools2 compiler, you need to enable it in a new shell:

scl enable devtoolset-2 bash

Now, install oracledb

npm install oracledb

This will install oracledb.

jigar gala
  • 1,600
  • 12
  • 20