Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.