Add oracle as data souce to redash

Issue Summary

Morning together

I tried the cloud hosted redash version which worked great and had every feature we need
in our company. So I started to set up the open source version of redash.

I was able to get it running on Debian 10 (Buster) and was able to login. As I tried to connect our oracle Database, I saw there is no oracle data source available. After some research I found out, that this isn’t included out of the box in the self hosted version and needs to be added manually.

Sadly I didn’t find any documentation, which were describing the installation step by step. There was always something missing. I used the following tutorial: https://gist.github.com/linhmtran168/ec0757a487a83a1fc5c5d3188af81874

The steps I did:

  • I downloaded the newest version of redash and extracted zip to /opt/redash
  • I unzipped everything in the same folder
  • I made the new folder oracle/ and downloaded the newest Version of the oracle instant clienz zips to this folder (version 19.3.0.0.0, basic, sdk, sqlplus)
  • I started the setup script, without the setup_compose() function (we use a proxy so I had to make some changes but it worked.
  • next steps were the same as in the tutorial because the docker-compose.yml was not working, I used the official one from the redash github repo.

Sadly there are a lot of errors while installing the docker build but I can’t understand what to to in the next
place.

Can someone tell my, what steps to do, that I’m able to use the oracle data source on Debian 10?
I’m absolutely stuck but we would love to use redash in our company.

Thanks a lot.

Technical details:

  • Redash Version: 7.0.0
  • Browser/OS: Debian 10
  • How did you install Redash: Downloaded zip and started setup.sh

Welcome to the forum! Those are good instructions you linked. And it sounds like you almost have it. You just need to pip install cx_oracle.

Hello. Thanks for your quick respond.

Yeah that’s a good point, but I am not able to run this command, because the command docker build -t custom/redash . fails.

The problem occures at the execution of RUN npm run build.
There is a long list off WARNING’s and ERROR’s
Error 1


Error 2

Error 3

Do you know what I can try to solve this? Do I even need to install npm in Docker if its already installed on the host system?

You don’t need to install npm if you use our docker images :slight_smile: Part of the problem in your screenshots is that your version of NodeJS is quite old. Try Node v10 or newer.

I wouldn’t expect problems, though, because you said earlier you installed Redash and could log in. What are you trying to achieve with that docker build command?

Thanks again for your quick answer :slight_smile:

I got it working once but then I tried to install the oracle data source and my Redash wasn’t working anymore. So I followed the tutorial and reinstalled redash with the docker build command as described in the github tutorial I linked above.

As I never used Docker before and I’m not that familiar with it.
So in this case, I can import the oracle data source without a rebuild of the container?

How exactly can I execute the pip install cx_oracle command when I’m not running it inside the Dockerfile while building it the first time?

Thanks a lot.

Yiipieee I finally got it working :slight_smile: .

I tried everything to get it working but the mistake I did was that I forgot to use my custom built container in the docker-compose.yml. So everytime I started docker-compose run --rm server create_db and then docker-compose up -d I used the official redash/redash container and not my custom built.

Because of that my custom Dockerfile did nothing and the official one was used. :man_facepalming:

For everyone else who struggles with the oracle installation here a quick summary of the steps I did to get it working.

  1. I downloaded the latest zip file from the redash GitHub repository.
  2. Unzipped it to /opt/redash/
  3. Also I created a new Dockerfile in an other directory for example /opt/redash_oracle/ and copied the following content of the Dockerfile from the Dockerhub oracle https://hub.docker.com/r/joaoleite/redash_oracle/dockerfile
  4. downloaded the version 11.2.0.4.0 from the oracle instantclient (sdk, sqlplus, basic) into the folder I just created /opt/redash_oracle/oracle/ and left the three files as zip there.
  5. Now we to build our image. Run docker build -t redash/oracle (you can give this image the name you want). Also make sure that you are in the same directory that we created before: /opt/redash_oracle/
    5.1 With the command docker images -a your should now see the new image with our custom name.
  6. We can now go back to the directory we unzipped the redash files /opt/redash/. There we have to change the docker-compose.yml file to use our OWN image: redash/oracle and not the official one from redash, otherwise you will have the same issue I had and are not able to get the oracle data source.
    grafik
  7. We now should be able to start the database docker-compose run --rm server create_db and run docker-comose to start our container docker-compose up -d

Now the new data source is visible in the admin site
grafik

Remarks:

  • As I understand you should also be able to use the Docker image joaoleite/redash_oracle from the official Docker Hub in the docker-compose.yml. Because I had to add our Proxy, I built my own container as mentioned in the steps above.
  • Maybe it’s possible to use the newer instantclient from oracle but I didn’t want to mess arround with that.

Hope I could help somebody out there when trying to add the oracle data source :slight_smile:

1 Like