Schlagwort-Archive: restore

Server-level event notifications cannot be delivered

This is the error message (or at least part of it) you will get after a restore of the msdb database has been carried out. The SQL Server Agent could not run.

Three things are changed (or at least look diffferent) after restoring a database.

  1. The „owner“ will be the User performing the restore,
  2. Trustworthy will always be false,
  3. Service Broker will always be disabled

(Caveat to point 1: the dbo alias is not changed, there you will find the original owner.)

It is point 3 which is important for the msdb. After restoring the msdb you have to re-enable service broker for the database:

USE master ;
 GO
 ALTER DATABASE msdb SET ENABLE_BROKER ;
 GO

Otherwise you will get (this time the full error message):

Server-level event notifications cannot be delivered. Either Service Broker is disabled in msdb, or msdb failed to start. Event notifications in other databases could be affected as well. Bring msdb online, or enable Service Broker