﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / SQL Agent skipping job runs? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 22:53:55 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>Back to the original question by OP. We used to experience similar issue a while ago when the jobs were simply skipped. No failures. That happened when the service account was locked out in AD. So you are really will need to check any logins failures around the time when jobs didnt run and check the AD as well.</description><pubDate>Fri, 01 Mar 2013 19:02:15 GMT</pubDate><dc:creator>barsuk</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>It might be more effective to start a new thread in the 2008 forum instead of dig up an old 2005 thread.</description><pubDate>Fri, 01 Mar 2013 08:58:11 GMT</pubDate><dc:creator>homebrew01</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>I am experiencing the same issue with SQL Server 2008 R2. The job will execute and you can see it in the history, but the run time is typically less than 10 seconds and the code itself did not execute. Actually, some of the code is executing, but not all of it. Strange as hell. And it is infrequent. Some days it works, some days it doesn't. Here is one of the jobs that is showing this behavior:[code="sql"]DECLARE @Threads INT = 5DECLARE @ReorgThreshold INT = 30DECLARE @Rows BIGINT = 10000DECLARE @ByPassGetStats BIT = 0DECLARE @ByPassDefrag BIT = 0 DECLARE @DatabaseID INT;DECLARE @DatabaseName VARCHAR(255);DECLARE @TableName VARCHAR(255);DECLARE @SchemaName VARCHAR(255);DECLARE @ThreadCounter INT;DECLARE @SQL NVARCHAR(4000);CREATE	TABLE #IndexFrag (	DatabaseName VARCHAR(255) NULL, 	ObjectID INT, 	IndexID INT, 	PartitionNumber INT,	FragmentationPerc FLOAT, 	Pages INT, 	Records BIGINT, 	IndexName VARCHAR(255), 	SchemaName VARCHAR(255), 	TableName VARCHAR(255), 	AllowPageLocks INT);CREATE TABLE #TableList (	DatabaseName VARCHAR(255) NULL, 	SchemaName VARCHAR(255) NULL,	TableName VARCHAR(255) NULL, 	Records BIGINT );IF @ByPassGetStats = 0BEGIN	--Get the index fragmentation	DECLARE ReorgIndexCursor01 CURSOR FOR	SELECT	[name], database_id	FROM	master.sys.databases	WHERE	[name] NOT IN ('master', 'model', 'tempdb') 	ORDER	BY [name];	OPEN	ReorgIndexCursor01;	FETCH	NEXT FROM ReorgIndexCursor01 INTO @DatabaseName, @DatabaseID;	WHILE @@FETCH_STATUS = 0	BEGIN		INSERT	INTO #IndexFrag (DatabaseName, ObjectID, IndexID, PartitionNumber, FragmentationPerc, Pages, Records)		SELECT	@DatabaseName,				ps.OBJECT_ID,				ps.index_id,				ps.partition_number,				ps.avg_fragmentation_in_percent,				ps.page_count,				ps.record_count		FROM	master.sys.dm_db_index_physical_stats (@DatabaseID, NULL, NULL , NULL, N'SAMPLED') ps		WHERE	ps.index_id &amp;gt; 0		OPTION (MaxDop 1);			--Update the table with the schema, table, and index names		SELECT	@SQL = 'USE [' +  @DatabaseName + '] 						UPDATE	#IndexFrag						SET		IndexName = i.name, 								SchemaName = s.name, 								TableName = o.name, 								AllowPageLocks = i.allow_page_locks						FROM	#IndexFrag ti								INNER JOIN sys.objects o ON ti.ObjectID = o.object_id								INNER JOIN sys.schemas s ON o.schema_id = s.schema_id								INNER JOIN sys.indexes i ON o.object_id = i.object_id						WHERE	ti.DatabaseName = ' + CHAR(39) + @DatabaseName + CHAR(39) + '								AND i.index_id = ti.IndexID  ';				EXEC (@SQL);		FETCH	NEXT FROM ReorgIndexCursor01 INTO @DatabaseName, @DatabaseID;	END	CLOSE ReorgIndexCursor01;	DEALLOCATE ReorgIndexCursor01;	--Update the PNGCORP_IndexList table	UPDATE	msdb.dbo.PNGCORP_IndexList 	SET		FragmentationPerc = f.FragmentationPerc,			Pages = f.Pages, 			Records = f.Records, 			LastChecked = GETDATE()	FROM	#IndexFrag f			INNER JOIN msdb.dbo.PNGCORP_IndexList il ON il.DatabaseName = f.DatabaseName						AND il.ObjectID = f.ObjectID						AND il.IndexID = f.IndexID						AND il.PartitionNumber = f.PartitionNumber;	--Insert new indexes into the PNGCORP_IndexList	INSERT	INTO msdb.dbo.PNGCORP_IndexList (DatabaseName, ObjectID, IndexID, PartitionNumber, FragmentationPerc, Pages, Records, IndexName, 			SchemaName, TableName, AllowPageLocks, LastChecked)	SELECT	DatabaseName, ObjectID, IndexID, PartitionNumber, FragmentationPerc, Pages, Records, IndexName, 			SchemaName, TableName, AllowPageLocks, GETDATE()	FROM	#IndexFrag f	WHERE	(	SELECT	COUNT(*)				FROM	msdb.dbo.PNGCORP_IndexList il				WHERE	il.DatabaseName = f.DatabaseName						AND il.ObjectID = f.ObjectID						AND il.IndexID = f.IndexID						AND il.PartitionNumber = f.PartitionNumber) = 0;END--Get the tables we need to reindexINSERT	INTO #TableList (DatabaseName, SchemaName, TableName, Records)SELECT	DatabaseName, SchemaName, TableName, MAX(Records)FROM	msdb.dbo.PNGCORP_IndexListWHERE	FragmentationPerc &amp;gt;= @ReorgThreshold		AND Records &amp;gt;= @RowsGROUP	BY DatabaseName, SchemaName, TableNameORDER	BY MAX(Records) DESC--Cycle through the problem indexes and insert them into the PNGCORP_IndexReorg# tables.SET	@ThreadCounter = 1; IF @Threads &amp;gt; 5 SET @Threads = 5;TRUNCATE TABLE msdb.dbo.PNGCORP_IndexReorg1;TRUNCATE TABLE msdb.dbo.PNGCORP_IndexReorg2;TRUNCATE TABLE msdb.dbo.PNGCORP_IndexReorg3;TRUNCATE TABLE msdb.dbo.PNGCORP_IndexReorg4;TRUNCATE TABLE msdb.dbo.PNGCORP_IndexReorg5;DECLARE ReorgIndexCursor02 CURSOR FORSELECT	DatabaseName, SchemaName, TableNameFROM	#TableListORDER	BY Records DESC;OPEN	ReorgIndexCursor02;FETCH	NEXT FROM ReorgIndexCursor02 INTO @DatabaseName, @SchemaName, @TableName;WHILE @@FETCH_STATUS = 0BEGIN	SET @SQL = '	INSERT	INTO msdb.dbo.PNGCORP_IndexReorg' + CAST(@ThreadCounter AS VARCHAR(1)) + ' (DatabaseName, SchemaName, TableName, IndexName, AllowPageLocks)	SELECT	DISTINCT i.DatabaseName, i.SchemaName, i.TableName, i.IndexName, i.AllowPageLocks	FROM	msdb.dbo.PNGCORP_IndexList i			INNER JOIN #TableList t ON t.DatabaseName = i.DatabaseName					AND t.SchemaName = i.SchemaName					AND t.TableName = i.TableName	WHERE	i.DatabaseName = ''' + @DatabaseName + '''			AND i.SchemaName = ''' + @SchemaName + ''' 			AND i.TableName = ''' + @TableName + '''			AND i.FragmentationPerc &amp;gt;= ' + CAST(@ReorgThreshold AS VARCHAR(25)) + '			AND i.Records &amp;gt;= ' + CAST(@Rows AS VARCHAR(25)) + '; ';	EXEC (@SQL);	SET @ThreadCounter = @ThreadCounter + 1;	IF @ThreadCounter &amp;gt; @Threads SET @ThreadCounter = 1;	FETCH	NEXT FROM ReorgIndexCursor02 INTO @DatabaseName, @SchemaName, @TableName;ENDCLOSE ReorgIndexCursor02;DEALLOCATE ReorgIndexCursor02;DROP TABLE #TableList;DROP TABLE #IndexFrag;--Start the index jobsIF @ByPassDefrag = 0BEGIN	EXEC msdb.dbo.sp_start_job @Job_Name = 'Database Maintenance.IndexReorg1';	IF @Threads &amp;gt;= 2 EXEC msdb.dbo.sp_start_job @Job_Name = 'Database Maintenance.IndexReorg2';	IF @Threads &amp;gt;= 3 EXEC msdb.dbo.sp_start_job @Job_Name = 'Database Maintenance.IndexReorg3';	IF @Threads &amp;gt;= 4 EXEC msdb.dbo.sp_start_job @Job_Name = 'Database Maintenance.IndexReorg4';	IF @Threads = 5 EXEC msdb.dbo.sp_start_job @Job_Name = 'Database Maintenance.IndexReorg5';END[/code]What we are doing here is finding all of the indexes with a fragmentation &amp;gt; 30% and putting them into 5 different tables. Then we kick off five other jobs to perform the index maintenance. On some days, this jobs executes perfectly. It normally takes about an hour to run (there are some large databases on this server). On other days, it takes less than 10 seconds to execute, the code that updates the index list isn't executed. But what is really strange is the last couple of lines of code are ALWAYS executed and the five "IndexReorg" jobs are kicked off. I have the same issue with a db check job. Some days it executes, some days it doesn't. SQL Agent always reports that the job executed successfully, but you could tell by the runtime that nothing was done.[code="sql"]SET NOCOUNT ONDECLARE @SQL NVARCHAR(MAX)DECLARE @DatabaseName VARCHAR(255)DECLARE CheckDatabaseIntegrityCursor CURSOR FORSELECT	[name]FROM	master.sys.databasesWHERE	[name] NOT IN ('model', 'tempdb') ORDER	BY [name]OPEN	CheckDatabaseIntegrityCursorFETCH	NEXT FROM CheckDatabaseIntegrityCursor INTO @DatabaseNameWHILE @@FETCH_STATUS = 0BEGIN	PRINT @DatabaseName + '    ---------------------------------------------------------------'	SELECT	@SQL ='		USE [' + @DatabaseName + '] 						DBCC CHECKDB(N' + CHAR(39) + @DatabaseName + CHAR(39) + ')						'				PRINT @SQL	EXEC master.dbo.sp_executesql @SQL	FETCH	NEXT FROM CheckDatabaseIntegrityCursor INTO @DatabaseNameENDCLOSE CheckDatabaseIntegrityCursorDEALLOCATE CheckDatabaseIntegrityCursor[/code]I've seen a few posts on various forums where folks have reporting such issues, but nobody has any solution. Anyone else see anything like this?</description><pubDate>Thu, 28 Feb 2013 08:35:15 GMT</pubDate><dc:creator>Edward Mlynar</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>Hi,We have had a similar issue to this in SQL Server 2008,has anyone found out why this would occur?Regards</description><pubDate>Tue, 09 Aug 2011 03:29:43 GMT</pubDate><dc:creator>scootez</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>Anything interesting in the Windows event log, or the SQL logs for the time that this happened?  Or didn't happen as the cas may be...</description><pubDate>Wed, 07 Jan 2009 07:10:11 GMT</pubDate><dc:creator>Jason Shadonix</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>This server has about 50 jobs on it some run as frequently as every 10 minutes.</description><pubDate>Wed, 07 Jan 2009 07:05:28 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>What other jobs are running on that server?  I had a similar problem a while back and found that another job, scheduled to start 5 minutes before mine, ran long causing the agent to 'skip' my job.  I know servers are supposed to be able to multitask, but just for grins and giggles I rescheduled my job for 5 minutes before the other job's scheduled start time.  That seemed to work like a charm - never had another 'skip'!</description><pubDate>Wed, 07 Jan 2009 06:28:53 GMT</pubDate><dc:creator>cspringstead</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>The job didn't fail it simply didn't execute at all. There is no entry for the time it was suppose to execute in the job history at all.</description><pubDate>Tue, 06 Jan 2009 09:10:45 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>If it's showing up in the history, then it sounds like it's running.  Perhaps it's immediatly failing, or starting then immediatly stopping?If you drill down into the details of one of the history rows, you can perhaps get a little information.  I've found you get a lot more information about failures (or just general troubleshooting information) if you specify an output file in the advanced page in the job step properties &amp;#119;indow.  Might try that and see if you get any useful information about what its doing.</description><pubDate>Tue, 06 Jan 2009 09:07:17 GMT</pubDate><dc:creator>Jason Shadonix</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>There is plenty of job history plus I archive all job history off to another server.</description><pubDate>Tue, 06 Jan 2009 09:03:11 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>If you right-click on the job in SSMS, and hit view history, does it come back with anything at all?</description><pubDate>Tue, 06 Jan 2009 08:50:26 GMT</pubDate><dc:creator>Jason Shadonix</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>The job hasn't be modified since it was installed. SQL Agent was running the whole time. We get alerts immediately if the agent is down from our nagios box.We have had problems on other boxes where the job would hang on sending notification but nothing like this.Cheers,Wes</description><pubDate>Tue, 06 Jan 2009 08:35:04 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>any chance sql agent just wasn't running at the time?</description><pubDate>Tue, 06 Jan 2009 07:58:39 GMT</pubDate><dc:creator>george sibbald</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>I think your sql agent cache is not in sync with msdb database. You can check this by running xp_sqlagent_notify 'D', null, Null, null, null.This will dump what is there in the sql memory for jobs. if your job is not listed then it will not run. Propably in that case you need to restart the sql agent.After running the above query please look into agent error log it would have dumped what is there in sql server agent cache.</description><pubDate>Tue, 06 Jan 2009 07:44:16 GMT</pubDate><dc:creator>Vee</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>No not yet. This job has run successfully except for the one day it skipped. It ran successfully today at its normal time. We can't find any reason for it to have skipped a run, the previous run was successful and in its normal run time.</description><pubDate>Tue, 06 Jan 2009 07:13:16 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>Did you find out what the problem was?</description><pubDate>Tue, 06 Jan 2009 02:14:49 GMT</pubDate><dc:creator>Ignacio A. Salom Rangel</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>[quote][b]Wesley Brown (1/5/2009)[/b][hr]Hello all,I've got a weird one. It appears that I have had the SQL Agent just skip running a scheduled job task. No failure no job stuck executing just flat skipped it. I did ask the mighty google but didn't see anything that resembled the problem.Has anyone else had an issue with SQL 2005 skipping jobs like this?Thanks,Wes[/quote]Please check SQL job owner has a access on that step code or not?</description><pubDate>Mon, 05 Jan 2009 22:24:27 GMT</pubDate><dc:creator>Paresh Prajapati</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>Yeah,I walked through all of it and so did someone else just to make sure I didn't miss something. I hate writing a monitor for all the jobs on all the servers because they may not execute period.</description><pubDate>Mon, 05 Jan 2009 10:44:24 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item><item><title>RE: SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>I've had this once and not figured out why.Things you might want to check: Job enabled? Job schedule enabled? Job schedule starting time and ending time; windows time service, task scheduler service..</description><pubDate>Mon, 05 Jan 2009 10:20:44 GMT</pubDate><dc:creator>DBA in Unit 7</dc:creator></item><item><title>SQL Agent skipping job runs?</title><link>http://www.sqlservercentral.com/Forums/Topic629955-146-1.aspx</link><description>Hello all,I've got a weird one. It appears that I have had the SQL Agent just skip running a scheduled job task. No failure no job stuck executing just flat skipped it. I did ask the mighty google but didn't see anything that resembled the problem.Has anyone else had an issue with SQL 2005 skipping jobs like this?Thanks,Wes</description><pubDate>Mon, 05 Jan 2009 10:10:00 GMT</pubDate><dc:creator>Wesley Brown</dc:creator></item></channel></rss>