LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-17-2010, 09:35 AM   #1
fernfrancis
Member
 
Registered: Feb 2009
Location: Goa(India)-Sharjah(UAE)
Distribution: RHEL,centos,fedora,ubuntu
Posts: 229

Rep: Reputation: 18
odbc help


hi i followed these instruction to connect to DSN

1.Install UNIX ODBC.
Download UNIX ODBC from following link.
http://www.unixodbc.org/unixODBC-2.3.0.tar.gz
copy the unixODBC*.tar.gz file somewhere you can create files and directories
gunzip unixODBC*.tar.gz*
tar xvf unixODBC*.tar
Doing so will create a unixODBC directory with all source files inside.

2. Libraries and Programs
The install uses the standard GNU autoconf process. So its simply a matter of running
./configure*
make*
make install
By default the files are installed into /usr/local. As is usual with configure, this location can be changed by altering the prefix option to configure. i.e.
./configure --prefix=/usr/local/unixODBC
This will install the lib, bin, include and etc directories in /usr/local/unixODBC/lib etc.
To conform with the GNU guidelines the odbcinst file is now installed by default in {prefix}/etc, this can be altered using the --sysconfdir option to configure. To install the files in the old default /etc you would run configure like this
./configure --sysconfdir=/etc

3.Install oracle instant client for 10.2.0 version and set necessary environment variables. Please refer to oracle_env.sh file after installation (known and working solution: call this script in .bashrc file to set environment variables at terminal and ssh startup)


4.To create a DSN go to odbcinst.ini file in linux’s /etc directory and write following lines.
[ORACLE]
Driver=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/libsqora.so.10.1
(Note: This is our environment’s setup. We need access of libsqora.so.10.1
library. Set this path according to your environment.)

Now, go to odbc.ini file in /etc directory and write following lines.
[AADSN]
Driver=ORACLE
ServerName=10.200.2.81
Port=1521
Database=aadca

Now go to $ prompt and check this DSN with isql utility by following command
isql –v AADSN UserName Password
This must send you to sql prompt. Check by executing any simple query.

when i issue this command i get the error

[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified
[ISQL]ERROR: Could not SQLConnect

can someone help me with this issue

Thanks
 
Old 10-18-2010, 07:39 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 226

Rep: Reputation: 51
Just a couple quick thoughts:

Are you trying to specify the actual database in the command line? In the config file, you are specifying "aadca" and at the command line, you are specifying AADSN.

From translating the error output, it seems you couldn't connect because the system couldn't figure out what data source to connect to. The database "aadca" exists, right?

HTH. Let us know.

Last edited by ShadowCat8; 10-18-2010 at 07:41 PM. Reason: Double-checking
 
Old 10-19-2010, 07:57 AM   #3
fernfrancis
Member
 
Registered: Feb 2009
Location: Goa(India)-Sharjah(UAE)
Distribution: RHEL,centos,fedora,ubuntu
Posts: 229

Original Poster
Rep: Reputation: 18
yes the database exist. and is being currently used by another application.
 
Old 10-19-2010, 01:00 PM   #4
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 226

Rep: Reputation: 51
Okay,

What is the output of
Code:
~ # odbcinst -q -d ORACLE
and then
Code:
~ # odbcinst -q -s aadca
?

HTH. Let us know.
 
Old 10-20-2010, 01:04 AM   #5
fernfrancis
Member
 
Registered: Feb 2009
Location: Goa(India)-Sharjah(UAE)
Distribution: RHEL,centos,fedora,ubuntu
Posts: 229

Original Poster
Rep: Reputation: 18
hi

this is the output
thusitha@isa-tbandara:~$ odbcinst -q -d ORACLE

[ORACLE]

thusitha@isa-tbandara:~$ odbcinst -q -s aadca

[AADSN]
 
Old 10-21-2010, 01:06 PM   #6
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 226

Rep: Reputation: 51
Quote:
Originally Posted by fernfrancis
[ORACLE]
Driver=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client/lib/libsqora.so.10.1
You have confirmed that this driver library is there? (Just double-checking.)

Also, what do you have for a "[DEFAULT]" entry in your odbc.ini?

I found this and noted that even with a set entry in odbc.ini, isql seems to look for the default entry first.

HTH. Let us know.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] PHP/ODBC.so Chris Gelijkens Linux - Software 4 10-13-2010 03:32 AM
odbc I_AM Linux - Software 6 04-10-2008 06:47 AM
Mysql and odbc Murdock1979 Linux - Server 1 01-09-2008 09:42 AM
how to set odbc Raakh Linux - Newbie 6 06-04-2007 07:27 AM
Linux Odbc munna_502 Linux - Software 1 03-30-2004 04:03 PM


All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration