dbWarden – another change in the sp_helpdistributor with SQL Server 2017 CU7 or 6

Another change in the sp_helpdistributor Stored Procedure in CU7 or CU6 of SQL 2017 requires a change in the dbWarden rpt_HealthReport Stored Procedure.
I’ve upgraded from CU5 to CU7, so one of the last two CU changed the System SP again.

Additional to the both that are described in a previous article there needs to be one more parameter to be added before calling the SP:

dist_listener NVARCHAR(200)

After that the Health Report works like before.

Update: with new Replication there is another error.
One more field is missing in the #PUBINFO Temporary table in the rpt_HealtReport
Add publisher NVARCHAR(128) at the end of the temp table and then call sp_replmonitorhelppublication.

Thanks for reading.

Regards,
Volker

Ressources:

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

dbWarden – Monitoring – Änderung für SQL Server > 2012 notwendig

Ich bin immer noch ein Fan von dem SQL Skript „dbWarden“ welches ich nach wie vor zum Monitoring meiner SQL Server verwende.
Ich hatte das ja auch in den PASS Regionalgruppen Rheinland und Ruhrgebiet vorgestellt.
Die Weiterentwicklung ist leider zum Stillstand gekommen, die ursprünglichen Autoren haben schon länger keine Erweiterung mehr vorgestellt.

Seit Version 2012 des SQL Server gibt es Fehlermeldungen in dem täglichen Health Report:

Msg 213, Level 16, State 7, Procedure sp_replmonitorhelppublication, Line 322
Column name or number of supplied values does not match table definition.

Ein User in dem „Supportforum“ von SqlServerCentral für das Projekt hat das Problem erkannt und gelöst.

https://www.sqlservercentral.com/Forums/1441532/dbWarden-A-Free-SQL-Server-Monitoring-Package?PageIndex=18

After some digging I found that the problem is on section
/* Replication Publisher */   of the rpt_HealthReport stored procedure.

More specifically, the TEMP table #PUBINFO is populated with the output of sp_replmonitorhelppublication (on the distribution db) but it lacks the last column named publisher.
I added the missing column with a single line
,publisher NVARCHAR(128) — due to inconsistency with sp_replmonitorhelppublication’s outut right after line 998 on rpt_HealthReport and the Health Report was generated without any issue!
* DON’T FORGET THE COMMA AT THE BEGINNING

Auch wenn die Zeile in der Stored Procedure bei mir etwas anders ist, die Stelle ist zu finden.

Mit dieser Änderung funktioniert das Monitoring auch mit SQL 2012 und 2014 – 2016 steht in kürze an – ich werde dazu weiter berichten.

Danke fürs Lesen,
Volker

PS: Ältere Artikel dazu finden sich auch hier im Blog unter dem Schlagwort dbWarden

Base Monitoring

TSQLTuesdayT-SQL Tuesday #66: Base Monitoring

Cathrine Wilhemsen (b|t) is hosting the T-SQL Tuesday blog party of this month.

I will describe what’s my understanding of Base Monitoring for SQL Server.

Last Thursday 5/7/2015 I presented these thoughts at a PASS regional Chapter in Cologne/Germany.

„My“ Base Monitoring consists of monitoring all Events that come up from too few hard disk space, memory or CPU. It is also about monitoring of locking, blocking or deadlocks, long running queries/jobs and failure in logins.
I will also do additional tasks that didn’t belong to the monitoring itself but help in failure check and reorganization of indexes and so on (…)

All this was arranged and written down after an installation of a new SQL Server.
These are the steps I did:

1. create a DBA Database for several scripts and tables (see below)
2. install the main script from dbWarden for Monitoring
3. install Integrity check and Maintenance scripts from Ola Halengren into DBA Database
4. create GetErrorLogEvent Stored Procedures and Job for Mails out of the SQL Errorlog into DBA Database
5. create Jobs for recycling ErrorLogs
6. Performance Monitoring, Event Logs with an external Tool called Host Monitor

The dbWarden Script (2.) is a great ressource for real time monitoring blocking, deadlocks, long running querys, jobs and so on – best of all: it is free of charge (!). It also brings a detailed and configurable health report of the server that will be sent every morning.

The scripts from Ola Halengren (3) are well known in the SQL Server Community for bringing us perfect maintenance tasks for index and statistic updates with rebuild online/offline or reorganize where it is neccessary.
Additionally there is a script for integrity check – and backup of course. 🙂

The GetErrorLogEvent Script (4.) was originally written by Jonathan Kehayias and published on an MSDN Archive site. I didn’t found the site any more on MSDN so the script is attached together with the presentation (Sorry, only german these days) below.

For recycling the Error Log (5.) it is only neccessary to create a job with the two commands (exec dbo.sp_cycle_errorlog and exec dbo.sp_cycle_agent_errorlog).

The only tool that is not free of charge is the last one, called Host Monitor.
It is perfect for more monitoring especially for long term monitoring.

Ressources

dbWarden
Description: http://www.sqlservercentral.com/articles/Monitoring/98106/
Download, Wiki: http://sourceforge.net/projects/dbwarden/

Ola Halengren
https://ola.hallengren.com/

Hostmonitor (€)
http://www.ks-soft.net

GetErrorLogEvents and Basis Monitoring Presentation from the PASS Chapter in Cologne (German)
BaseMonitoring_20150507

Thanks for reading,
Volker

Rückblick auf Vorträge zum SQL Server Monitoring dbWarden

In 2013 habe ich in den Regionalgruppen Köln/Bonn/Düsseldorf sowie Ruhrgebiet einen Vortrag zu einem kostenlosen Monitoring Skript (dbWarden) halten können welches ich Euch nicht vorenthalten möchte.

Es handelt sich dabei um eine Kombination aus Skripten und Jobs zum SQL Server Monitoring – Warden = Wächter, Aufseher

Voraussetzungen:

  • SQL Server Agent, SQL 2005 ff.
  • „This script assumes you already have DBMail setup (with a Global Public profile available.)“

Beschreibung: http://www.sqlservercentral.com/articles/Monitoring/98106/

Forum: http://www.sqlservercentral.com/Forums/Topic1441532-3362-1.aspx

Download: http://sourceforge.net/projects/dbwarden/

Hier dann noch die Präsentation von dem Termin in Köln am 3.6.2013:
0306 dbWarden Volker Bachmann

Viele Grüße
Volker