Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DB2 connection getting lost from PERL

Status
Not open for further replies.

138006

IS-IT--Management
Dec 30, 2003
101
0
0
IN
Hi,

I have a PERL script which connects to a DB2 database from it. Now I have a very complex query on huge data 270 million records . It takes more than 2 hrs to run (this is ok and logical). When I run it from DB2 client its fine--infact the DB2 client remains connected for days. However when I run the perl program after 2 hrs the database connectivity gets lost. Why is it happening? Is there any way by which we can stop the DB2 connection to be dropped when called from PERL?

I had the feeling that database connection maintenance is DB2's responsibility. But since its ok from DB2 client and not from PERL, my doubts are high.

Please help
 
You using The DBI & DBD::DB2 ?

If so that's maintained by IBM - write to the owner of DBD::DB2 and ask him/her/them - include (short) sample code and tell them about the versions of everything you're using.

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Hi,
Do you mean the DB2 DBA in my project or someone else?

Actually the problem is the huge volume of data. In some other setup with 0.1 million records I can complete the test within 20 mins. But with 270 million records the connection is getting down. However its ok when same query is running from DB2 CMD. This is really baffling.

Is there any initialization file for DB2 where there is any time-out set?

Regards,
 
What method are you using, within your Perl script, to connect to the DB2 database?

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Hi,

These are all that i have:

use DBI;
use DBD::DB2::Constants;
use DBD::DB2;

$| = 1;
use Tk;
use Tk::pane;
use Tk::progressBar;

Regards,
 
Ok, that's The DBI - and DBD::DB2 which is maintained by IBM.

Before you drop them an email, (the maintainers name is in the DBD documentation. I would suggest that you also give sample code, explain how many rows there are in each table.) I would be looking at the query the indexes available on each object and the ways in which the data is being accessed (you can probably generate an execution plan from a DB2 utility)

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Hi,
I know this is a stupid question but pls let me ask it -- is the DBD documentation resdied inside the PERL installation? Where from can I get the documentation and hence the name of the maintainer?

Regards
 
On a PC it should be in C:\Perl\site\lib\DBD\DB2.pod

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top