laurenz / oracle_fdw

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

Installation Bug #708

Closed leopoldev404 closed 2 weeks ago

leopoldev404 commented 1 month ago

image

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

leopoldev404 commented 1 month ago

Also using pgxn client ends up in the same error

laurenz commented 1 month 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 1 month 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 1 month 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 1 month 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 1 month ago

Thanks for your cooperation.

Please tell me details:

leopoldev404 commented 1 month 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 1 month ago

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

laurenz commented 1 month 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 1 month ago

I have updated it

leopoldev404 commented 1 month ago

do I need both oracle client and sdks?

leopoldev404 commented 1 month ago

am I missing something?

laurenz commented 1 month 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 1 month 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 1 month ago

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

leopoldev404 commented 1 month 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 1 month 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.

chrullrich commented 1 month ago

Just in case:

laurenz commented 1 month ago

@chrullrich Thanks for the help.

laurenz commented 2 weeks ago

Is this case resolved, can I close the issue?