Home » Databases » Sybase » ASE » How to install Sybase’s ODBC driver on Ubuntu Linux for ASE/IQ/Replication Server/SQL Anywhere/etc

How to install Sybase’s ODBC driver on Ubuntu Linux for ASE/IQ/Replication Server/SQL Anywhere/etc

ASE 15.0.3 full install on Linux 32bit.
First we need to install unixODBC:

% sudo aptitude install unixodbc unixodbc-bin unixodbc-dev libstdc++5

Because of a bug within the Sybase ODBC install, we need to change /opt/sybase/DataAccess/ODBC/samples/drivertemplate.txt.

/opt/sybase/DataAccess/ODBC/samples/drivertemplate.txt:

[Adaptive Server Enterprise]
Description = Sybase ODBC Driver
Driver = /opt/sybase/ODBC-12_5/lib/libsybdrvodb.so
FileUsage = -1

Change to:

[Adaptive Server Enterprise]
Description = Sybase ODBC Driver
Driver = /opt/sybase/DataAccess/ODBC/lib/libsybdrvodb.so
FileUsage = -1

This template file is used to install the ODBC driver with unixODBC:

odbcinst -i -d -f /opt/sybase/DataAccess/ODBC/samples/drivertemplate.txt

Currently Sybase’s ODBC driver does not have a GUI component for unixODBC. I’m waiting on the bug #. Once I have it, I’ll update this post.

Now we are ready to define an ODBC dsn. We will need to create a template file to do so:

dbadev1.dsn

[dbadev1]
Description=Sybase ODBC Data Source
UserID=sa
Password=password
Driver=Adaptive Server Enterprise
Server=dba-dev1
Port=5000
Database=sybase_dba
UseCursor=1

To add it to unixODBC we need to run:

odbcinst -i -s -f dbadev1.dsn

If you wanted a system wide dsn:

sudo odbcinst -i -s -l -f dbadev1.dsn
Updated to include libstdc++5 for the newer releases of Ubuntu
Share Button

Comments

  1. To test the dsn, you can use unixODBC’s isql:

    % /usr/bin/isql dbadev1

  2. Wayne Allen ran into the same problem as I did with the Sybase ODBC drivers.

  3. When you run the Sybase setup (in GUI mode “setup” or console mode “setup -console”), you can choose where to install the Sybase software. In this case, I chose /opt/sybase.

  4. Nope, the ODBC drivers from Sybase are native Linux binaries.

  5. Well, there isn’t a direct link. You need to download the Software Development Kit.. which you can only get from Sybase http://www.sybase.com/linux

  6. David says:

    BTW I’m the one running PHP on Ubuntu, and it is working, along with Apache… Just need to be able to connect to the Sybase server 🙂

  7. good article,can’t hardly wait for more article.. thanks

  8. Danny says:

    I am trying to setup unixODBC and the Sybase ODBC drivers that ships with the Open Client 15.0 32-bit (RH) on a Ubuntu 10.4 installation.

    All works fine until the actual test:
    usr/bin/isql TEST sa **** -v
    [01000][unixODBC][Driver Manager]Can’t open lib ‘/opt/sybase/DataAccess/ODBC/lib/libsybdrvodb.so’ : file not found
    [ISQL]ERROR: Could not SQLConnect

    and I get this error. Of course the file exists, but;

    ldd /opt/sybase/DataAccess/ODBC/lib/libsybdrvodb.so
    linux-gate.so.1 => (0x003b6000)
    libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x001f5000)
    libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x009e2000)
    libstdc++-libc6.2-2.so.3 => not found
    libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x00edc000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x001f9000)
    /lib/ld-linux.so.2 (0x00e67000)

    so for some reason the libstdc++-lib6.2-2.so3 is not found.

    Have you had any luck installing the sybase ODBC drivers on Ubuntu 10.4? would you have any clues of what lib I need to update/install?

    1. Tony says:

      I am having a similatr issue on Red Hat 5.4
      [root@localhost samples]# isql Sybase -v
      [01000][unixODBC][Driver Manager]Can’t open lib ‘/opt/sybase/DataAccess64/ODBC/lib/libsybdrvodb.so’ : libsybcsi_core26.so: cannot open shared object file: No such file or directory
      [ISQL]ERROR: Could not SQLConnect

      Any help would be greatly appreciated.

      1. Tony says:

        … and the libs are there …

        [root@localhost samples]# find / -name libsybcsi_core26.so -print 2>/dev/null
        /opt/sybase/OCS-15_0/lib3p64/libsybcsi_core26.so
        /opt/sybase/OCS-15_0/lib3p/libsybcsi_core26.so
        /opt/sybase/DataAccess64/ODBC/lib/libsybcsi_core26.so

        could my Sybase environment variables not be set correctly?

        1. Tony says:

          it was indeed my ENV variables. But I still cannot connect and
          I do not get a SQL> prompt.

          Here is what I get:

          [root@localhost samples]# isql -v Sybase myuser mypasswd
          Sybase CTISQL Utility/15.7/P-EBF19587 ESD #1/DRV.15.7.0.1/Linux Intel/Linux 2.6. 18-128.el5 i686/BUILD1570-012/OPT/Wed Dec 7 18:46:25 2011

          Confidential property of Sybase, Inc.
          Copyright 1987, 2011
          Sybase, Inc. All rights reserved.
          Unpublished rights reserved under U.S. copyright laws.

          This software contains confidential and trade secret information of Sybase,
          Inc. Use, duplication or disclosure of the software and documentation by
          the U.S. Government is subject to restrictions set forth in a license
          agreement between the Government and Sybase, Inc. or other written
          agreement specifying the Government’s rights to use the software and any
          applicable FAR provisions, for example, FAR 52.227-19.
          Sybase, Inc. One Sybase Drive, Dublin, CA 94568, USA

          [root@localhost samples]#

          As you can see, no SQL> prompt and no connection message.

          1. Tony says:

            [root@localhost samples]# isql Sybase
            Password:
            CT-LIBRARY error:
            ct_connect(): directory service layer: internal directory control layer error: Requested server name not found.
            [root@localhost samples]#

            The -v option was just giving me the version of isql. When I try to
            connect, this is the ‘real’ error message. I don’t know of any trace
            facility to see what is going on.

            Any ideas? Sybase + Linux + ODBC = Frustrating …

  9. Hi Danny,

    With Ubuntu after 8.10, you will need to install libstdc++5 as Sybase’s ODBC driver is built with the older library.

    sudo aptitude install libstdc++5

    let me know if it helps

    Jason

    1. Danny says:

      Hello Jason,

      Thank you!

      I found the missing lib in the package: libstdc++2.10-glibc2.2_2.95.4-24_i386.deb
      after installing this package all my dependencies problems were solved and I was able to use the Sybase ODBC driver.

      It is of course not great to have this dependency, but the other options are using the native ct-lib (have to write a driver myself) or use the FreeTDS ODBC drivers.

      What are you experiences with using CT-lib, vs the Sybase ODBC? -I mean performance wise.

      cheers!

      1. To be honest, for the applications I’ve run into, I have yet to see real difference in performance between CT-LIB, ODBC or JDBC in the driver layer. Most of the bottlenecks tended to be with:

        1 Poor queries (no covering indexes or just bad SQL coding)
        2 Application design
        3 Sybase ASE misconfiguration
        4 OS misconfiguration

        Way way down the list would be the connection drivers. That’s not to say that there aren’t issues with the various drivers and abstraction layers though.

        Jason

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Facebook login by WP-FB-AutoConnect