Page 1 of 1

Can't connect to ORA 10G XE from linux, Check library compatibility

Posted: 16.01.2022, 13:11
by xutanou
Good morning everybody, I have been working with zeos and lazarus under windows 10/64 with connections to ora 10g xe, firebird 2.5 and postgresql (actually 14) with not isues.
Now I'm porting my aplications to linux with no isues in firebird and postgresql, but I'm not able to get connection to oracle...

My system is Fedora35 xfce (64bits) with lazarus 2.2.0 and zeos 7.2.14
I have installed both 32 and 64 bits oracle instant client 10.2.05 rpms (the one I use in windows is also 10.2.05)

TZconnection settings are as follows:

AutoCommit: True
AutoEncodeStrings: True
catalog: Mycatalog
ClientCodepage: WE8MSWIN1252
Connected: ----
ControlsCodePage: cCP_UTF8
Database: xxx.xx.xxx.xxx:1521/XE
DesignConnection: False
HostName: EMPTY
LibraryLocation: Tried different options here where de library is, to avoid problems I left: /home/my_name/my_project/ where the libraries are located

in this point I have to mention that I have tried all library names (both 32 & 64 bits) putting them on that path wityhout success.

The libraries I tried are (32 bit): libclntsh.so , libocci.so , libociei.so , libsqora.so with message: Client-Library /home/My_name/My_project/libclntsh.so found but could not be loaded. Check compile-target and library compatibility!

The libraries I tried are (64 bit): libclntsh.so , libociei.so , libsqora.so with message: Client-Library /home/My_name/My_project/libclntsh.so found but could not be loaded. Check compile-target and library compatibility!

libocci.so with message: Access Violation


LoginPrompt: False
Name: Oracle
Password: My_password
Port: 1521
Properties:
AutoEncodeStrings=ON
codepage=WE8MSWIN1252
controls_cp=CP_UTF8
Protocol: oracle
ReadOnly: False
SQLHourGlass: False
Tag: 0
TransactIsolationLevel: tiNone
UseMetadata: True
User: My_username
Version: 7.2.14-release

So, this is my problem, I can't get de component to connect to Oracle, any help would be apreciated in order to get the rest of my aplications ported to linux...

Thanks in advance

Re: Can't connect to ORA 10G XE from linux, Check library compatibility

Posted: 22.01.2022, 10:57
by marsupilami
Hello xutanou,

I am not an expert but maybe this helps. I had to do the following to at least get to an exception message that showed me the library works. But honestrly I think that the oracle server is not even running on my system.

Prerequesites: This happens on Centos 7 using Oracle 18c XE. ORACLE_HOME seems to be /opt/oracle/product/18c/dbhomeXE.

The first thing is about being able to load the library. Oracle doesn't add its library path to the system by default (it seems). I had to add the Oracle library path to the ld configuration. To do this I created the file "oracle18xe.conf" in "/etc/ld.so.conf.d" and added a line pointing to <ORACLE_HOME>/lib. In my case that was "/opt/oracle/product/18c/dbhomeXE". Afterwards I had to run ldconfig.

The second thing that seems to be necessary is to add ORACLE_HOME to the environment. In my case I executed:
export ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE
You will have to somehow add ORACLE_HOME to your environment permanently. Note: This command only adds ORACLE_HOME to the current shell and its child processes. So to get it in Lazarus you will have to run startlazarus from that shell to get it working.

Best regards,

Jan