laurenz / oracle_fdw

PostgreSQL Foreign Data Wrapper for Oracle
http://laurenz.github.io/oracle_fdw/
Other
493 stars 157 forks source link

Installation Bug #708

Open leopoldev404 opened 3 days ago

leopoldev404 commented 3 days ago

image

When trying to run the make script I get the error shown in the image

leopoldev404 commented 3 days ago

Also using pgxn client ends up in the same error

laurenz commented 3 days ago

This has been reported before, see #286, #403, #405 or #447 (among others).

You need to install the Oracle SDK as documented.

leopoldev404 commented 3 days ago

Thanks for replying s quickly! I did not see anything about oracle sdk in the documentation, are there any useful link to the oracle sdk installation on linux?

laurenz commented 3 days ago

It's right there in the documentation:

You need to install Oracle's C header files as well (SDK package for Instant Client). If you use the Instant Client ZIP files provided by Oracle, you may have to create a symbolic link from libclntsh.so to the actual shared library file yourself (normally, the SDK package does that).

How exactly you have to install it depends a lot on what Oracle client you installed and how. Just do the same moves for the SDK.

leopoldev404 commented 2 days ago

Oh, I see, thank you so much!

so I followed the recommended approach for oracle sdk installation, but seems it's not working, I always have the same error.

OS: linux ubuntu 22.04 (on a docker container) Postgres 9.6 downloaded oracle sdk instaclient: https://download.oracle.com/otn_software/linux/instantclient/2350000/instantclient-basic-linux.x64-23.5.0.24.07.zip

any idea on which could be the cause? maybe a mismatch between postgres and oracle sdk version? which oracle sdk version should I use with postgres 9.6?

laurenz commented 2 days ago

Thanks for your cooperation.

Please tell me details:

leopoldev404 commented 2 days ago

I have followed this guide: https://docs.oracle.com/en/database/oracle/oracle-database/23/lacli/install-instant-client-using-zip.html#GUID-D3DCB4FB-D3CA-4C25-BE48-3A1FB5A22E84

Steps:

RUN apt-get update && apt-get install -y \ postgresql-9.6 \ postgresql-client-9.6 \ postgresql-server-dev-9.6

RUN mkdir -p /opt/oracle && cd /opt/oracle

RUN wget https://download.oracle.com/otn_software/linux/instantclient/1924000/instantclient-basic-linux.zseries64-19.24.0.0.0dbru.zip RUN unzip instantclient-basic-linux.zseries64-19.24.0.0.0dbru.zip -d sdk RUN rm instantclient-basic-linux.zseries64-19.24.0.0.0dbru.zip

RUN export LD_LIBRARY_PATH=/opt/oracle/sdk:$LD_LIBRARY_PATH RUN export PATH=/opt/oracle/sdk:$PATH RUN export ORACLE_HOME=/opt/oracle/sdk

RUN git clone https://github.com/laurenz/oracle_fdw.git && cd oracle_fdw && make && make install

leopoldev404 commented 2 days ago

could you provide the steps in order to install it correctly?

laurenz commented 2 days ago

That looks fine (except I don't see where you installed PostgreSQL). But the image you showed in the beginning shows that ORACLE_HOME was not set when you ran make. That's where you have to investigate.

leopoldev404 commented 2 days ago

I have updated it

leopoldev404 commented 2 days ago

do I need both oracle client and sdks?

leopoldev404 commented 2 days ago

am I missing something?

laurenz commented 2 days ago

9.6? Are you kidding?

Anyway, the image at the very beginning of this thread still proves that ORACLE_HOME was not set.

leopoldev404 commented 2 days ago

yeah, for business requirement I need to use 9.6, I need to replicate locally an old prod db. Anyway, I have updated the steps

laurenz commented 2 days ago

Yes, you forgot to read my last two comments. I'm not going to repeat it.

leopoldev404 commented 2 days ago

I got your point but I don't understand why it shouldn't be initialized. Should I use ENV instead of export? I am populating the ORACLE_HOME variable

laurenz commented 2 days ago

Well, the variable is not populated. I'm not dealing with Docker, so I cannot tell you where you made a mistake. But it is not a problem of oracle_fdw, it is a problem of your dockerfile.