ericmend / oracleClientCore-2.0

Unofficial Oracle Client for .Net Core
MIT License
31 stars 6 forks source link

The oracle instant client 12_2 or 12_1 doesn't work on Linux for 12c DB server #2

Open jaydeept opened 6 years ago

jaydeept commented 6 years ago

Hello, I am using this package for my project which is based on .Net Core 2. I have downloaded the Oracle Client of version 12_2 and found that my test cases are passing on Windows OS. But on Linux with same client I got the error: Error while trying to retrieve text for error ORA-01804. Then I tried with client 11_2 and found that it's working fine on Linux. Does it have anything to do with the package you are providing?

ericmend commented 6 years ago

Olá, boa noite jaydeept.

Os testes no qual realizei no Ubuntu 17.10, foi justamente com a versão do Client Oracle 12.2.0.1.0 http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

Instant Client Package - Basic: All files required to run OCI, OCCI, and JDBC-OCI applications Download instantclient-basic-linux.x64-12.2.0.1.0.zip (68,965,195 bytes) (cksum - 3923339140)

Em uma breve pesquisa sobre o erro, as causas mais comum para ocorrer esse problema são as váriveis de ambiente:

https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9531383800346685517

Common causes:

LD_LIBRARY_PATH is not correctly set. ORACLE_HOME is not correctly set. NLS_LANG is not correctly set.

Siga as instruções de instalações e valide se as variáveis estão corretamente de acordo com as instruções http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html#ic_x64_inst

Obrigado por contribuir para a comunidade ;-) *Desculpe pelo português. Mas o meu inglês é ainda pior :D

jaydeept commented 6 years ago

Hello @ericmend ,

I did set below variables following your example:

export LD_LIBRARY_PATH=/instantclient_11_2:$LD_LIBRARY_PATH export OCI_HOME=/instantclient_11_2 export OCI_LIB_DIR=/instantclient_11_2 export PATH=/instantclient_11_2:$PATH export NLS_LANG=SLOVAK_SLOVAKIA.UTF8

These variables are for 11_2 but I did set for 12_2 and 12_1 as well.

ericmend commented 6 years ago

Olá @jaydeept

Tente os passos: (Ubuntu) apt-get update && apt-get install -y libaio1 libaio-dev

Descompacte o pacote no diretório /opt/oracle/instantclient

ln -s /opt/oracle/instantclient/libclntsh.so.12.1 /opt/oracle/instantclient/libclntsh.so \
&& ln -s /opt/oracle/instantclient/libocci.so.12.1 /opt/oracle/instantclient/libocci.so

Adicione as variáveis de ambiente:

export LD_LIBRARY_PATH=/instantclient_11_2:$LD_LIBRARY_PATH
export OCI_HOME=/instantclient_11_2
export OCI_LIB_DIR=/instantclient_11_2
export PATH=/instantclient_11_2:$PATH
export NLS_LANG=SLOVAK_SLOVAKIA.UTF8

Valide se as váriveis foram adicionadas com sucesso:

echo $LD_LIBRARY_PATH
echo $OCI_HOME
echo $OCI_LIB_DIR
echo $PATH
echo $NLS_LANG

Se funcionar, vou atualizar o readme