Advacing the system date, when a job is scheduled on daily basis.

  • I scheduled a job on daily basis.  For Eg: Every day 12:00 AM.  Assume today is 25/06/2005 and time 4:15 PM.  As I scheduled it on daily basis, the next scheduled time for the execution of the job is 26/05/2005   12:00 AM.  Now, I changed my SQL Server system date to 26/05/2005.  As I just changed system date only, the time also would be 4.15 PM.  I got a doubt whether the job scheduled is executed or not.  When I checked it, it just performed the job.  But, if I advance the date for more than 1 day (2 or 3 ... days).  It is not perfoming the job.  Can anybody help me reason/logic behind this?  Thanks in Advance.

  • if I'm correct, after you changed your systemdate, sqlagent will change the "next rundate/time" to 27/05/2005 12:00AM. So the only thing it does is check wether it has the correct execution-timings for the enabled schedules for the enabled jobs. This refresh is being done a a regular basis.

    It is correct for it not to launch the job _after_ the scheduled time !

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • I believe that the Agent figures the next run time when it thinks that it needs to. (On startup, job completion, changes to the schedule, etc.)

    If you change the system date, the Agent doesn't know about it, so it happily goes on, running the jobs when the right time comes, but that time will not come if you've manually skipped past it.

    So, if you change the system date, I would suggest that you should restart the Agent, so it can re-figure the correct start times for the jobs it is tasked to run.

    I had this same sort of thing happen when I updated the "enabled" column in msdb..sysjobs manually.  Had to restart the Agent get it to run the jobs.  It did not "periodically refresh".

    HTH

     

    jg

     

     

     

  • Hai alzdba

      As you said after changing the system date, I checked the "next rundate".  When I advance the date only one day, it is changing the "next rundate", but when I advance the date more than 1 day i.e. (2 or 3 ... days).  The "next rundate" is not changing.

    Hai JeffGray

      As you advised I have restarted the sqlagent still it is not changing the next rundate.

     

  • - sqlserver needs some (?) time to check and correct it..

    - Can you post an example script for a job where you encounter this issue.

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply