• subscribe
November 20, 2001 12:00 AM

Understanding Schedules and Long-Running Jobs

SQL Server Pro
InstantDoc ID #23014

What happens when a scheduled job runs longer than the scheduled interval time period? For example, if a job is scheduled to execute every 10 minutes and takes 35 minutes to complete, does the job execute again while it's still running?

On the SQL Server Most Valuable Professional (MVP) newsgroup, a private forum for SQL Server MVPs, Microsoft published two design facts about the SQL Server Agent that can help answer this question. First, the SQL Server Agent runs only one instance of a job at a time. Second, the SQL Server Agent calculates the Next Run Date at the end of the job. So, if a job execution takes longer than its scheduled interval, the job will rerun at the next recurrence point. For example, imagine that Job A is scheduled with a 1-minute recurrence interval. Job A starts at 1:25 p.m. and runs for 1 minute 45 seconds. Job A is still running at 1:26, when the next scheduled recurrence should happen, and the SQL Server Agent will run only one instance of a job at a time—so nothing happens at 1:26 p.m. When Job A ends at 1:26:45 p.m., the SQL Server Agent resets the Next Run Date. Based on the specified 1-minute recurrence interval, the next time the job will run is 1:27 p.m.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here
  • SP1?
    I know there is a SP1 for SQL 2008 R2 available....and there is a "feature pack" as well... ...
  • SQL database mirroring
    I have SQL Server 2008 R2 Enterprise 64bit on Windows 2008 R2 Enterprise 64bit.  Each SQL Server has...
  • Dell Compellent Disk Drive
    Does anybody has experience with Dell Compellent Disk Drive? Basically, this system manages all disk...
  • Sql server performance tuning
    I need to find a tool that help me to optimize sql server,queries,improve the performance and solve ...