dbTalk Databases Forums  

Fun with unixODBC on Fedora

comp.databases.oracle.server comp.databases.oracle.server


Discuss Fun with unixODBC on Fedora in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mladen Gogala
 
Posts: n/a

Default Fun with unixODBC on Fedora - 01-16-2012 , 03:12 PM






I wanted to test LibreOffice report wizard on Oracle and I chose ODBC to
connect to Oracle. I have done so many times, I installed configuration
files and it doesn't work. Fedora is a Linux distro appropriately
starting with the letter "F", so I knew what to expect, things didn't
work. The first step is to set up trace in the /etc/odbcinst.ini like
this:

[ODBC]
TraceFile = /tmp/sql.log
Trace = Yes
ForceTrace = Yes
Pooling = No

The trace file produced the following:
[ODBC][4912][1326747189.405674][SQLAllocHandle.c][482]
Exit:[SQL_SUCCESS]
Output Handle = 0x990e698
[ODBC][4912][1326747189.405743][SQLConnect.c][3614]
Entry:
Connection = 0x990e698
Server Name = [local][length = 5
(SQL_NTS)]
User Name = [scott][length = 5
(SQL_NTS)]
Authentication = [*****][length = 5 (SQL_NTS)]
UNICODE Using encoding ASCII 'ISO8859-1' and UNICODE
'UCS-2LE'

[ODBC][4912][1326747189.410219][SQLConnect.c][1063]Can't open lib '/usr/
lib/oracle/11.2/client/lib/libsqora.so.11.1' : file not found

Instant client was installed, I checked and re-checked. The file
mentioned was there:

[mgogala@medo ~]$ ls -l /usr/lib/oracle/11.2/client/lib/libsqora.so.11.1
-rwxr-xr-x 1 root root 781565 Sep 18 19:12 /usr/lib/oracle/11.2/client/
lib/libsqora.so.11.1


So, what the heck is the problem? I went one step further and performed
the following command:

strace -e trace=file isql local scott tiger

It turns out that ODBC was complaining about the libodbcinst.so.1 library:

