Solved

SQL Server Agent JOB running Indefinitely!

Posted on 2011-03-09
6
410 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how the fundamental information of how to create a table.

752 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