Showing posts with label ODBC. Show all posts
Showing posts with label ODBC. Show all posts

Monday, October 17, 2016

[01000][unixODBC][Driver Manager]Can't open lib…file not found


I have installed a new BOXI system and working on unixODBC configuration to connect to Microsoft SQLServer Database and received below error message

$ isql -v test_ds test_username test_password
[01000][unixODBC][Driver Manager]Can't open lib '/u01/boxi/app/testsrv/sap_bobj/enterprise_xi40/linux_x64/ odbc/7.0.1/lib/CRsqls26.so' : file not found
[ISQL]ERROR: Could not SQLConnect

First I thought the issue with invalid patch and I have corrected the issue but I still see same error

It looks like LD_LIBRARY_PATH was not updated properly, which might be reason it’s not able to find the library. I have updated the updated LD_LIBRARY_PATH and I was able to connect successfully.

In some cases you will see the same error, if all dependent libraries are not installed. Run “ldd on the library /u01/boxi/app/testsrv/sap_bobj/enterprise_xi40/linux_x64/odbc/lib/CRsqls24.so to ensure all dependencies are found. If something not found in below output then required PRM’s or soft links are missing.

$ ldd /u01/boxi/app/testsrv/sap_bobj/enterprise_xi40/linux_x64/odbc/lib/CRsqls24.so
linux-vdso.so.1 => (0x00007ffd43be6000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc9cf77e000)
librt.so.1 => /lib64/librt.so.1 (0x00007fc9cf575000)
libCRicu26.so => /u01/boxi/app/biqapp/sap_bobj/enterprise_xi40/linux_x64/odbc/7.0.1/lib/libCRicu26.so (0x00007fc9ce67e000)
libodbcinst.so => /u01/boxi/app/biqapp/sap_bobj/enterprise_xi40/linux_x64/odbc/7.0.1/lib/libodbcinst.so (0x00007fc9ce45a000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc9ce255000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fc9cdf4f000)
libm.so.6 => /lib64/libm.so.6 (0x00007fc9cdccb000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc9cd936000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc9cd720000)
/lib64/ld-linux-x86-64.so.2 (0x0000003ebc200000)

Regards ,
Satishbabu Gunukula, Oracle ACE
http://www.oracleracexpert.com

Thursday, March 10, 2016

SAP DBTech JDBC: [403]: internal error: Cannot get remote source objects: Unable to load driver manager

When trying to create “Remote source” to Microsoft SQL Server under Smart Data Access (SDA) using HANA received following error

SAP DBTech JDBC: [403]: internal error: Cannot get remote source objects: Unable to load driver manager 

By looking the error it looks like the driver does not exists or not installed properly.  To find out the driver install or not run below command, if you receive an error then its not installed.

