I was investigating a SQL Server Agent job which I have firing every 15 mins.
It is currently about 3:15 PM on Friday 17 June 2022. (Doing this long hand coz some people might get confused if I say 17/6/2022)
I can see the job history says it ran every 15 mins but stopped at 12 noon. Then it ran at 8:03 pm, 8:15pm, 8:30 pm.
Thing is, it's not that time yet! Like I said it's now around 3:15 pm.
What the heck is going on?
SQL Server version 2017 standard edition.
If it helps, like maybe there is some weird time zone thing going on I am in Sydney Australia. So GMT +10.
The time is correct on the server.
When I do SELECT GETDATE() it also returns the correct time.
Related
On the SQL Server log shipping secondary database server, I have 2 jobs LS_Copy and LS_Restore.
Current schedule: both jobs run every 30 minutes (all day)
New schedule: I want to change the restore job to run every 30 minutes between 10:00 AM to 7:00 PM and 6:30 AM to 7:30 AM. It won't be running for the remainder of the day.
The copy job will still have the same schedule, i.e., every 30 minutes (all day)
Question: do you know if making this change can create issues I am unaware of?
I modified the schedule to new one, everything is working fine. The copy job piles up the files and whenever restore executes, it processes all the queued files in correct order.
Let's say I create a SQL Agent job to have 3 schedules (Monthly 29th, Monthly 30th, Monthly 31st).
For Feb which ends on the 28th, I'm presuming SQL Agent will handle the transition from the end of Feb to March by essentially doing nothing since no Feb 29th occurs.
I'm almost certain of the behavior, but don't have a way to test it (that I can think of). Can someone please confirm that have done this?
My SQL Server Agent job runs everyday 7 PM. How can I disable it to not run every 10th, 11th and 12th date of the month?
Now every month, On 9th, after completion of the job, I do manually by changing start date of the schedule to 13th. Is there any better approach get rid of this manual activity?
My job scheduler has a behavior I can't understand.
It is schedule to fire in the following conditions:
Occurs every 3 month(s) on day 1 of that month at 00:00:00. Schedule will be used starting on 30/09/2015.
So I expected to see it launched next july at midnight and this OK for years.
But it started this night (1st of june).
The script and database have been completely reinstalled on next 5th of may for a migration.
I am using SQL Server 2012 on an on premises server.
Does anybody has an explanation?
Thank you
In SQL Server 2008 R2 if I do:
select SYSDATETIMEOFFSET()
I get back GMT -6.
The TimeZone in Windows that SQL Server is running on is set GMT -7.
Any ideas why there is a difference? Is there somewhere in SQL Server I need to set the TimeZone?
I would guess this is due to Daylight Saving Time being active. Your timezone is officially titled "GMT-7" meaning that normally (not in the Daylight Saving Time part of the year) your time is 7 hours earlier than GMT. But during Daylight Saving Time, that time is adjusted (usually by an hour, but can differ by timezone). So if you were currently in Daylight Saving Time, even though you are in the "GMT-7" timezone, your clock is currently only GMT-6 (6 hours earlier than GMT). I suspect SYSDATETIMEOFFSET() is telling you your actual offset from GMT at the moment as opposed to your timezone's "normal" offset from GMT.
MSDN says SQL Server uses the Windows settings:
SQL Server 2012 obtains the date and time values by using the
GetSystemTimeAsFileTime() Windows API.
Perhaps you have to restart the SQL Server service after you change the time zone?