Skip to Main Content

Programming Languages & Frameworks

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem connecting remote database from Linux C application

Stefano MoraOct 25 2023 — edited Oct 25 2023

Hi all,

I'm writing a C application on embedded Linux board.

I downloaded the sdk + basiclite 19_19 packages for linux arm64 architecture.

The program is compilable and runnable but when I try to connect by OCIServerAttach() or OCILogon2() calls, after a while (cause the server is not reachable) both crash with:

./run.sh: line 1: 16210 Illegal instruction sudo LD_LIBRARY_PATH=/opt/oracle/instantclient_19_19/ LANG=it ./mytest

I'm wondering why I cannot handle this case.

Are the arm64 libraries compatible with aarch64 architecture??

Thanks!


Added

I had a try with sqlplus tool and again, after a timeout, it crashes with ‘Illegal instruction’ msg.

I had a try with same C code but on other Linux box with 21_12 and x64 libraries: after some time the ServerAttach() returns -1 (as expected..)

Comments

Add EVENT_10842=15

You can also set this as an environment variable with the same name & value.

Sheeraz Majeed May 10 2024 — edited on May 10 2024

Hi, Thanks for reply.

But still no trace or log files to check used oci functions

Works for me.

cjones@cjones-mac:~$ rm -rf $HOME/instantclient/log/diag/clients && mkdir -p $HOME/instantclient/log/diag/clients
cjones@cjones-mac:~$ export EVENT_10842=15
cjones@cjones-mac:~$ sqlplus cj/cj@localhost/orclpdb1

...

SQL> select * from dual;

D
-
X

SQL> exit

And then a file like /Users/cjones/instantclient/log/diag/clients/user_cjones/host_nnnnnn_nn/trace/ora_nnn_nnnnn.trc will contain lines like:

# 2024-06-06 07:26:54.520 # Thread ID 8547126272 # Entry - OCIServerAttach(srvhp = 0x128030068, errhp = 0x13580a410, dblink_hash = H:0x9bf0f8e9ee161fdf, mode = OCI_DEFAULT(000000000), dblink = localhost/orclpdb1, dblink_len = 18 );
1 - 3

Post Details

Added on Oct 25 2023
3 comments
197 views