Trouble using ODBC on Linux

Hi there.
I'm fairly new to ODBC, so I apologize in advance if I am missing
some cirtical piece of information in my question.
I am trying to setup ODBC so that I can connect to my Oracle
database from RODBC (a package within the R statistical package),
where R is running on my Linux box where I installed the instant
client.
I have installed the 10.2.0.3 version of the instant client
(basic, odbc, and sqlplus pieces) on my Linux machine.
I have set LD_LIBRARY_PATH to include the new lib directory
/usr/lib/oracle/10.2.0.3/client/lib
which contains the libsqora.so.10.1 file.
uname -a yields the following:
Linux stacw34 2.6.9-78.0.0.0.1.ELsmp #1 SMP Fri Jul 25 14:41:56 EDT 2008 i686 i686 i386 GNU/Linux
I have set TNS_ADMIN to point to a directory with a tnsnames.ora
file that contains the following entry:
nickel =
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=tcp)
(HOST=<my_machine>)
(PORT=1521)
(CONNECT_DATA=
(SERVICE_NAME=nickel.regress.rdbms.dev.us.oracle.com)
I have verified that the tnsnames entry is working correctly
by connecting to the database using the instant client sqlplus
executable.
At this point, I am trying to connect to the database using the
ODBC piece through RODBC. I have found that the errors I get from R
seem to be the same as those from isql, so I am trying to use
isql to find the root of the problem. Is there a better tool
to validate that ODBC is working on linux?
Anyway, I installed the odbc piece from the instant client, but
I had to do some editing by hand due to the way the machine
is configured. My /etc/odbcinst.ini file contains:
[PostgreSQL]
Description          = ODBC for PostgreSQL
Driver          = /usr/lib/libodbcpsql.so
Driver64          =
Setup          = /usr/lib/libodbcpsqlS.so
Setup64          =
UsageCount          =
CPTimeout          =
CPReuse          =
FileUsage          = 1
[Oracle 10g ODBC driver]
Description = Oracle ODBC driver for Oracle 10g
Driver = /usr/lib/oracle/10.2.0.3/client/lib/libsqora.so.10.1
Setup =
FileUsage =
CPTimeout =
CPReuse =
And my ~/.odbc.ini file contains:
[nickel]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle 10g ODBC driver
DSN = nickel
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName =
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T
UserID =
When I run isql as follows:
isql -v nickel
I get the following error:
ORA-12162: TNS:net service name is incorrectly specified
It seems to be that this error occurs because I don't have
ORACLE_SID set. If I set ORACLE_SID to nickel, and then
run the same command, now I get:
ORA-12545: Connect failed because target host or object does not exist
The sqlnet.log file contains the following:
Fatal NI connect error 12545, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/usr/lib/oracle/10.2.0.3/client/lib/bin/oracle)(ARGV0=oraclenickel)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=isql@<myhost>)(HOST=<myhost>)(USER=<myuser>))))
VERSION INFORMATION:
     TNS for Linux: Version 10.2.0.3.0 - Production
     Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.3.0 - Production
     TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.3.0 - Production
Time: 20-MAR-2009 14:02:02
Tracing not turned on.
Tns error struct:
ns main err code: 12545
TNS-12545: Message 12545 not found; No message file for product=network, facility=TNS
ns secondary err code: 12560
nt main err code: 515
TNS-00515: Message 515 not found; No message file for product=network, facility=TNS
nt secondary err code: 2
nt OS err code: 0
I can't figure out what is wrong with my odbc setup which would lead
isql (and probably RODBC) to use this connect string (beq protocol, etc.).
I am guessing that is where the problem stems from.
Can you help me figure out how to find out what I am doing wrong
when configuring the odbc setup?
Thanks,
Ari
Edited by: amozes on Mar 20, 2009 11:06 AM

That's easily explained.
As you find documented in
http://download.oracle.com/docs/cd/B19306_01/install.102/b15699/post_inst_task.htm#sthref398
you have to set 'ServerName' in odbc.ini to your TNS alias, in your case:
ServerName = nickel
Since you did not give a ServerName, Oracle assumed that you want to connect to a local database.
As you rightly assume, the ORA-12162 indicates that ORACLE_SID is not set, which is needed for a local connection.
If you set ORACLE_SID, Oracle will try to establish a local connection by executing a server process $ORACLE_HOME/bin/oracle.
Since this executable cannot be found, you get the ORA-12545.
Yours,
Laurenz Albe
PS: Your solution is better, as it does not require a tnsnames.ora file.

