dbWarden SQL Server Monitoring Script with SQL Server 2017

[german version below]

I’m still using the free dbWarden Monitoring Scripts for an easy basis monitoring of our SQL Server Environment. Links to the orignal documentation is at the bottom of this short blog article.

With SQL Server 2017 there is a new change neccessary for the Health Report to run properly. It’s nearly the same point that I described on January for SQL 2012 and above (german only).
The Replication Helper procedure is changed and need aditional parameters.
It is the sp_helpdistributor Store Procedure. dbWarden uses a temporary table to receive the results from the helper SP, defined like this:

	/* Replication Distributor */
	CREATE TABLE #REPLINFO (
		distributor NVARCHAR(128) NULL, 
		[distribution database] NVARCHAR(128) NULL, 
		directory NVARCHAR(500), 
		account NVARCHAR(200), 
		[min distrib retention] INT, 
		[max distrib retention] INT, 
		[history retention] INT,
		[history cleanup agent] NVARCHAR(500),
		[distribution cleanup agent] NVARCHAR(500),
		[rpc server name] NVARCHAR(200),
		[rpc login name] NVARCHAR(200),
		publisher_type NVARCHAR(200),	-- additional Fields in the sp_helpdistributor SP from here on:
			[deletebatchsize_xact]	INT, -- VB:2017-11-09-10:01 Field added
			[deletebatchsize_cmd]	INT -- VB:2017-11-09-10:01 Field added
		)

	INSERT INTO #REPLINFO
	EXEC sp_helpdistributor

The call to the SP (EXEC sp_helpdistributor) at the bottom caused the error:
„Column name or number of supplied values does not match table definition“

The two fields (deletebatchsize_xact and deletebachsize_cmd) needs to be added to the temporary table definition before the insert command can be executed without error.
This all is found in the Stored Procedure rpt_HealthReport which is called by the Agent Job Health Report.

Ressources (below)

Thanks for reading,
Voloker


Ich benutze immer noch die kostenlosen dbWarden Monitoring Scripts für eine einfache Überwachung unserer SQL Server-Umgebung. Links zur Originaldokumentation finden Sie am Ende dieses kurzen Blog-Artikels.

Mit SQL Server 2017 ist eine neue Änderung erforderlich, damit der Health-Bericht ordnungsgemäß ausgeführt werden kann. Es ist fast derselbe Punkt, den ich im Januar für SQL 2012 und höher beschrieben habe.
Die Replication Helper Prozedur sp_helpdistributor wurde geändert und benötigt zusätzliche Parameter.

	/* Replication Distributor */
	CREATE TABLE #REPLINFO (
		distributor NVARCHAR(128) NULL, 
		[distribution database] NVARCHAR(128) NULL, 
		directory NVARCHAR(500), 
		account NVARCHAR(200), 
		[min distrib retention] INT, 
		[max distrib retention] INT, 
		[history retention] INT,
		[history cleanup agent] NVARCHAR(500),
		[distribution cleanup agent] NVARCHAR(500),
		[rpc server name] NVARCHAR(200),
		[rpc login name] NVARCHAR(200),
		publisher_type NVARCHAR(200),	-- additional Fields in the sp_helpdistributor SP from here on:
			[deletebatchsize_xact]	INT, -- VB:2017-11-09-10:01 Field added
			[deletebatchsize_cmd]	INT -- VB:2017-11-09-10:01 Field added
		)

	INSERT INTO #REPLINFO
	EXEC sp_helpdistributor

Der Aufruf der SP (EXEC sp_helpdistributor) verursachte den Fehler:
„Spaltenname oder Anzahl der angegebenen Werte stimmt nicht mit der Tabellendefinition überein“

Die beiden Felder (deletebatchsize_xact und deletebachsize_cmd) müssen der temporären Tabellendefinition hinzugefügt werden, bevor der insert-Befehl ohne Fehler ausgeführt werden kann.
Dies ist in der Store-Prozedur rpt_HealthReport zu finden, die vom Agent-Job-Healt Report aufgerufen wird.

Ressourcen:

Danke fürs Lesen!
Volker

5 Gedanken zu „dbWarden SQL Server Monitoring Script with SQL Server 2017

  1. Pingback: dbWarden – another change in the sp_helpdistributor with SQL Server 2017 CU7 or 6 | Volker Bachmann and SQL Server

  2. There is one more column that needs to be added to the exact same temp table:

    [distribution listener] nvarchar(MAX)

    I just installed dbWarden on a fresh SQL2017 installation, and ran into this exact same issue

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.