stat64("/usr/lib/tls/sse2", 0xbf980a3c) = -1 ENOENT (No such file or
directory)
open("/usr/lib/tls/libodbcinst.so.1", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/usr/lib/tls", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/usr/lib/i686/sse2/libodbcinst.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/usr/lib/i686/sse2", 0xbf980a3c) = -1 ENOENT (No such file or
directory)
open("/usr/lib/i686/libodbcinst.so.1", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/usr/lib/i686", 0xbf980a3c) = -1 ENOENT (No such file or
directory)
open("/usr/lib/sse2/libodbcinst.so.1", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/usr/lib/sse2", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
open("/usr/lib/libodbcinst.so.1", O_RDONLY) = -1 ENOENT (No such file or
directory)

There wasn't one on the system, so I thought I might have missed
something during the installation. I searched the software repositories,
using the following command:

yum search /usr/lib/libodbcinst.so.1
Loaded plugins: fastestmirror, langpacks, presto, priorities, protectbase,
: refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirror.symnds.com
* rpmfusion-free: mirror.us.leaseweb.net
* rpmfusion-free-updates: mirror.us.leaseweb.net
* rpmfusion-nonfree: mirror.us.leaseweb.net
* rpmfusion-nonfree-updates: mirror.us.leaseweb.net
* updates: mirror.symnds.com
0 packages excluded due to repository protections
Warning: No matches found for: /usr/lib/libodbcinst.so.1


Nothing was found. Hmmmm, that's strange. Let's see what do we have on
the system:

[root@medo lib]# ls /usr/lib/libodbcinst.so*
/usr/lib/libodbcinst.so /usr/lib/libodbcinst.so.2.0.0
/usr/lib/libodbcinst.so.2


Eventually, the oldest trick in the book made things right:
ln -s /usr/lib/libodbcinst.so.2.0.0 /usr/lib/libodbcinst.so.1

[mgogala@medo ~]$ isql local scott tiger
+---------------------------------------+
Quote:
Connected! |
|
sql-statement |
help [tablename] |
quit |
|
+---------------------------------------+
SQL> select * from emp;
+-------+-----------+----------+-------+--------------------+----------
+----------+-------+
Quote:
EMPNO | ENAME | JOB | MGR | HIREDATE | SAL |
COMM | DEPTNO|
+-------+-----------+----------+-------+--------------------+----------
+----------+-------+
Quote:
7369 | SMITH | CLERK | 7902 | 1980-12-17 00:00:00| 800
| 20 |
7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 00:00:00| 1600 |
300 | 30 |
7521 | WARD | SALESMAN | 7698 | 1981-02-22 00:00:00| 1250 |
500 | 30 |
7566 | JONES | MANAGER | 7839 | 1981-04-02 00:00:00| 2975
| 20 |
7654 | MARTIN | SALESMAN | 7698 | 1981-09-28 00:00:00| 1250 |
1400 | 30 |
7698 | BLAKE | MANAGER | 7839 | 1981-05-01 00:00:00| 2850
| 30 |
7782 | CLARK | MANAGER | 7839 | 1981-06-09 00:00:00| 2450
| 10 |
7788 | SCOTT | ANALYST | 7566 | 1987-04-19 00:00:00| 3000
| 20 |
7839 | KING | PRESIDENT| | 1981-11-17 00:00:00| 5000
| 10 |
7844 | TURNER | SALESMAN | 7698 | 1981-09-08 00:00:00| 1500 |
0 | 30 |
7876 | ADAMS | CLERK | 7788 | 1987-05-23 00:00:00| 1100
| 20 |
7900 | JAMES | CLERK | 7698 | 1981-12-03 00:00:00| 950
| 30 |
7902 | FORD | ANALYST | 7566 | 1981-12-03 00:00:00| 3000
| 20 |
7934 | MILLER | CLERK | 7782 | 1982-01-23 00:00:00| 1300
| 10 |
+-------+-----------+----------+-------+--------------------+----------
+----------+-------+
SQLRowCount returns -1
14 rows fetched
SQL>

Now I know why the name of this particular Linux distro starts with the
letter "F". If anyone wants to play with ODBC, you should add symlink as
above. I hope that I have saved a few minutes to someone. I love well
tested software which starts flawlessly from scratch, but it's Linux what
keeps me on my toes and keeps me sharp and vigilant. I hope that UnixODBC
developers will not come up with an idea for a new and improved library,
incompatible with the original anytime soon.



--
http://mgogala.byethost5.com

Reply With Quote
  #2  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Fun with unixODBC on Fedora - 01-16-2012 , 03:38 PM






On Mon, 16 Jan 2012 21:12:45 +0000, Mladen Gogala wrote:

Quote:
I wanted to test LibreOffice report wizard on Oracle and I chose ODBC to
connect to Oracle
BTW, the report wizard works, sort of. It produces nice reports, with a
nice GUI but it's buggy as hell. If you don't follow exact sequence in
the wizard, it will simply hang without any further explanation. It also
suffers from the common ailment of many other ODBC tools: it brings out
every table in the database, which can be quite a lot. This can be used
by the DBA to produce 1-off reports, but is far from suitable to be given
to the end lusers, to produce their own reports.



--
http://mgogala.byethost5.com

Reply With Quote
  #3  
Old   
Gerard H. Pille
 
Posts: n/a

Default Re: Fun with unixODBC on Fedora - 01-17-2012 , 12:33 PM



Mladen Gogala wrote:
Quote:
strace -e trace=file isql local scott tiger

It turns out that ODBC was complaining about the libodbcinst.so.1 library:

$ ls -l $(locate libodbcinst)
-rwxr-xr-x 1 oracle dba 1724441 Sep 17 08:28
/home/oracle/product/11.2.0/tg_1/dg4msql/driver/lib/libodbcinst.so
-rw-r--r-- 1 root root 182856 Apr 4 2010 /usr/lib32/libodbcinst.a
-rw-r--r-- 1 root root 968 Oct 1 16:41 /usr/lib32/libodbcinst.la
lrwxrwxrwx 1 root root 20 Oct 1 16:41 /usr/lib32/libodbcinst.so -> libodbcinst.so.1.0.0
lrwxrwxrwx 1 root root 20 Oct 1 16:41 /usr/lib32/libodbcinst.so.1 -> libodbcinst.so.1.0.0
-rw-r--r-- 1 root root 56424 Apr 4 2010 /usr/lib32/libodbcinst.so.1.0.0
-rw-r--r-- 1 root root 844110 Apr 4 2010 /usr/lib32/libodbcinstQ.a
-rw-r--r-- 1 root root 976 Oct 1 16:41 /usr/lib32/libodbcinstQ.la
lrwxrwxrwx 1 root root 21 Oct 1 16:41 /usr/lib32/libodbcinstQ.so -> libodbcinstQ.so.1.0.0

$ dpkg -S /usr/lib32/libodbcinst.so.1.0.0
ia32-libs: /usr/lib32/libodbcinst.so.1.0.0


Can you find a ia32-libs for your F-distribution?

Reply With Quote
  #4  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: Fun with unixODBC on Fedora - 01-17-2012 , 07:54 PM



On Tue, 17 Jan 2012 19:33:36 +0100, Gerard H. Pille wrote:

Quote:
Mladen Gogala wrote:
strace -e trace=file isql local scott tiger

It turns out that ODBC was complaining about the libodbcinst.so.1
library:


$ ls -l $(locate libodbcinst)
-rwxr-xr-x 1 oracle dba 1724441 Sep 17 08:28
/home/oracle/product/11.2.0/tg_1/dg4msql/driver/lib/libodbcinst.so
-rw-r--r-- 1 root root 182856 Apr 4 2010 /usr/lib32/libodbcinst.a
-rw-r--r-- 1 root root 968 Oct 1 16:41 /usr/lib32/libodbcinst.la
lrwxrwxrwx 1 root root 20 Oct 1 16:41 /usr/lib32/libodbcinst.so
-> libodbcinst.so.1.0.0 lrwxrwxrwx 1 root root 20 Oct 1 16:41
/usr/lib32/libodbcinst.so.1 -> libodbcinst.so.1.0.0 -rw-r--r-- 1 root
root 56424 Apr 4 2010 /usr/lib32/libodbcinst.so.1.0.0 -rw-r--r-- 1
root root 844110 Apr 4 2010 /usr/lib32/libodbcinstQ.a -rw-r--r-- 1
root root 976 Oct 1 16:41 /usr/lib32/libodbcinstQ.la lrwxrwxrwx 1
root root 21 Oct 1 16:41 /usr/lib32/libodbcinstQ.so -
libodbcinstQ.so.1.0.0

$ dpkg -S /usr/lib32/libodbcinst.so.1.0.0 ia32-libs:
/usr/lib32/libodbcinst.so.1.0.0


Can you find a ia32-libs for your F-distribution?
Yes, not a problem:


[root@medo tmp]# rpm -ql unixODBC
/etc/odbc.ini
/etc/odbcinst.ini
/usr/bin/dltest
/usr/bin/isql
/usr/bin/iusql
/usr/bin/odbc_config
/usr/bin/odbcinst
/usr/lib/libboundparam.so.2
/usr/lib/libboundparam.so.2.0.0
/usr/lib/libesoobS.so.2
/usr/lib/libesoobS.so.2.0.0
/usr/lib/libgtrtst.so.2
/usr/lib/libgtrtst.so.2.0.0
/usr/lib/libmimerS.so.2
/usr/lib/libmimerS.so.2.0.0
/usr/lib/libnn.so.2
/usr/lib/libnn.so.2.0.0
/usr/lib/libodbc.so
/usr/lib/libodbc.so.2
/usr/lib/libodbc.so.2.0.0
/usr/lib/libodbccr.so.2
/usr/lib/libodbccr.so.2.0.0
/usr/lib/libodbcdrvcfg1S.so.2
/usr/lib/libodbcdrvcfg1S.so.2.0.0
/usr/lib/libodbcdrvcfg2S.so.2
/usr/lib/libodbcdrvcfg2S.so.2.0.0
/usr/lib/libodbcinst.so
/usr/lib/libodbcinst.so.2
/usr/lib/libodbcinst.so.2.0.0
/usr/lib/libodbcminiS.so.2
/usr/lib/libodbcminiS.so.2.0.0
/usr/lib/libodbcmyS.so
/usr/lib/libodbcmyS.so.2
/usr/lib/libodbcmyS.so.2.0.0
/usr/lib/libodbcnnS.so.2
/usr/lib/libodbcnnS.so.2.0.0
/usr/lib/libodbcpsqlS.so
/usr/lib/libodbcpsqlS.so.2
/usr/lib/libodbcpsqlS.so.2.0.0
/usr/lib/libodbctxtS.so.2
/usr/lib/libodbctxtS.so.2.0.0
/usr/lib/liboplodbcS.so.2
/usr/lib/liboplodbcS.so.2.0.0
/usr/lib/liboraodbcS.so.2
/usr/lib/liboraodbcS.so.2.0.0
/usr/lib/libsapdbS.so.2
/usr/lib/libsapdbS.so.2.0.0
/usr/lib/libtdsS.so.2
/usr/lib/libtdsS.so.2.0.0
/usr/lib/libtemplate.so.2
/usr/lib/libtemplate.so.2.0.0
/usr/share/doc/unixODBC-2.2.14
/usr/share/doc/unixODBC-2.2.14/AUTHORS
/usr/share/doc/unixODBC-2.2.14/COPYING
/usr/share/doc/unixODBC-2.2.14/ChangeLog
/usr/share/doc/unixODBC-2.2.14/NEWS
/usr/share/doc/unixODBC-2.2.14/README
/usr/share/doc/unixODBC-2.2.14/doc
/usr/share/doc/unixODBC-2.2.14/doc/AdministratorManual
/usr/share/doc/unixODBC-2.2.14/doc/AdministratorManual/index.html
/usr/share/doc/unixODBC-2.2.14/doc/AdministratorManual/odbcinst.html
/usr/share/doc/unixODBC-2.2.14/doc/AdministratorManual/php3.html
/usr/share/doc/unixODBC-2.2.14/doc/AdministratorManual/unixODBC.gif
/usr/share/doc/unixODBC-2.2.14/doc/AdministratorManual/unixODBCsetup.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/close.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/conne.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/dsn.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/gloss.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/index.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/intro.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/navi.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/odbc.css
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/query.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/Tutorial/resul.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/index.html
/usr/share/doc/unixODBC-2.2.14/doc/ProgrammerManual/unixODBC.gif
/usr/share/doc/unixODBC-2.2.14/doc/UserManual
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/Figure1.gif
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/Figure2.gif
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/Figure3.gif
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/Figure4.gif
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/Figure6.gif
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/My.sql
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/StarOfficeDataGrid.gif
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/index.html
/usr/share/doc/unixODBC-2.2.14/doc/UserManual/unixODBC.gif
/usr/share/doc/unixODBC-2.2.14/doc/index.html
/usr/share/doc/unixODBC-2.2.14/doc/lst
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure.vsd
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure2.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure2.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure3.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure3.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure4.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure4.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure5.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure5.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure6.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure6.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure7.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure7.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure8.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure8.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure9.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/InternalStructure9.html
/usr/share/doc/unixODBC-2.2.14/doc/lst/back.gif
/usr/share/doc/unixODBC-2.2.14/doc/lst/next.gif
/usr/share/doc/unixODBC-2.2.14/doc/smallbook.gif
/usr/share/doc/unixODBC-2.2.14/doc/unixODBC.gif
[root@medo tmp]#


I am using 32 bit architecture because I have only 4G RAM and I don't
want to waste it needlessly. Libraries are there, only the versions are
incorrect. It's nothing that a symbolic link cannot fix. On MS-Windows,
ODBC drivers work out of the box. Linux keeps my knowledge of methodology
and debugging tools current, which is a good thing.


--
http://mgogala.byethost5.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.