Unable to connect oracle 19c thick mode using airflow

219 views Asked by At

I trying to connect oracle 19c using airflow thick mode.

1.I downlaoded the airflow docker-compose.yml from https://airflow.apache.org/docs/apache-airflow/2.7.2/docker-compose.yaml

2.I downloaded the oracle client docker file from https://github.com/oracle/docker-images/blob/main/OracleInstantClient/oraclelinux8/19/Dockerfile

3.I built custom dependenies with below comamnds in docker file

FROM apache/airflow:2.7.2 RUN pip install --no-cache-dir apache-airflow-providers-oracle===3.7.4 RUN pip install --no-cache-dir apache-airflow-providers-postgres===5.6.1

i built oracle client image using below command based on step 2 docker file docker build . --tag oracleclient19

i added the custom built dependencies with airflow 2.7.2 image in docker-compose.yaml as wells oracle client image.

run the airflow using below commands docker compose up airflow-init docker compose up

it is up and unable to connect db. i am getting below error (DPI-1047: Cannot locate a 64-bit Oracle Client library: "/usr/lib/oracle/19.20/client64/libclntsh.so cannot open shared object file: No such file or directory"

i should be able to connect db to extract data

my custom oracle client docker container not running enter image description here

i tried using astro as well.unable to start Unable to connect oracle 19c using thick mode in airflow using astro

1

There are 1 answers

0
MikeKulls On

I think you need to download the Oracle instantclient, unzip it and put it in your container with a basic COPY command. The environment variable then tells it where to find the files. Or you could copy the files to the directory oracle was expecting.

COPY instantclient_21_13 /instantclient_21_13
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/instantclient_21_13"