dbTalk Databases Forums  

Help on handling "hung" scheduled packages.

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Help on handling "hung" scheduled packages. in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeffrey
 
Posts: n/a

Default Help on handling "hung" scheduled packages. - 12-08-2003 , 09:11 PM






Every once in a while (say 3-4 weeks apart), one or more of my
scheduled packages will "hang" and never complete.

I don't get an error, and the job will just run until I check the
SqlAgent myself, see it has been "running" for 87 hours, stop the job
manually and restart it. Of course, nothing is actually happening
during this time, and because it is marked as running, the scheduler
will not kick off another job.

The packages this happens to are those that pull remote information
from a linked Oracle Server to my Sql Server 2000 (sp3).

Now, I figure that I should be able to set some kind of timeout on the
scheduled package. This way, if it goes beyond a certain time, it
will just automatically cancel itself and go back into the queue to be
run again at the next scheduled point.

I know this can be done with the general Windows scheduler.

Now, I looked through the options in the scheduler tabs, and I read
through BOL, but I didn't find anything.

Am I missing something simple? Can this be done as I've laid out?

Thanks,
JK

Reply With Quote
  #2  
Old   
Jeffrey
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 12-09-2003 , 07:23 PM






*Bump*

Any ideas?
JK

Reply With Quote
  #3  
Old   
Chris
 
Posts: n/a

Default RE: Help on handling "hung" scheduled packages. - 12-10-2003 , 01:16 PM



Jeffrey --

I have no help for you, but I have exactly the same problem. I'm hoping that someone can step up and help -- it would be incredibly handy to be able to set a timeout on a SQL Server Agent Job.

Chris

Reply With Quote
  #4  
Old   
Jeffrey
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 12-14-2003 , 03:15 PM



"Chris" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Jeffrey --

I have no help for you, but I have exactly the same problem. I'm hoping that someone can step up and help -- it would be incredibly handy to be able to set a timeout on a SQL Server Agent Job.

Chris
Wow, this is quite a shame.

Has anyone run into this issue and solved it?

I'd rather not have to wait for Yukon....

JK


Reply With Quote
  #5  
Old   
Darren Green
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 12-16-2003 , 12:28 PM



In article <2264ae0.0312141315.7e80d3d8 (AT) posting (DOT) google.com>, Jeffrey
<jeffkretz (AT) hotmail (DOT) com> writes
Quote:
"Chris" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:<515BCE6B-8580-45E1-BC1D-321D7AC2EB5A (AT) microsoft (DOT) com>...
Jeffrey --

I have no help for you, but I have exactly the same problem. I'm
hoping that someone can step up and help -- it would be incredibly
handy to be able to set a timeout on a SQL Server Agent Job.

Chris

Wow, this is quite a shame.

Has anyone run into this issue and solved it?

Two ways to approach this-

1 Find out what us causing the process to hang. Now this probably
depends on what the package is doing, but a good start place is anything
that could raise an error dialog that waits for you to click OK.
Examples could be a badly written COM object, or a bad OLE-DB/ODBC
driver that decides to ask for credentials or just throws an error. Old
debug type MsgBox statements left in code is another favourite.
Obviously start by turning on all logging, task logs, package to file,
package to SQL Server, and the job step output to file option.

2 Detect and warn or resolve jobs running over a long period of time or
a suitably calculated threshold. I have implemented such a mechanism as
standard across all my servers, as whilst I don't have (an ongoing)
problem with Dts, there are other processes that can exhibit this
behaviour.

The key to my approach is that every job has a start step that logs the
start time to a table. It also calculates a duration threshold which the
job should not exceed. The threshold is based on a simple calculation,
including the past history as logged in sysjobhistory.

I then have a regularly running job that uses xp_sqlagent_enum_jobs to
detect which jobs are still running. Jobs that have completed are also
cleaned up at this point. Jobs that have exceeded the duration threshold
can then be "actioned", although I just report on them.



I would go with option 1, and use option 2 as a fallback.
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #6  
Old   
Jeffrey
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 12-16-2003 , 04:17 PM