Similar Messages

  • DTW - Trouble using ODBC and Configuration Files

    I am using SBO SP1 PL2 and DTW 2005.
    I have been making use of saving the configuration for the import of an object and then using the command line to run it, as described in DTW help under "Schedule Run".
    I typically use tab-delimited files saved from Excel and the above method works very well.
    However, I would prefer to use ODBC directly from the template tables I have in a SQL database. It works perfectly using the GUI within DTW, and it lets me save the configuration file, but when I try to run DTW from the command line using ODBC, I get these error messages:
    Can not connect to ODBC data source.
    Can not get SQL handler.
    Does anyone have any suggestions on how I can use DTW from the command line while using ODBC sources?
    Thank you.

    I've got the same problem.
    I solve it once by editing the xml file's <ExID> tag from <ExID></ExID> to <ExID />
    So the problem resides at the XML syntax.
    My problem is that I lost the XML file I used and now I can't make it work again.
    Have anybody found the solution at this problem or is there an updated version of DTW?

  • Help Using Instant Client ODBC on Linux

    I am familiar with using ODBC and visual basic under Windows. I would like to use the Oracle instant client ODBC under Red Hat ES3 within a C or C++ program to access an Oracle database.
    Where can I find documentation related to this:
    a) setting up an ODBC connection on Linux
    b) installing the Oracle instant client on Linux
    c) building an application with Oracle instant client ODBC
    Am I correct in assuming that any C/C++ ODBC code examples from windows could also be used on Linux.
    Thanks,
    Werner

    We are also interested in the very same thing. We are using third party compiler called SIMSCRIPT from CACI which has a module called SDBC for database connectivity. SDBC requires ODBC to be installed/configured. Our application is for Linux, therefore we are interested in using the ODBC driver on Linux clients to connect Oracle database servers on Linux and Sparc. I see the odbc related zip (for 10g) and rpm (for 11g) instant client files on the OTN Instant Client download page. How to install/configure odbc instant client? Is there a document/whitepaper/Metalink Note ?
    Thank you

  • How connect the oracle/Linux using ODBC

    I want to connect the Oracle which install on Linux using Odbc, so my win98 machine can connect with the oracle.
    But I don't know how to do ? May I install some Odbc driver in the Linux machine? and install odbc driver in my win98 machine?
    my email: [email protected]

    You may use this way:
    1. Start on the server (Linux) Net*8 listener (lsnrctl start)
    2. Install on the client (win98) Net*8 and configure it (Net8 Easy Configuration)
    3. Install on the client (win98) ODBC drivers for ORACLE (by ORACLE or others) and configure it

  • ODBC on Linux

    I have C++ code that uses ODBC to access a data source. I would like to port this code to run on Linux and have it access an Oracle 8i database also on Linux. Yes I can get ODBC drivers for 8i, but if I understand the drivers correctly they just provide a service that takes tcp/ip, or remote command, requests and forward them to the database. I will need these drivers to forward ODBC requests to the database. What I need is either a C library that takes ODBC calls and converts them to some ipc mechanism and talks to the Oracle database, or a cook book chart that maps ODBC calls to OCI calls. Can this be found anywhere? I am sorry if this is not the correct forum (if it isn't please direct me to the proper forum). I've already tried the Linux forum but they were useless.
    Thanks,
    Andy.

    Check with Merant Corp at www.merant.com. The last time I checked they had ODBC drivers at least on Solaris sparc, HP, and AIX.

  • Using iPhone with Linux?

    Does anybody know if there's a sensible way to use iPhone with Linux? I really like the look of the iPhone 3G S, but since I run Ubuntu it looks like I've got no way to really use it.
    Apart from the whole iTunes, Apple Store & Firmware updates issue, I've got a bunch of MP3's that I'd want to be able to transfer onto the phone to play them. Is there any way to do that from Linux?

    I've tried Wine with iTunes, but it hasn't worked. QuickTime will install, but that's it (besides, I've had loads of troubles with iTunes on Windows). Consequently, as I'm on the Linux side of my computer all the time, I never really update my podcasts, making my iPhone little different from a regular mobile phone (which in Japan has music players already built into them).
    I dare say, consequently, if my iPhone is lost, stolen, or damaged, I won't be replacing it with another iPhone.

  • Any issues with using LDAP on LINUX for GRC 5.2 UME?

    Our company is converting our LDAP servers from AIX to LINUX.  The DNS name used in our UME connection should not change.  Are there any issues with using LDAP on LINUX?  We are currently on GRC 5.2 SP9 (in the middle of upgrading to SP12).
    Also, I have been trying to connect our test UME system to a test LDAP box that has already been converted to LINUX but keep getting a 'connection failed' error when I try to test it. 
    Do you have to reboot the server to test changing the LDAP connections?  I've been trying it by going into UME, pulling up the LDAP tab, hitting the Modify button, entering the new userid and password for test LDAP, and hitting the Test Connection button.  I've verified that this userid and password is correct for test LDAP.
    Is there a way to get more information about why the connection failed?
    Thanks.

    I've been told by our LDAP Support group that none of the other configuration settings should have to be changed.  I should only have to change the id and password to connect to a test version of LDAP instead of our regular connection to the production LDAP.
    Can you test a connection for a different userid/password without having to reboot/restart the server?  Do I need to change these two settings, save then, reboot/restart, and then do the Test Connection button?
    Thanks.

  • How to run SAP BUSINESS ONE 8.8 clients on windows and use MaxDB on linux/W

    Good day,
    As the subject shows we have SAP BUSINESS ONE 8.8 and I want to find out how to use it in combination with MaxDB instead of MS SQL. I find a lot of MaxDB stuff on the net but no guides on how to setup SAP BUSINESS ONE 8.8 clients on windows workstations and connect them to MaxDB.
    Is this possible and if so how do I go about doing it ?
    Any assistance is greatly appreciated .

    Hi,
    I suggest you to check the supported server for B1 in this link:
    http://service.sap.com/smb/sbo/platforms
    You will know the sap b1 supported platform.
    If you really want to use maxDB on linux/W as B1 server, you can send a development request to SAP AG.
    JimM

  • How do I combine multiple PDF using PHP on Linux

    Hi,
    I would like to know if there is an Adobe product that can combine multiple PDF's into a single document and works on Linux? We are developing an application using PHP on Linux that has to combine selected PDF's and would like to know if there is a tool with api's (or command line interface) to allow that.

    Adobe licenses the PDF Library SDK for native developers on Linux platforms (as C code). They do not supply PHP tools.

  • How can I connect to the database using ODBC within excel.

    Hi,
    How can I connect to the database using ODBC within excel and just refresh the data when needed.
    Thanks,
    Priyanka
    Edited by: user554934 on Jun 9, 2009 2:53 AM

    This is NOT an APEX relevant question, try posting it in the SQL/PL/SQL Forum..
    Thank you,
    Tony Miller
    Webster, TX

  • Retrieving data from a remote DB using ODBC ?

    Hi,
    Has anybody tried to collect some data from a remote DB in InDesign plugin by using ODBC ? I want to know the basic steps including what I have to add in the Xcode project, how to connect to remote DB, and how to retrieve data in plugin by sql query ?
    TIA,
    Nima

    I think you need to add /usr/lib/libiodbc.a to your Xcode project. also you will want to look into sql.h and sqlext.h assuming you're connecting to database such as MySQL to see what's the API you will use to communicate thru ODBC. But the code should be purely C++, nothing InDesign specific, you can write it as a separate library or an InDesign Boss object.
    You will also need to install ODBC driver that's probably would be supplied by your database vendor. So for MySQL, there is a driver you need to download from MySQL site and install, and configure thru OSX's ODBC Administrator tool.
    Thanks!
    lee

  • Error while accessing excel file using ODBC

    Hi
    I am getting the below error message while accessing excel sheet using ODBC from Oracle:
    ERROR at line 1:
    ORA-28545: error diagnosed by Net8 when connecting to an agent
    Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from EXCL
    Can anyone help me on this...
    Cheers
    Pradeep
    Message was edited by:
    user634393

              Hi
              Thank you.Is there a way to read a file which is existing in the war file.
              Regards
              Anand Mohan
              "Wenjin Zhang" <[email protected]> wrote:
              >
              >In Weblogic, if your files are archived in a WAR, you cannot get an entry
              >as individual
              >file since it is only bytes in a large archive file. So getRealPath will
              >give
              >you null result. If you only want the path, try to use other getXXXPath,
              >getURL,
              >or getURI method. If you want to read the content, use getResource.
              >
              >
              >"Anand" <[email protected]> wrote:
              >>
              >>Hi
              >>I am having problem while accessing the file located in the server from
              >>a JSP
              >>page. I am not getting the RealPath from a JSP page using getRealPath(request.getServletpath()).
              >>
              >>The same code is working if the jsp placd under defaultwebApp directory
              >>and not
              >>working if i create a war and deploy the same.
              >>
              >>I am using weblogic server 7.0 trail version.I am setting the context
              >>path also.
              >>
              >>Can any help me in this regard.
              >>
              >>Thank And Regards
              >>
              >>Anand Mohan
              >
              

  • McAfee SiteAdvisor is no longer working with my Safari 8.0.  I never had trouble using it with Safari before this latest version.  Has anyone else had this problem?

    McAfee SiteAdvisor is no longer working with my Safari 8.0.  I never had trouble using it with Safari before this latest version.  Has anyone else had this problem?  I contacted McAfee support and they said nobody else is reporting this issue.

    Wow, life is certainly tough for you.
    S***t happens.  That's why there's a warranty.

  • Crystal 2011 getting Logon failed IM004 error when using ODBC (RDO)

    I just installed Crystal Reports 2011 on Windows 7 Ultimate SP1.  Sporadically, but way too often (I would estimate about 60% of the time), when I go to set up an ODBC (RDO) connection or refresh an existing report and enter the password, I get the following error:
    Logon failed.
    Details: IM004:[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle on SQL_Handle_ENV failed
    Other times, it just works, with no changed made.  It seems to work slightly more often when using the SQL Server driver (the one for SQL 2000) as opposed to the SQL Native Client or SQL Server Native Client 10.0 drivers.  But not often enough for that to be the solution.
    I have tested this with a locally installed SQL Server (on the same machine as Crystal Reports) and remote SQL Servers, with SQL 2000, 2005 and 2008.  Same results.
    I have Crystal Reports 2008 installed on the same machine and have not once had this problem.  I have tried using the same ODBC connections I already had from Crystal 2008 with Crystal 2011 and also to create new ones, same results either way.
    Is this a known issue, or is there a switch/setting I need to change to make this work consistently?  I am especially puzzled by the fact that it seems random, I have not been able to find any pattern at all.

    Hi Victoria,
    MS SQL Server 2008 has a client install now, the MDAC/WDAC doesn't install it as MS used to do with all of their OS's. CR also had to update the use of SQL Server 2008 to include the SQLNCLI10 client engine.
    I suggest, if you have not already, install the Native 10 client from either the SQL Server CD or you can download the MSI from MS's site and only use the Native 10 driver.
    MS kind of dropped ODBC and moved to OLE DB. The native client actually uses the OLE DB driver so using ODBC just puts another layer on top of OLE DB anyways. It's more convenient to use ODBC for deploying applications but it can affect performance.
    Anyways, as noted, CR 2011 is still in Ramp up mode so this issue may have been tracked. If not though you can purchase a support case, if it's a bug then you'll get a refund, if it's a limitation in MS then no refund.
    There is [SP 1 for CR 2011|https://smpdl.sap-ag.de/~sapidp/012002523100007683092011E/cr2011sp1.exe] - http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm
    Seems to be a problem with that page right now so try again later... and apply SP 1 or wait until it goes GA and test again. If it's still an issue then you can log a case.
    Firefox just got updated and it's failing, IE works though...
    Thanks again
    Don
    Edited by: Don Williams on Jun 22, 2011 8:51 AM

  • How to use ODBC SQLDriverConnect() without using tnsnames.ora file

    I have an ODBC application that connects to an Oracle 10g database. Currently, my SQLDriverConnect() function call uses the following connection string:
    DRIVER={Oracle in OraClient10g_home1}; DBQ=MyDB.world; DBA=W; UID=foo; PWD=bar
    This requires an entry in the tnsnames.ora file that looks like this:
    MyDB.world =
    (DESCRIPTION = (ADDRESS_LIST =
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server1.intel.com)(Port = 1521)
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server2.intel.com)(Port = 1521)
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server3.intel.com)(Port = 1521)
    (ADDRESS =
    (PROTOCOL = TCP)(Host = server4.intel.com)(Port = 1521)
    (LOAD_BALANCE = yes)
    (CONNECT_DATA = (SERVER = DEDICATED)
    (SERVICE_NAME = MY_SRVC))
    However, I would really like to be able to connect using ODBC without having to create that entry in the tnsnames.ora file. I have tried to substitute the DBQ=MyDB.world with the entire (DESCRIPTION=..... string from the original tnsnames.ora file, but it returns the error:
    ORA-12154: TNS: Could not resolve the connect identifier specified.
    I have heard others are able to use sqlplus with no tnsnames.ora file and the do specify the entire (DESCRIPTION=.... string on the sqlplus connection string, but is this possible to do using the ODBC SQLDriverConnect() function? If so, do I need to use a different keyword/value pair other than DBQ=?
    Any help on this would be greatly appreciated.
    Thank you.

    How would that work in a load balanced configuration? Take a closer look at the tnsnames.ora example I included in my original post. I have 4 ADDRESS= sections to denote 4 servers that are part of the load balanced environment.
    Also, I'm not familiar with that syntax, I need to use the syntax supported by the SQLDriverConnect() API function, which looks like this:
    DRIVER={Oracle in OraClient10g_home1}; DBQ=MyDB.world; DBA=W; UID=foo; PWD=bar
    I don't know as SQLDriverConnect() would accept an alternative syntax. But the more important issue here is the ability to specify those 4 servers in the load balanced configuration as indicated by that tnsnames.ora entry.

Maybe you are looking for