#isql --help
SAP DBTech JDBC: [403]: internal error: Cannot get remote source objects: [unixODBC][Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Login failed for user 'hanasdauser'. 

I have followed below steps to install the Drivers

1. Set the environment
# cd /hana/ms-odbc-driver/unixODBC-2.3.0
# export CPPFLAGS=”-DSIZEOF_LONG_INT=8”
# echo $CPPFLAGS
-DSIZEOF_LONG_INT=8

2. Configure
#./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --enable-gui=no --enable-drivers=no --enable-iconv --with-iconv-char-enc=UTF8 --with-iconv-ucode-enc=UTF16LE

3. Run make utility
# make

4. Run make install
# make install

5. Test the driver is installed or not
# isql –help
unixODBC 2.3.0

After installing the driver I was able to create Remote Source in HANA under SDA.

Regards
Satishbabu Gunukula, Oracle ACE
http://www.oracleracexpert.com

Wednesday, February 17, 2016

How to enable and disable HANA Client Trace

Use hdbodbc_cons for tracing applications based on ODBC and hdbsqldbc_cons for tracing applications based on SQLDBC.

Use blow syntax

hdbodbc_cons.exe trace <level> <on/off>

Where levels are:
             api: tracing of ODBC api calls
             debug: detailed tracing of whole call stack
             sql: tracing of sql commands as well as output and parameter handling

Before you trun on trace, first configure the trace file name.
C:\Program Files\sap\hdbclient>hdbodbc_cons.exe config trace filename C:\temp\hdbodbc_trace.log

To turn on/off trace use below examples

Tracing of sql commands as well as output and parameter handling
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace sql on
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace sql off

Detailed tracing of whole call stack
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace debug on
          C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace debug off

Tracing of ODBC api calls
           C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace api on
           C:\Program Files\sap\hdbclient>hdbodbc_cons.exe trace api off

Reference:-
SAP Note: 1993254 - Collecting ODBC Trace
SAP Note: 1993251 - Collecting SQLDBC Trace

Regards,
Satishbabu Gunukula, Oracle ACE

Wednesday, August 7, 2013

Database error : (CS) "Java Class not found in classpath : com.mysql.jdbc.Driver"(WIS 10901)

The users will see below error if they don’t configure JDBC connection properly to connect MYSQL database.

Database error : (CS) "Java Class not found in classpath : com.mysql.jdbc.Driver" . (WIS 10901)

Follow below troubleshooting steps

1. Locate jdbc.sbo file and make sure that you have added “ClassPath” with correct MySQL Connector jar file.

<ClassPath>
<Path>/home/boxi/ bobj/enterprise_xi40/dataAccess/connectionServer/jdbc/mysql-connector-java-5.1.25-bin.jar</Path>
</ClassPath>

2. Update environment variable CLASSPATH with correct jar file path.

3. Make sure that the MySQL Connector jar file is right version, means for 64bit O/S or app use 64bit jar file.

Common Error in ODBC:- 

1. The below error message is very common when using ODBC(.odbc.ini) connection

[01000][unixODBC][Driver Manager]Can't open lib '/home/boxi/bobj/enterprise_xi40/linux_x64/odbc/lib/libmyodbc5a.so' : /home/boxi/bobj/enterprise_xi40/linux_x64/odbc/lib/libmyodbc5a.so: wrong ELF class: ELFCLASS32

Cause: The file is not the right version

Possible Solution: The file is not 64-bits version of the libmyodbc5a.so, install the right version. Use 32bit version of the libmyodbc5a.so, if using 32bit.

Download MySQL Connector/ODBC

Regards
Satishbabu Gunukula, Oracle ACE
http://www.oracleracexpert.com 

Thursday, July 25, 2013

cannot open shared object file: No such file or directory

This is very generic error and you will see this error with many situations.

I have received this error when connecting to Mysql using isql

$ isql -v MySQL test_user testpass
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/libmyodbc.so' : /usr/lib/libmyodbc.so: cannot open shared object file: No such file or directory
[ISQL]ERROR: Could not SQLConnect 


Cause: The Mysql cannot find the required library

Possible Solution: Locate the file libmyodbc.so, if you don’t find the file then you might be using a different version. Find the lib file that you are using ‘libmyodbc*’ and create a link.

     For ex:- ln –s <Path to file> < Link Name>
     $ ln –s /home/mysql/lib/libmyodbc3-3.51.07.so /usr/lib/libmyodbc.so

In many causes users will see this error, if they don’t include the library path in LD_LIBRARY_PATH

Users might receive below error, when connecting using “odbcinst”. This is also one of the common error.

$ odbcinst –q -s
odbcinst: SQLGetPrivateProfileString failed with . 


Cause: The environment variables are not set properly

Solution: For Linux, edit .bash_profile and add following environment variables 

export ODBCSYSINI=/etc
export ODBCINI=/etc/odbc.ini

In caseof CSH,

setenv ODBCSYSINI /etc
setenv ODBCINI /etc/odbc.ini

Reference:

Configure a Connector/ODBC DNS on Unix
Problems with connecting other platforms to MySQL with ODBC
Download MySQL Connector/ODBC

Regards
Satishbabu Gunukula, Oracle ACE
http://www.oracleracexpert.com

Thursday, July 29, 2010

Oracle Heterogeneous Services

Oracle offers two solutions to access any number of non-Oracle systems from an Oracle environment in a heterogeneously distributed environment. They are

1. Oracle Generic Connectivity
2. Oracle Transparent Gateways.

Heterogeneous Connectivity Process - The Oracle Database server accesses the non-Oracle Database using Oracle Heterogeneous Services in conjunction with an agent. Heterogeneous Services (HS) is an integrated component within the Oracle Database server and the enabling technology for the current suite of Oracle Transparent Gateway products.

Oracle Generic Connectivity is a generic solution for any ODBC or OLEDB compliant non-Oracle system. It enables connectivity using industry standards such as ODBC and OLEDB driver. Using Generic connectivity it possible to access low-end data stores such as Access, dBase, FoxPro and non-relational targets like Excel. Generic connectivity is provided free of charge with the database server, but it is and limited in functionality and slower compared to Oracle's Gateways.

If Oracle database running on windows, setup the HS ODBC/HS OLEDB agent on the same server to access non-oracle systems. If Oracle database running on UNIX, you must install Oracle server on the windows where non-oracle database is running and setup the HS ODBC/HS OLEDB agent on the same server. If you don’t want to install Oracle server on non-oracle system then you can Install Oracle server on middle tier windows system or system that supports the ODBC or OLE DB protocols and setup the HS agent.

See the below links to setup Oracle Generic connectivity.
Oracle Generic connectivity setup in Oracle 9i
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96544/gencon.htm#1656
Oracle Generic connectivity setup in Oracle 10g
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14232/gencon.htm#g1012648

Oracle Transparent Gateways is another solution to access non-oracle database and the HS agent is a system-specific application. For example, if you include a MSSQL Sybase database in an Oracle Database distributed system then you need to obtain a Sybase-specific transparent gateway so that the Oracle Database in the system can communicate with it.

Oracle transparent Gateways are licensed separately and agents can be installed on any machine. They can be on the same machine as the Oracle database system or on the same machine as the non-Oracle system or on a third machine as a stand alone.

Following are dedicated Gateways for non-Oracle data sources:-
- Microsoft SQL*Server - Database Gateway for SQL*Server (DG4Msql)
- Sybase - Database Gateway for Sybase (DG4Sybase)
- Informix - Database Gateway for Informix (DG4Ifmx)
- IBM DB2 - Database Gateway for DRDA (DG4DRDA)
- Teradata - Database Gateway for Teradata (DG4Teradata)
- Websphere MQ - Database Gateway for Websphere MQ (DG4MQ)
- Remote online transaction processors (OLTPs) - Database Gateway for APPC (DG4APPC)
- IMS - Database Gateway for IMS (DG4IMS)
- VSAM - Database Gateway for VSAM (Dg4VSAM)
- Adabas - Database Gateway for Adabas (DG4Adabas)

See the below links to setup Transparent Gateways.
Oracle Transparent Gateways setup in Oracle 9i
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96544/admin.htm#170863
Oracle Transparent Gateways setup in Oracle 10g
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14232/admin.htm

Non-Oracle data sources for which a dedicated transparent gateway is not available can be accessed by using Database Gateway for ODBC (DG4ODBC), which uses third party ODBC drivers to make the connection to the non-Oracle data source

Database Gateway for ODBC (DG4ODBC) is the 11g version of the generic connectivity and certified for older versions (9i, 10g). However, this does require that the Oracle 10g database accessing non-Oracle database through it must be patched to at least 10.2.0.4.

See the below link for Heterogeneous connectivity setup for Oracle Database Gateways
http://www.oracle.com/pls/db111/portal.portal_db?selected=15

There are differences in licensing and functionality of the Database Gateway for ODBC and the other gateways. For more information see the Metalink notes.
Note.232482.1 Gateway and Generic Connectivity Licensing Considerations
Note.252364.1 Functional Differences between Generic Connectivity and Database Gateways

The earlier gateway versions are de-supported. For more information see the Metalink notes.
Note.549796.1 Desupport of Oracle Transparent Gateways

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com

Thursday, November 12, 2009

Oracle ODBC, OCI, OCCI Drivers, Downloads and Documentation

Oracle ODBC(Open Database Connectivity):
The Oracle ODBC Driver provides access to Oracle databases for applications written using the ODBC interface. With ODBC you can access the Oracle database using .NET, applications from any .NET programming language.

Download Oracle ODBC Driver
http://www.oracle.com/technology/software/tech/windows/odbc/index.html

Oracle ODBC Documentation
http://www.oracle.com/technology/docs/tech/windows/odbc/index.html

Please see the Oracle ODBC Driver discussion forum for any questions/issues.
http://forums.oracle.com/forums/forum.jsp?forum=145

Oracle Call Interface(OCI):
The Oracle Call Interfaces (OCI) is a set of low-level APIs (Application Programming Interface Calls) used to interact with the Oracle Database. It allows one to use operations like logon, execute, parse, fetch, etc.

Download Oracle Call Interface (OCI)
http://www.oracle.com/technology/tech/oci/instantclient/index.html

Please see the below link for OCI documentation
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14250/toc.htm

Please see the OCI (Oracle Call Interface) Discussion forum for any questions/issues
http://forums.oracle.com/forums/forum.jspa?forumID=67

Oracle C++ Call Interface:
Oracle C++ Call Interface (OCCI) is a high-performance and comprehensive API to access the Oracle database and used for client-server, middle-tier, and complex object modeling applications.

Download OCCI for Linux/Windows
http://www.oracle.com/technology/tech/oci/occi/occidownloads.html

Please see the below link for documentation
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28390/toc.htm

Please see the C++ Call Interface (OCCI) Discussion forum for any questions/issues.
http://forums.oracle.com/forums/forum.jspa?forumID=168

Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/