Closed leopoldev404 closed 2 weeks ago
Also using pgxn client ends up in the same error
This has been reported before, see #286, #403, #405 or #447 (among others).
You need to install the Oracle SDK as documented.
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?
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.
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?
Thanks for your cooperation.
Please tell me details:
make
? Did you follow the documentation:
Set the environment variable ORACLE_HOME to the location of the Oracle installation.
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
could you provide the steps in order to install it correctly?
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.
I have updated it
do I need both oracle client and sdks?
am I missing something?
9.6? Are you kidding?
Anyway, the image at the very beginning of this thread still proves that ORACLE_HOME
was not set.
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
Yes, you forgot to read my last two comments. I'm not going to repeat it.
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
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.
Just in case:
RUN export ...
appears to be wrong; there is documentation that says each RUN
starts a new shell. A variable set this way in one line would not exist anymore in the next. ENV
seems to be the correct way to add environment variables for subsequent commands.@chrullrich Thanks for the help.
Is this case resolved, can I close the issue?
When trying to run the make script I get the error shown in the image