Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server Agent JOB running Indefinitely!

Posted on 2011-03-09
6
Medium Priority
?
422 Views
Last Modified: 2012-05-11
I have a SQL Server  (2005) job that executes a stored procedure.  
The job used to run fine but lately, it hangs for hours (typically finishes in 2 -3  hrs).
So I end up killing it.

When I run the SP from SSMS, it runs and completes.  I have created a brand new job, owner, sa, and have only a single command: exec usp_generate_autonotification in it, it hangs.

SQL Server Agent is running under a domain service account.  I have almost 100 other jobs that are running fine.

Thank you in advance.
D
0
Comment
Question by:dteshome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 35085848
hi

you should trace the job using profiler and see whats happening.
0
 
LVL 41

Expert Comment

by:Sharath
ID: 35086110
While the job is executing, check in the DMVs on what steps of the procedure are in execution.
0
 

Accepted Solution

by:
dteshome earned 0 total points
ID: 35109625
thank you, but running profiler while the job is executing is not an option in our production env.
the DVM's also cause similar performance concerns.

well, this is what the problem ended up being:

the job is configured to write, log to an output file, text file.  The file gets large - over 25 MB. Apparently, as the job executes, it needs to write to the log but cannot open the large text file, it hungs ...

When I changed the job not to write to a log file, it worked!
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 41

Expert Comment

by:Sharath
ID: 35113244
Are you creating new log file every time or appending the content to the existing log file? Can you explain what are you logging over 25MB?
0
 

Author Comment

by:dteshome
ID: 35139714
I am actually appending, however, the job processes several hundred thou records of persons who ask to be notified ... and each run of the job (particularly on the weekends when realestate activity is high) may generate a log that is 10, 20, 30 MB of log ...  what is being logged is not generated by the job per se, I believe the SPs that are called generate what goes into the log.
0
 

Author Closing Comment

by:dteshome
ID: 35178769
I figured out what was going on ...
The sol'ns provided were not helpful in this case.

I am actually appending, however, the job processes several hundred thou records of persons who ask to be notified ... and each run of the job (particularly on the weekends when realestate activity is high) may generate a log that is 10, 20, 30 MB of log ...  what is being logged is not generated by the job per se, I believe the SPs that are called generate what goes into the log.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question