Darren Green <darren.green (AT) reply-to-newsgroup-only (DOT) uk.com> wrote

Quote:
Two ways to approach this-

[snip]

I would go with option 1, and use option 2 as a fallback.
Thank you very much for this, those options make sense.

As near as I can tell, the hang-up seems to relate to my connection
(via a distributed query) to an external Oracle Database at another
location. In every case, stopping and restarting the job has resolved
the issue.

So, as far as you know, there is no internal method of setting a time
limit on a scheduled job? It would be necessary to write a process
that trolls the job activity and reports/handles hung jobs?

Thanks again,
JK


Reply With Quote
  #7  
Old   
Darren Green
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 12-17-2003 , 01:55 PM



In article <2264ae0.0312161417.1fa52391 (AT) posting (DOT) google.com>, Jeffrey
<jeffkretz (AT) hotmail (DOT) com> writes
Quote:
Thank you very much for this, those options make sense.

As near as I can tell, the hang-up seems to relate to my connection
(via a distributed query) to an external Oracle Database at another
location. In every case, stopping and restarting the job has resolved
the issue.

So, as far as you know, there is no internal method of setting a time
limit on a scheduled job?
Nope. An alternative scheduler may offer this functionality, but this
loses any integration with SQL Server, and could be more hassle than it
is worth.

Quote:
It would be necessary to write a process
that trolls the job activity and reports/handles hung jobs?

I'm afraid so.

I can send you a script for my system. You can then just add some logic
to determine what to do when it detects a long running job. Is the email
shown as your posting address valid?

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #8  
Old   
Jeffrey
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 12-18-2003 , 05:52 PM



Darren Green <darren.green (AT) reply-to-newsgroup-only (DOT) uk.com> wrote

Quote:
I can send you a script for my system. You can then just add some logic
to determine what to do when it detects a long running job. Is the email
shown as your posting address valid?
Darren,

That would be terrific, go ahead and send it to the hotmail address
above. Have to say that I've found your site invaluable since I first
ran into it last year. It's a Class A service, thanks a lot for your
efforts in this.

JK


Reply With Quote
  #9  
Old   
Zev
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 01-03-2004 , 11:36 PM



Darren

May I request that script as well. I recently moved my databases and DTS to a new box and every few days my job just hangs, but looking at the log it appears that it doesn't even begin to process

Thank
Ze

----- Darren Green wrote: ----

In article <2264ae0.0312161417.1fa52391 (AT) posting (DOT) google.com>, Jeffrey
<jeffkretz (AT) hotmail (DOT) com> write
Quote:
Thank you very much for this, those options make sense
As near as I can tell, the hang-up seems to relate to my connectio
(via a distributed query) to an external Oracle Database at anothe
location. In every case, stopping and restarting the job has resolve
the issue
So, as far as you know, there is no internal method of setting a tim
limit on a scheduled job
Nope. An alternative scheduler may offer this functionality, but this
loses any integration with SQL Server, and could be more hassle than it
is worth

Quote:
It would be necessary to write a proces
that trolls the job activity and reports/handles hung jobs
I'm afraid so

I can send you a script for my system. You can then just add some logic
to determine what to do when it detects a long running job. Is the email
shown as your posting address valid

--
Darren Green (SQL Server MVP
DTS - http://www.sqldts.co

PASS - the definitive, global community for SQL Server professional
http://www.sqlpass.or




Reply With Quote
  #10  
Old   
Darren Green
 
Posts: n/a

Default Re: Help on handling "hung" scheduled packages. - 01-04-2004 , 03:46 AM



In message <872F4060-D195-4104-BF82-35C7872496F9 (AT) microsoft (DOT) com>, Zev
<zev.chopp (AT) verizon (DOT) net> writes
Quote:
Darren,

May I request that script as well. I recently moved my databases and
DTS to a new box and every few days my job just hangs, but looking at
the log it appears that it doesn't even begin to process.

Thanks
Zev

Sent.



--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.