Results 1 to 14 of 14

Thread: ODBC Wrapper

  1. #1
    Join Date
    Nov 2010
    Posts
    99

    Unanswered: ODBC Wrapper

    I would like to replicate to MYSQL on AWS from DB2 9.7 AESE Redhat 5.3 Power7 PPC. I installed unixODBC, and yum'd the mysql driver installs and created port forward. I can connect to the server no problem. However I get an error when I try to create an ODBC wrapper (with the intention of creating a federated server to MYSQL).

    Hi I wouldn't post here unless I exhausted my search.

    ERROR IS AT BOTTOM:

    Here is the details for the drivers:

    odbcinst -j

    unixODBC 2.3.2
    DRIVERS............: /etc/odbcinst.ini
    SYSTEM DATA SOURCES: /etc/odbc.ini
    FILE DATA SOURCES..: /etc/ODBCDataSources
    USER DATA SOURCES..: /home/db2inst1/.odbc.ini
    SQLULEN Size.......: 4
    SQLLEN Size........: 4
    SQLSETPOSIROW Size.: 2
    [db2inst1@TMART01:~]$


    vi /etc/odbcinst.ini

    # Driver from the mysql-connector-odbc package
    # Setup from the unixODBC-libs package
    [MySQL]
    Description = ODBC for MySQL
    Driver = /usr/lib/libmyodbc3_r.so
    Setup = /usr/lib/libodbcmyS.so
    Driver64 = /usr/lib64/libmyodbc3_r.so
    Setup64 = /usr/lib64/libodbcmyS.so
    FileUsage = 1

    # Driver from the mysql-connector-odbc64 package
    # Setup from the unixODBC64-libs package
    [MySQL64]
    Description = ODBC for MySQL (64 bit)
    Driver = /usr/lib/libmyodbc5.so
    Setup = /usr/lib/libodbcmyS64.so
    Driver64 = /usr/lib64/libmyodbc5.so
    Setup64 = /usr/lib64/libodbcmyS64.so
    FileUsage = 1

    Here is the error:

    db2 "create wrapper ODBC LIBRARY'/usr/lib/libmyodbc5.so'"
    DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL10013N The specified library "/usr/lib/libmyodbc5.so" could not be loaded.

    THANKS!

    James

  2. #2
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    I don't know if what you are trying to do is supported (by ibm) with the software you are using.
    What extra information is in the db2diag.log for the failure to load /usr/lib/myodbc5.so ?
    If necessary, temporarily set diaglevel to 4, recreate the symptom.
    (verify the .so is present, and executable, and that the db2-instance owner has read and execute rights to it).
    Also check the rhel message log to see if there are relevant entries. The bitness of the db2 and the shared object file must match.

  3. #3
    Join Date
    Nov 2010
    Posts
    99
    2014-12-19-11.08.44.686079-300 I13472674A389 LEVEL: Info
    PID : 3833 TID : 550389932016PROC : db2diag
    INSTANCE: db2inst1 NODE : 000
    FUNCTION: DB2 UDB, base sys utilities, sqle_LoadAndInitCscLibrary, probe:3
    DATA #1 : <preformatted>
    CSC Initialization failed (Load default library /opt/ibm/db2/V9.7/pqcmx/pureQuery/lib64/libpqcmx.so failed with rc = 0)

  4. #4
    Join Date
    Nov 2010
    Posts
    99
    I have has issues with the endianness on Power7, not sure that's an issue here though.

  5. #5
    Join Date
    Nov 2010
    Posts
    99
    I am executing as the instance owner. It's just the create wrapper that is failing, I can connect to MYSQL on Amazon using isql.

  6. #6
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    db2diag entry provided is not relevant.
    Set diagleve to 4. Retry the failing statement.
    Show all db2diag entries after the diaglevel 4 change up to the point of failure.
    If you give full answers to all suggestions (e.g. permissions, system message logs), it's more likely you will get help.

  7. #7
    Join Date
    Nov 2010
    Posts
    99
    2014-12-19-11.54.32.908973-300 E13630456A728 LEVEL: Error (OS)
    PID : 10241 TID : 4404488892960PROC : db2sysc 0
    INSTANCE: db2inst1 NODE : 000 DB : HFA_CONV
    APPHDL : 0-1083 APPID: *LOCAL.db2inst1.141218221359
    AUTHID : DB2INST1
    EDUID : 534 EDUNAME: db2agent (HFA_CONV) 0
    FUNCTION: DB2 UDB, oper system services, sqloLoadModule, probe:190
    CALLED : OS, -, dlopen OSERR: EINTR (4)
    DATA #1 : Library name or path, 39 bytes
    /usr/local/unixODBC/lib//libodbcinst.so
    DATA #2 : shared library load flags, PD_TYPE_LOAD_FLAGS, 4 bytes
    0
    DATA #3 : String, 68 bytes
    /usr/local/unixODBC/lib//libodbcinst.so: wrong ELF class: ELFCLASS32

    2014-12-19-11.54.32.909447-300 I13631185A1127 LEVEL: Error
    PID : 10241 TID : 4404488892960PROC : db2sysc 0
    INSTANCE: db2inst1 NODE : 000 DB : HFA_CONV
    APPHDL : 0-1083 APPID: *LOCAL.db2inst1.141218221359
    AUTHID : DB2INST1
    EDUID : 534 EDUNAME: db2agent (HFA_CONV) 0
    FUNCTION: DB2 UDB, Common Trace API, sqlqg_call_sqloLoadModule, probe:50
    MESSAGE : ZRC=0x870F009B=-2029059941=SQLO_MOD_LOAD_FAILED
    "Dynamic library load failed."
    DATA #1 : Hexdump, 14 bytes
    0x000004016B48F924 : 6C69 626F 6462 6369 6E73 742E 736F libodbcinst.so
    CALLSTCK: (Static functions may not be resolved correctly, as they are resolved to the nearest symbol)
    [0] 0x0000000000000000 ?unknown + 0x0
    [1] 0x0000000000000000 ?unknown + 0x0
    [2] 0x0000000000000000 ?unknown + 0x0
    [3] 0x0000000000000000 ?unknown + 0x0
    [4] 0x0000000000000000 ?unknown + 0x0
    [5] 0x0000000000000000 ?unknown + 0x0
    [6] 0x0000000000000000 ?unknown + 0x0
    [7] 0x0000000000000000 ?unknown + 0x0
    [8] 0x0000000000000000 ?unknown + 0x0
    [9] 0x0000000000000000 ?unknown + 0x0

    2014-12-19-11.54.36.041812-300 I13632313A389 LEVEL: Info
    PID : 12516 TID : 550389932016PROC : db2diag
    INSTANCE: db2inst1 NODE : 000
    FUNCTION: DB2 UDB, base sys utilities, sqle_LoadAndInitCscLibrary, probe:3
    DATA #1 : <preformatted>
    CSC Initialization failed (Load default library /opt/ibm/db2/V9.7/pqcmx/pureQuery/lib64/libpqcmx.so failed with rc = 0)

  8. #8
    Join Date
    Nov 2010
    Posts
    99
    The diaglevel is 4. I changed the library to 64bit and now get a different error:

    db2 "CREATE WRAPPER odbc LIBRARY'/opt/ibm/db2/V9.7/lib64/libdb2o.so'"
    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL10010N The specified library, "/opt/ibm/db2/V9.7/lib64/libdb2o.so", was
    loaded, but the function "UnfencedWrapper_Hook" could not be executed.

    DIAGLOG:

    2014-12-19-12.25.17.209665-300 I13740869A389 LEVEL: Info
    PID : 30853 TID : 550389932016PROC : db2diag
    INSTANCE: db2inst1 NODE : 000
    FUNCTION: DB2 UDB, base sys utilities, sqle_LoadAndInitCscLibrary, probe:3
    DATA #1 : <preformatted>
    CSC Initialization failed (Load default library /opt/ibm/db2/V9.7/pqcmx/pureQuery/lib64/libpqcmx.so failed with rc = 0)

  9. #9
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    Ensure you are at fixpack 10 of DB2 v9.7.

    After changing the mysql bitness, what is the revised 'create wrapper' statement?

    As previously mentioned, have you verified (with IBM support) that *your combination* of software will let you achieve what you seek? It may be that you need an additional product (federation server).

    Docs state:
    Federated system users: If the function name is "UnfencedWrapper_Hook" or "FencedWrapper_Hook", then verify that you specified the correct library name on the CREATE WRAPPER statement. Specify the library name that does not end in "U" or "F". For example, to create the DRDA wrapper on AIX, specify library 'libdb2drda.a', but not 'libdb2drdaU.a' or 'libdb2drdaF.a.'. If the wrapper library is supplied by a vendor, then contact the vendor to get an updated version of the wrapper library.

  10. #10
    Join Date
    Nov 2010
    Posts
    99
    I am at 9.7 FP5

    db2 "CREATE WRAPPER odbc LIBRARY'/opt/ibm/db2/V9.7/lib64/libdb2o.so'

    I have federation server and am currently federating several servers.

    I saw that document as well, i have to assume it's .so for LINUX since it wasn't explicit.

  11. #11
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Code:
    2014-12-19-11.54.32.908973-300 E13630456A728      LEVEL: Error (OS)
    PID     : 10241                TID  : 4404488892960PROC : db2sysc 0
    INSTANCE: db2inst1             NODE : 000         DB   : HFA_CONV
    APPHDL  : 0-1083               APPID: *LOCAL.db2inst1.141218221359
    AUTHID  : DB2INST1
    EDUID   : 534                  EDUNAME: db2agent (HFA_CONV) 0
    FUNCTION: DB2 UDB, oper system services, sqloLoadModule, probe:190
    CALLED  : OS, -, dlopen                           OSERR: EINTR (4)
    DATA #1 : Library name or path, 39 bytes
    /usr/local/unixODBC/lib//libodbcinst.so
    DATA #2 : shared library load flags, PD_TYPE_LOAD_FLAGS, 4 bytes
    0
    DATA #3 : String, 68 bytes
    /usr/local/unixODBC/lib//libodbcinst.so: wrong ELF class: ELFCLASS32
    DB2 is trying to load /usr/local/unixODBC/lib//libodbcinst.so, and it looks like it has wrong bitness.
    ---
    "It does not work" is not a valid problem statement.

  12. #12
    Join Date
    Nov 2010
    Posts
    99
    Thanks n_i. I am using the /usr/lib64 library and am now getting the following error:

    DB21034E The command was processed as an SQL statement because it was not a
    valid Command Line Processor command. During SQL processing it returned:
    SQL10010N The specified library, "/usr/lib64/libodbc.so", was loaded, but the
    function "UnfencedWrapper_Hook" could not be executed. SQLSTATE=42724


    The diaglog is only giving me an INFO message:

    2014-12-19-15.15.15.923360-300 I559340A389 LEVEL: Info
    PID : 26942 TID : 550389932016PROC : db2diag
    INSTANCE: db2inst1 NODE : 000
    FUNCTION: DB2 UDB, base sys utilities, sqle_LoadAndInitCscLibrary, probe:3
    DATA #1 : <preformatted>
    CSC Initialization failed (Load default library /opt/ibm/db2/V9.7/pqcmx/pureQuery/lib64/libpqcmx.so failed with rc = 0)

  13. #13
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Did you see the explanation for SQL10010N in the manual?
    ---
    "It does not work" is not a valid problem statement.

  14. #14
    Join Date
    Nov 2010
    Posts
    99
    Still stuck. Yes I did and so I tried to create a ODBC wrapper using ANY lib*.so lib*.la with odbc in the name in my /usr/lib64 dir. No luck. I also ran dltest and rpm -qf <name.so> on all *.so and the result were positive - libraries are linked successfully and package is in use.

    The odd thing is that on the same DB2 server I can connect to the AWS server/MySQL db using the unixODBC tool isql -v <odbc.ini def>, as long as I have the port forward command running in the background. But I cannot create an ODBC wrapper...

    My goal is to sync the DB2 data (push) to the AWS server MySQLdb. If I can't get federation to work then I will have to periodically scp export files of the INSERT,UPDATE,DELETE operations on tables XYZ then connect to AWS MySQL and load append the MySQL tables manually. Not really an enterprise solution...

Posting Permissions

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