Solved

SQL Server Agent JOB running Indefinitely!

Posted on 2011-03-09
6
389 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
  • 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 40

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 40

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
Read about achieving the basic levels of HRIS security in the workplace.
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
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now