For maintenance tasks on my LogShipped environment I run T-SQL script to disable the copy/restore agent job for the duration of maintenance and then enable when done. When I enable the jobs via TSQL it seems the schedule hangs (at last run date) and does not execute future schedules and LS DBs fall out of sync. Restarting the SQL Agent & manual start of the job resolves the issues ok.
SQL Server 2016 SP1. Using msdb..sysjobs to disable/enable the job and msdb..sysjobschedule to disable/enable the schedule
Anyone any ideas?