[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

SQL Server Agent JOB running Indefinitely!

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
dteshome
Asked:
dteshome
  • 3
  • 2
1 Solution
 
Aaron ShiloChief Database ArchitectCommented:
hi

you should trace the job using profiler and see whats happening.
0
 
SharathData EngineerCommented:
While the job is executing, check in the DMVs on what steps of the procedure are in execution.
0
 
dteshomeAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
SharathData EngineerCommented:
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
 
dteshomeAuthor Commented:
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
 
dteshomeAuthor Commented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now