LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-17-2014, 09:34 AM   #1
ryan.mongeau
LQ Newbie
 
Registered: Aug 2013
Location: Sterling, MA
Distribution: Debian 6.0
Posts: 9

Rep: Reputation: Disabled
FreeTDS/ODBC


We have a report that queries our MSSQL server via perl. After running the report a few times, its like the ODBC driver completely crashes. The SQL server is still running on the Windows server - our business system works with no issues. The linux server running the reports just stops working alltogether with the SQL server. Any ideas on why this is or how to fix/isolate the issue?

Any help is greatly appreciated. Thanks.
 
Old 04-18-2014, 09:56 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,632

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ryan.mongeau View Post
We have a report that queries our MSSQL server via perl. After running the report a few times, its like the ODBC driver completely crashes. The SQL server is still running on the Windows server - our business system works with no issues. The linux server running the reports just stops working alltogether with the SQL server. Any ideas on why this is or how to fix/isolate the issue?

Any help is greatly appreciated. Thanks.
Not much we can tell you, without seeing the script. Could be as simple as a bug somewhere in it, a mishandled connection, etc. And where did you get the MSSQL 'driver' you mention? If you're talking about the DBD::ODBC driver from CPAN (the logical choice), you should also know that MSSQL doesn't behave correctly (huge surprise there), under certain conditions.

Things like performing a query that doesn't return results, or trying to access a data field that is NULL, can cause problems. Also, you don't mention whether you have any XML data types in what you're reading, as that, too, can cause a problem with some older versions of DBD::ODBC

The CPAN page on that module has lots of information and potential gotchas/problems with MSSQL:
http://search.cpan.org/~mjevans/DBD-ODBC-1.48/ODBC.pm

Honestly, if this was my project, and I only needed reports once a day/week/whatever, I'd set up a scheduled job on the MS server to export the database to a .csv file, and a cron job on the Linux server to import that file into a MySQL database, and enjoy better speed, stability, and ease of coding. It's two extra steps, but the upside is that you'd have a hot export of the MSSQL database if things go pear shaped, and you could even test migrating your other pieces of software over to MySQL...if you felt like going down the Linux-only road.
 
Old 04-21-2014, 09:23 AM   #3
ryan.mongeau
LQ Newbie
 
Registered: Aug 2013
Location: Sterling, MA
Distribution: Debian 6.0
Posts: 9

Original Poster
Rep: Reputation: Disabled
I'm using the CPAN driver DBD::ODBC.

I actually like the idea of putting the data into MySQL a lot. We only need to run this specific report once a month or so.
 
Old 04-21-2014, 10:30 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,632

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by ryan.mongeau View Post
I'm using the CPAN driver DBD::ODBC.
I actually like the idea of putting the data into MySQL a lot. We only need to run this specific report once a month or so.
Well, I can only offer the advice of that being what I'd do. It would offer a good deal of stability to the reports, and give you other benefits as well, too. Since that data would be 'live' (but NOT the production database), you could run reports more often, hook things into a web interface for graphing and/or running custom reports ad-hoc, etc. And NOTHING you do on that database would affect production.

That said, if you want your other perl program to function better/at all, I'd check the data types and queries the next time it fails. Run the queries manually against the DB, and see what it pulls out. You might be able to write some error handling into your program to catch such exceptions.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeTDS nerver gives libtdsodbc.so crimsontide Linux - Software 3 05-31-2023 07:28 PM
How can I connect to Sybase using FreeTDS? Aurorius Programming 2 01-27-2011 12:08 AM
PHP 5 with FREETDS Manuel-H Slackware 2 01-14-2008 06:15 AM
FreeTDS akurtis Linux - Networking 0 08-01-2006 10:51 AM
FreeTDS Install Problem wizhuff Linux - Software 1 07-27-2005 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:19 AM.

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
Open Source Consulting | Domain Registration