Get Data Moving 1
Results 1 to 2 of 2

Thread: HOW TO: Config AIS ODBC thinclient datasource under Unix ODBC manager

  1. #1
    Tony Mou is offline APAC Support Manager
    Join Date
    Sep 2006
    Location
    China
    Posts
    35
    Rep Power
    0

    HOW TO: Config AIS ODBC thinclient datasource under Unix ODBC manager

    This article is intended to explain how to install open source ODBC manager on unix machine and config a AIS thinclient datasource under it.
    A iODBC (www.iodbc.org) on 64-bit IBM AIX machine installation will be used as example.For other unix odbc manager ,e.g unixodbc(www.unixodbc.org) ,on other platform,the steps are quite similar.


    Step I) install iODBC (If you already have the iODBC installed, you can skip to Step II)

    1) Download the software source code from http://www.iodbc.org/index.php?page=downloads/index .Current version is libiodbc-3.52.6.tar.gz

    2) unzip it

    $gzip -d libiodbc-3.52.6.tar.gz
    $tar xvf libiodbc-3.52.6.tar

    3) Prepare the make environment,

    $setenv CC cc_r
    #To compile a 64-bit version of the driver manager using the xlc_r compilers, set the environment variables OBJECT_MODE and CFLAGS:
    $setenv OBJECT_MODE 64
    $setenv CFLAGS "-O -q64"
    $setenv LDFLAGS "-brtl"
    # Define the installation dir to /home/apsup/iODBC
    $cd libiodbc-3.52.6
    $./configure --prefix=/home/apsup/iODBC

    4) Build it

    $make install

    5) After successfully make, the file folders will be as following :

    ~/iODBC >> ls -ltr
    total 8984
    drwxr-xr-x 14 apsup users 4096 Jul 24 20:02 libiodbc-3.52.6
    drwxr-xr-x 3 apsup users 256 Jul 24 20:10 man
    drwxr-xr-x 2 apsup users 4096 Jul 24 20:10 include
    drwxr-xr-x 3 apsup users 4096 Jul 24 20:10 lib
    drwxr-xr-x 3 apsup users 256 Jul 24 20:10 share
    drwxr-xr-x 2 apsup users 256 Jul 24 22:17 etc
    drwxr-xr-x 2 apsup users 256 Jul 24 22:33 bin


    To build unixodbc (www.unixodbc.org) on 64 bit AIX,following environment should be set.


    $setenv CC xlc_r
    $setenv CXX xlC_r
    #To compile a 64-bit version of the driver manager using the xlc_r compilers, set the environment variables OBJECT_MODE and CFLAGS:
    $setenv OBJECT_MODE 64
    $setenv CFLAGS -q64
    $setenv CPPFLAGS="-DBUILD_REAL_64_BIT_MODE -DSIZEOF_LONG=8"
    $cd unixODBC-2.2.14
    ./configure --prefix=/home/apsup/unixodbc --enable-gui=no -enable-drivers=no


    Step II) Config AIS datasource : ( In this example, a 'disam' datasource under attconnect://localhost/Navigator will be added ,and AIS 64 bit thin client software is installed under /home/apsup/thinodbc51

    1) Edit a script to set the environment variable of iODBC's

    $ cat setenv
    setenv ODBCINI /home/apsup/iODBC/etc/odbc.ini
    setenv ODBCINSTINI /home/apsup/iODBC/etc/odbcinst.ini
    setenv ODBCHOME /home/apsup/iODBC
    setenv LIBPATH /home/apsup/thinodbc51:/home/apsup/iODBC/lib:/home/apsup/mylib:/usr/lib
    setenv PATH .:$PATH

    2) Edit $ODBCINSTINI & $ODBCINI files as following :
    ~/iODBC/etc >> cat odbcinst.ini
    [ODBC]
    Trace=yes
    Tracefile=/home/apsup/iODBC/odbc.log
    [Attunity]
    Driver=/home/apsup/thinodbc51/thinapi.so


    ~/iODBC/etc >> cat odbc.ini

    [ODBC]
    Trace=yes
    Tracefile=/home/apsup/iODBC/odbc.log
    [ODBC Data Sources]
    disam=Attunity Connect Driver

    [disam]
    Driver=Attunity
    Description=Attunity Connect Driver
    BindURL=attconnect://localhost/Navigator
    OneTdpMode=1
    DefTdpName=disam
    Debug/generalTrace=true
    Debug/apiTrace=true
    Debug/TimeTrace=true
    Debug/LogFile=/home/apsup/iODBC/aisodbc_%p.log


    3) Test it :


    $ ~/iODBC >> source setenv.sh
    _____________
    $ ~/iODBC >> cd bin
    _____________
    $~/iODBC/bin >> iodbctest DSN=disam
    iODBC Demonstration program
    This program shows an interactive SQL processor
    Driver Manager: 03.52.0607.1008
    Driver: 05.1.0000 (ODNAVSHR)
    SQL>select * from test;
    id |name
    -----------+----------
    1 |a
    2 |b
    result set 1 returned 2 rows.

    SQL>exit
    To Find Out more About Attunity Technology:
    Attunity
    or:
    Contact Us

  2. #2
    Tony Mou is offline APAC Support Manager
    Join Date
    Sep 2006
    Location
    China
    Posts
    35
    Rep Power
    0
    We can use program odbcutil ,coming with AIS ODBCThin client 5.3, to access the datasource under ODBC manager: (when odbcutil prompt the dll file, input the odbc manager's.e.g /home/apsup/iODBC/lib/libiodbc.so)
    e.g following is the steps test with unixodbc manager:
    1 ibm3_new(apsup) ~ >> cd unixodbc
    _____________
    2 ibm3_new(apsup) ~/unixodbc >> ls
    UnixODBC-2.2.14.tar etc odbc.ini_bak
    aisodbc2.log include setenv.sh
    bin lib unixODBC-2.2.14
    compile.sh mysql
    _____________
    3 ibm3_new(apsup) ~/unixodbc >> cd unixodbc
    _____________
    14 ibm3_new(apsup) ~/unixodbc >> cat setenv.sh
    setenv ODBCINI /home/apsup/unixodbc/etc/odbc.ini
    setenv ODBCINSTINI /home/apsup/unixodbc/etc/odbcinst.ini
    setenv ODBCHOME /home/apsup/unixodbc
    setenv LIBPATH /home/apsup/thinodbc53:/home/apsup/unixodbc/mysql/lib:/home/apsup/unixodbc/lib:/home/apsup/mylib:/usr/lib
    setenv PATH .:$PATH
    _____________
    _____________
    4 ibm3_new(apsup) ~/unixodbc >> source setenv.sh
    _____________
    5 ibm3_new(apsup) ~/unixodbc >> cd ..
    _____________
    6 ibm3_new(apsup) ~ >> cd thinodbc53
    _____________
    7 ibm3_new(apsup) ~/thinodbc53 >> ls
    AIS64-5307-ODBC_Thin_Client-ibmaix.tar navcli.h
    ThinODBCReadme.txt nvdb_disam.so
    acx3gl.o odbcinc.h
    aisconf.h samples
    libnavshr.so tests
    libnvbaseshr.so thinapi.a
    libodnavshr.so thinapi.so
    nav_util thincli.o
    _____________
    8 ibm3_new(apsup) ~/thinodbc53 >> cd samples
    _____________
    9 ibm3_new(apsup) ~/thinodbc53/samples >> cd odbcutil
    _____________
    10 ibm3_new(apsup) ~/thinodbc53/samples/odbcutil >> ls
    aisconf.h odbcinc.h odbcutil.make odbcutil_x86.sh
    nav.log odbcutil odbcutil.o readme.txt
    navcli.h odbcutil.c odbcutil_x64.sh
    _____________
    11 ibm3_new(apsup) ~/thinodbc53/samples/odbcutil >> odbcutil execute disam
    Enter driver library [thinapi.so]: /home/apsup/iODBC/lib/libiodbc.so

    -- Library loaded successfully...
    -- Looking for ODBC functions...
    -- ODBC functions located successfully...
    -- SQLAllocEnv successfully executed...
    Connecting using DSN=disam;
    Enter empty line to accept or type a different connect string to override:
    Calling SQLDriverConnect... Connected...
    Complete connection string returned by the driver is:
    DRIVER={Attunity Connect Driver};OneTdpMode=1;Description=Attunity DB2 Driver on the Mainframe;Debug/logfile=/home/apsup/unixodbc/aisodbc2.log;BindURL=194.90.22.81:8521/Navigator;Debug/apiTrace=true;Debug/generalTrace=true;DefTdpName=disam
    -- SQLDriverConnect executed successfully...
    [1] Enter SQL to execute or empty line to quit:
    select * from test;
    -- Calling SQLPrepare... OK...
    id,name
    1,'a '
    1,'a '
    Returned 2 rows...
    To Find Out more About Attunity Technology:
    Attunity
    or:
    Contact Us

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •